From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM05-BY2-obe.outbound.protection.outlook.com (mail-eopbgr710068.outbound.protection.outlook.com [40.107.71.68]) by dpdk.org (Postfix) with ESMTP id AEE6211A4; Tue, 12 Mar 2019 17:52:43 +0100 (CET) Received: from CY1PR07CA0018.namprd07.prod.outlook.com (2a01:111:e400:c60a::28) by BL0PR07MB4019.namprd07.prod.outlook.com (2603:10b6:207:4b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1686.20; Tue, 12 Mar 2019 16:52:41 +0000 Received: from BY2NAM05FT051.eop-nam05.prod.protection.outlook.com (2a01:111:f400:7e52::202) by CY1PR07CA0018.outlook.office365.com (2a01:111:e400:c60a::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1686.18 via Frontend Transport; Tue, 12 Mar 2019 16:52:41 +0000 Authentication-Results: spf=fail (sender IP is 199.233.58.38) smtp.mailfrom=marvell.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=fail action=none header.from=marvell.com; Received-SPF: Fail (protection.outlook.com: domain of marvell.com does not designate 199.233.58.38 as permitted sender) receiver=protection.outlook.com; client-ip=199.233.58.38; helo=CAEXCH02.caveonetworks.com; Received: from CAEXCH02.caveonetworks.com (199.233.58.38) by BY2NAM05FT051.mail.protection.outlook.com (10.152.100.188) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.20.1709.11 via Frontend Transport; Tue, 12 Mar 2019 16:52:40 +0000 Received: from dut1171.mv.qlogic.com (10.112.88.18) by CAEXCH02.caveonetworks.com (10.67.98.110) with Microsoft SMTP Server (TLS) id 14.2.347.0; Tue, 12 Mar 2019 09:51:33 -0700 Received: from dut1171.mv.qlogic.com (localhost [127.0.0.1]) by dut1171.mv.qlogic.com (8.14.7/8.14.7) with ESMTP id x2CGpXMj023785; Tue, 12 Mar 2019 09:51:33 -0700 Received: (from root@localhost) by dut1171.mv.qlogic.com (8.14.7/8.14.7/Submit) id x2CGpXda023784; Tue, 12 Mar 2019 09:51:33 -0700 From: Shahed Shaikh To: CC: , , Date: Tue, 12 Mar 2019 09:51:14 -0700 Message-ID: <20190312165114.23740-1-shshaikh@marvell.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Matching-Connectors: 131968831609500683; (abac79dc-c90b-41ba-8033-08d666125e47); (abac79dc-c90b-41ba-8033-08d666125e47) X-Forefront-Antispam-Report: CIP:199.233.58.38; IPV:CAL; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(39860400002)(376002)(136003)(396003)(2980300002)(1109001)(1110001)(339900001)(199004)(189003)(86362001)(51416003)(36906005)(336012)(50466002)(16586007)(47776003)(97736004)(48376002)(54906003)(316002)(50226002)(6916009)(2906002)(85426001)(69596002)(4326008)(26005)(36756003)(5660300002)(450100002)(42186006)(81166006)(81156014)(476003)(6666004)(1076003)(87636003)(8676002)(305945005)(126002)(356004)(105606002)(2616005)(68736007)(498600001)(53936002)(8936002)(80596001)(486006)(2351001)(26826003)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:BL0PR07MB4019; H:CAEXCH02.caveonetworks.com; FPR:; SPF:Fail; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3a0c14c9-7f82-4a27-6d1f-08d6a70b23f7 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(5600127)(711020)(4605104)(2017052603328); SRVR:BL0PR07MB4019; X-MS-TrafficTypeDiagnostic: BL0PR07MB4019: X-Microsoft-Antispam-PRVS: X-Forefront-PRVS: 09749A275C X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BL0PR07MB4019; 23:n28dKaLLlcM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MqNromyUq1S7dV+ajVzaScLfELWrSFQ7ZAPpiATM3eCArCl+A8N?= =?us-ascii?Q?nsZhwcZtVphJMg818x6fpTE/0jNcZxeDAQlJqtTrAXwb5cbZ+6w3HgwBugjb?= =?us-ascii?Q?P4V2pmCa/EcUIGFKSdrY4RjjXh/5XDjzUL75Oj2bDBTKbnNEU+G1eA8shpoL?= =?us-ascii?Q?fWYz2K3dduOPMuFLI0JoPn4vGuGIq4JFSVqwg52EJDCam9LxsmdNsO2np4ck?= =?us-ascii?Q?a4MvYYCQnXXFxaWQoBNpQ6HSY2vKrFrVTriPbWP6JgtQ2J58JeMnCTELE0RV?= =?us-ascii?Q?UmNTxBqxbmKlxTY1KP3HhJ4uDoxK5JgHxPODf/KwrjSr2kLnO5R7c2epg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Antispam-Message-Info: ug/Wb715QC38YiaGkAIlo0i9Fpmp+807tdWL/TeMDN0iykjayFxgc1TyBmt6deTQiF2eNI8H+vP/pmuk/Vh1ymUUBQvnGYBNHHZsaNktwDLe5sLJZJow5uSjEL44yI0UNCfUqpPy46NW8Cv+tFqY9p27plEc/bsK3BvANJggU+Qe6ukq9/Q/+8idkrhpW3Tt+bhoTJ4ewoNu1OVjhd5OxGtL3sQbs5Vi9xa6HLLQTqG8UF6SjGFXwQj4bWXh0SnBx+7h1yZPQSImCIaj7TSsR63HPsz35nm5TO7sPmfmTHhg7sqyAcerLZ+Fb0V8Llwn7ttacejKXuP4UNBapU0pOWBSfQSVlhoQyTL4cF3NKtPlIydhwF6eTqzANZwqvCYX01x5PGGvvrcimcr8ULC3hCYhVvVNVJzvyp7c585DS24= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2019 16:52:40.6838 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3a0c14c9-7f82-4a27-6d1f-08d6a70b23f7 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[199.233.58.38]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR07MB4019 Subject: [dpdk-dev] [PATCH 1/1] net/qede: fix receive packet drop X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Mar 2019 16:52:44 -0000 There is a corner case in which driver won't post receive buffers when driver has processed all received packets in single loop (i.e. hw_consumer == sw_consumer) and then HW will start dropping packets since it did not see new receive buffers posted. This corner case is seen when size of Rx ring is less than or equals Rx packet burst count for dev->rx_pkt_burst(). Fixes: 8f2312474529 ("net/qede: fix performance bottleneck in Rx path") Cc: stable@dpdk.org Signed-off-by: Shahed Shaikh --- drivers/net/qede/qede_rxtx.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c index 70c32e3..27bac09 100644 --- a/drivers/net/qede/qede_rxtx.c +++ b/drivers/net/qede/qede_rxtx.c @@ -1420,13 +1420,6 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) uint32_t rss_hash; int rx_alloc_count = 0; - hw_comp_cons = rte_le_to_cpu_16(*rxq->hw_cons_ptr); - sw_comp_cons = ecore_chain_get_cons_idx(&rxq->rx_comp_ring); - - rte_rmb(); - - if (hw_comp_cons == sw_comp_cons) - return 0; /* Allocate buffers that we used in previous loop */ if (rxq->rx_alloc_count) { @@ -1447,6 +1440,14 @@ qede_recv_pkts(void *p_rxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) rxq->rx_alloc_count = 0; } + hw_comp_cons = rte_le_to_cpu_16(*rxq->hw_cons_ptr); + sw_comp_cons = ecore_chain_get_cons_idx(&rxq->rx_comp_ring); + + rte_rmb(); + + if (hw_comp_cons == sw_comp_cons) + return 0; + while (sw_comp_cons != hw_comp_cons) { ol_flags = 0; packet_type = RTE_PTYPE_UNKNOWN; -- 2.7.4