DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chaoyong He <chaoyong.he@corigine.com>
To: dev@dpdk.org
Cc: oss-drivers@corigine.com, Long Wu <long.wu@corigine.com>,
	chaoyong.he@corigine.com, stable@dpdk.org,
	Peng Zhang <peng.zhang@corigine.com>
Subject: [PATCH 2/2] net/nfp: fix invalid Rx descriptor data
Date: Mon, 11 Dec 2023 13:45:26 +0800	[thread overview]
Message-ID: <20231211054526.1701663-3-chaoyong.he@corigine.com> (raw)
In-Reply-To: <20231211054526.1701663-1-chaoyong.he@corigine.com>

From: Long Wu <long.wu@corigine.com>

If the Rx loop is broken and PMD does not update the descriptor, packets
will can not be received successfully.

Fixes: 766d51c9ce29 ("net/nfp: merge receive function")
Cc: chaoyong.he@corigine.com
Cc: stable@dpdk.org

Signed-off-by: Long Wu <long.wu@corigine.com>
Reviewed-by: Chaoyong He <chaoyong.he@corigine.com>
Reviewed-by: Peng Zhang <peng.zhang@corigine.com>
---
 drivers/net/nfp/nfp_rxtx.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c
index 5094bbf145..3840e2372c 100644
--- a/drivers/net/nfp/nfp_rxtx.c
+++ b/drivers/net/nfp/nfp_rxtx.c
@@ -765,15 +765,6 @@ nfp_net_recv_pkts(void *rx_queue,
 		/* Checking the checksum flag */
 		nfp_net_rx_cksum(rxq, rxds, mb);
 
-		if (meta.port_id == 0) {
-			rx_pkts[avail++] = mb;
-		} else if (nfp_flower_pf_dispatch_pkts(hw, mb, meta.port_id)) {
-			avail_multiplexed++;
-		} else {
-			rte_pktmbuf_free(mb);
-			break;
-		}
-
 		/* Now resetting and updating the descriptor */
 		rxds->vals[0] = 0;
 		rxds->vals[1] = 0;
@@ -786,6 +777,15 @@ nfp_net_recv_pkts(void *rx_queue,
 		rxq->rd_p++;
 		if (unlikely(rxq->rd_p == rxq->rx_count)) /* Wrapping */
 			rxq->rd_p = 0;
+
+		if (meta.port_id == 0) {
+			rx_pkts[avail++] = mb;
+		} else if (nfp_flower_pf_dispatch_pkts(hw, mb, meta.port_id)) {
+			avail_multiplexed++;
+		} else {
+			rte_pktmbuf_free(mb);
+			break;
+		}
 	}
 
 	if (nb_hold == 0)
-- 
2.39.1


  parent reply	other threads:[~2023-12-11  5:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11  5:45 [PATCH 0/2] fix problem in Rx Chaoyong He
2023-12-11  5:45 ` [PATCH 1/2] net/nfp: fix receive function memory leak Chaoyong He
2023-12-11  5:45 ` Chaoyong He [this message]
2023-12-13 10:40 ` [PATCH 0/2] fix problem in Rx 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=20231211054526.1701663-3-chaoyong.he@corigine.com \
    --to=chaoyong.he@corigine.com \
    --cc=dev@dpdk.org \
    --cc=long.wu@corigine.com \
    --cc=oss-drivers@corigine.com \
    --cc=peng.zhang@corigine.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).