From patchwork Tue Dec 9 17:32:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Karen Xie X-Patchwork-Id: 419193 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AFDA21400D5 for ; Wed, 10 Dec 2014 04:34:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751312AbaLIRd7 (ORCPT ); Tue, 9 Dec 2014 12:33:59 -0500 Received: from stargate.chelsio.com ([67.207.112.58]:26556 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751239AbaLIRd5 (ORCPT ); Tue, 9 Dec 2014 12:33:57 -0500 Received: from localhost6.localdomain6 (qatest6.asicdesigners.com [10.192.162.143]) by stargate.chelsio.com (8.13.8/8.13.8) with ESMTP id sB9HWOxq028118; Tue, 9 Dec 2014 09:32:24 -0800 Received: from localhost6.localdomain6 (localhost.localdomain [127.0.0.1]) by localhost6.localdomain6 (8.14.4/8.14.4) with ESMTP id sB9HWNxg009010; Tue, 9 Dec 2014 09:32:23 -0800 Received: (from kxie@localhost) by localhost6.localdomain6 (8.14.4/8.14.4/Submit) id sB9HWNQp009008; Tue, 9 Dec 2014 09:32:23 -0800 From: Karen Xie Message-Id: <201412091732.sB9HWNQp009008@localhost6.localdomain6> Date: Tue, 09 Dec 2014 09:32:23 -0800 To: linux-scsi@vger.kernel.org, netdev@vger.kernel.org Cc: kxie@chelsio.com, hariprasad@chelsio.com, anish@chelsio.com, hch@infradead.org, James.Bottomley@HansenPartnership.com, michaelc@cs.wisc.edu, davem@davemloft.net Subject: [PATCH net v3 3/6] cxgb4i: additional types of negative advice User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org [PATCH net v3 3/6] cxgb4i: additional types of negative advice From: Karen Xie Treat both CPL_ERR_KEEPALV_NEG_ADVICE and CPL_ERR_PERSIST_NEG_ADVICE as negative advice. Signed-off-by: Karen Xie --- drivers/scsi/cxgbi/cxgb4i/cxgb4i.c | 12 +++++++++--- 1 files changed, 9 insertions(+), 3 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c index b834bde..e7a26c0 100644 --- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c +++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c @@ -845,6 +845,13 @@ static void csk_act_open_retry_timer(unsigned long data) } +static inline bool is_neg_adv(unsigned int status) +{ + return status == CPL_ERR_RTX_NEG_ADVICE || + status == CPL_ERR_KEEPALV_NEG_ADVICE || + status == CPL_ERR_PERSIST_NEG_ADVICE; +} + static void do_act_open_rpl(struct cxgbi_device *cdev, struct sk_buff *skb) { struct cxgbi_sock *csk; @@ -866,7 +873,7 @@ static void do_act_open_rpl(struct cxgbi_device *cdev, struct sk_buff *skb) "csk 0x%p,%u,0x%lx. ", (&csk->saddr), (&csk->daddr), atid, tid, status, csk, csk->state, csk->flags); - if (status == CPL_ERR_RTX_NEG_ADVICE) + if (is_neg_adv(status)) goto rel_skb; module_put(THIS_MODULE); @@ -972,8 +979,7 @@ static void do_abort_req_rss(struct cxgbi_device *cdev, struct sk_buff *skb) (&csk->saddr), (&csk->daddr), csk, csk->state, csk->flags, csk->tid, req->status); - if (req->status == CPL_ERR_RTX_NEG_ADVICE || - req->status == CPL_ERR_PERSIST_NEG_ADVICE) + if (is_neg_adv(req->status)) goto rel_skb; cxgbi_sock_get(csk);