From patchwork Fri Dec 11 08:25:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rahul Lakkireddy X-Patchwork-Id: 9486 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id A3DE88E7B; Fri, 11 Dec 2015 09:26:25 +0100 (CET) Received: from stargate3.asicdesigners.com (stargate.chelsio.com [12.32.117.8]) by dpdk.org (Postfix) with ESMTP id 63FAF8E7A for ; Fri, 11 Dec 2015 09:26:23 +0100 (CET) Received: from localhost (scalar.blr.asicdesigners.com [10.193.185.94]) by stargate3.asicdesigners.com (8.13.8/8.13.8) with ESMTP id tBB8QJ4S028254; Fri, 11 Dec 2015 00:26:20 -0800 From: Rahul Lakkireddy To: dev@dpdk.org Date: Fri, 11 Dec 2015 13:55:30 +0530 Message-Id: <66655e2d7666da09b80174d265eef304b8d93470.1449821728.git.rahul.lakkireddy@chelsio.com> X-Mailer: git-send-email 2.5.3 Cc: Felix Marti , Kumar Sanghvi , Nirranjan Kirubaharan Subject: [dpdk-dev] [PATCH] cxgbe: fix unnecessary check for freelist existence while freeing rxq X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" When refilling freelists for the first time and if it fails, the rxq is freed and returns ENOMEM. There is a check while freeing hardware rxq to pass freelist context id if the freelist exists or 0xffff otherwise. The error path is only reached if freelist exists. So, fix is to remove the useless check for freelist existence. Thanks to John McNamara for reporting it. Coverity issue: 107108 Fixes: 92c8a63223e5 ("cxgbe: add device configuration and Rx support") Signed-off-by: Rahul Lakkireddy Signed-off-by: Kumar Sanghvi Acked-by: John McNamara --- drivers/net/cxgbe/sge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c index 51449e0..3c62d03 100644 --- a/drivers/net/cxgbe/sge.c +++ b/drivers/net/cxgbe/sge.c @@ -1823,7 +1823,7 @@ int t4_sge_alloc_rxq(struct adapter *adap, struct sge_rspq *iq, bool fwevtq, refill_fl_err: t4_iq_free(adap, adap->mbox, adap->pf, 0, FW_IQ_TYPE_FL_INT_CAP, - iq->cntxt_id, fl ? fl->cntxt_id : 0xffff, 0xffff); + iq->cntxt_id, fl->cntxt_id, 0xffff); fl_nomem: ret = -ENOMEM; err: