From patchwork Tue Mar 4 09:59:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sagi Grimberg X-Patchwork-Id: 3760591 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BC1439F1EE for ; Tue, 4 Mar 2014 09:59:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DE5E42041C for ; Tue, 4 Mar 2014 09:59:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 080A4203EC for ; Tue, 4 Mar 2014 09:59:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756656AbaCDJ7I (ORCPT ); Tue, 4 Mar 2014 04:59:08 -0500 Received: from mail-ee0-f46.google.com ([74.125.83.46]:37333 "EHLO mail-ee0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756655AbaCDJ7F (ORCPT ); Tue, 4 Mar 2014 04:59:05 -0500 Received: by mail-ee0-f46.google.com with SMTP id t10so1815249eei.5 for ; Tue, 04 Mar 2014 01:59:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=bpTm/T7VRU6gSJOpPMWdI3P6q3cBDGxaXRG6SdkyN5c=; b=HEQu9UfpKCVbJyi80jepYDlUJ8n2Cj/VGHKBcm9fnDBGvdreSYgxER8N8bL/uBPivN C3N+nkL6U0GTPSykrGUJA8fdSQNTNfCmz+fdq8xEHAqeJRFqZRk3azNMrGLvrKXpRr7d ZGMFAC3L6PAwcSETvrt5khKuD5iSbd7UlSqXFb2fGi3nM2gm6XPd9A1jmJENLktwbyOw nb/B//2HTqmgK02LMkVLsTohzVtKR0g0CI6f3eWb+n07E1JVfC8bHg82dsj/AiZ4OzZt EBoRfiymgiLO4//mB/0aVb+2iZXaD4R+VwVCZbjn3UJvgmcVbnezSzoa1QqXC7FxGULy poyw== X-Gm-Message-State: ALoCoQlqezt19v1JQ03ikAnsm/JuzmPyjaoAtHRbtd2JmwKvKaDn1/yX3Z3Q2gkUEtOXd1/ug34Z X-Received: by 10.14.204.9 with SMTP id g9mr16555493eeo.82.1393927143527; Tue, 04 Mar 2014 01:59:03 -0800 (PST) Received: from [172.25.5.3] (out.voltaire.com. [193.47.165.251]) by mx.google.com with ESMTPSA id o43sm61066249eef.12.2014.03.04.01.59.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 04 Mar 2014 01:59:03 -0800 (PST) Message-ID: <5315A3E4.508@dev.mellanox.co.il> Date: Tue, 04 Mar 2014 11:59:00 +0200 From: Sagi Grimberg User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Or Gerlitz , Mike Christie , Sagi Grimberg CC: roland@kernel.org, nab@linux-iscsi.org, oren@mellanox.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-rdma@vger.kernel.org Subject: Re: [PATCH v1 10/13] IB/iser: Support T10-PI operations References: <1393499589-15633-1-git-send-email-sagig@mellanox.com> <1393499589-15633-11-git-send-email-sagig@mellanox.com> <531408C8.10107@cs.wisc.edu> <53159F09.6050802@mellanox.com> In-Reply-To: <53159F09.6050802@mellanox.com> Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On 3/4/2014 11:38 AM, Or Gerlitz wrote: > On 03/03/2014 06:44, Mike Christie wrote: >> The xmit_task callout does handle failures like EINVAL. If the above map >> calls fail then you would get infinite retries. You would currently want >> to do the mapping in the init_task callout instead. >> >> If it makes it easier on the driver implementation then it is ok to >> modify the xmit_task callers so that they handle multiple error codes >> for drivers like iser that have the xmit_task callout called from >> iscsi_queuecommand. > > Mike, > > After looking on the code with Sagi, it seems to us that the correct > way to go here, would be to enhance in iscsi_queuecommand the > processing of the result returned by session->tt->xmit_task(task) to > behave in a similar manner to how the return value of > iscsi_prep_scsi_cmd_pdu() is treated. E.g for errors such as ENOMEM > and EGAIN take the "reject" flow which would cause the SCSI midlayer > to retry the command and for other return values go to the "fault" > flow which will cause the ML to abort the command. > > Or. > Yes, we were thinking about the following: list_add_tail(&task->running, &conn->cmdqueue); --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c @@ -1707,10 +1707,17 @@ int iscsi_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *sc) goto prepd_fault; } } - if (session->tt->xmit_task(task)) { - session->cmdsn--; - reason = FAILURE_SESSION_NOT_READY; - goto prepd_reject; + + reason = session->tt->xmit_task(task); + if (reason) { + if (reason == -ENOMEM || reason == -EAGAIN) { + session->cmdsn--; + reason = FAILURE_SESSION_NOT_READY; + goto prepd_reject; + } else { + sc->result = DID_ABORT << 16; + goto prepd_fault; + } } } else {