patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Shahed Shaikh <shshaikh@marvell.com>
To: <dev@dpdk.org>
Cc: <rmody@marvell.com>, <ferruh.yigit@intel.com>, <stable@dpdk.org>
Subject: [dpdk-stable] [PATCH 1/1] net/qede: fix receive packet drop
Date: Tue, 12 Mar 2019 09:51:14 -0700	[thread overview]
Message-ID: <20190312165114.23740-1-shshaikh@marvell.com> (raw)

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 <shshaikh@marvell.com>
---
 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

             reply	other threads:[~2019-03-12 16:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-12 16:51 Shahed Shaikh [this message]
2019-03-13 17:55 ` [dpdk-stable] [dpdk-dev] " Rasesh Mody
2019-03-19 19:01   ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190312165114.23740-1-shshaikh@marvell.com \
    --to=shshaikh@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=rmody@marvell.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).