patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Lance Richardson <lance.richardson@broadcom.com>
To: stable@dpdk.org
Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Subject: [dpdk-stable] [PATCH 19.11 1/3] net/bnxt: fix Rx burst size constraint
Date: Mon, 16 Aug 2021 16:37:00 -0400	[thread overview]
Message-ID: <20210816203702.7235-2-lance.richardson@broadcom.com> (raw)
In-Reply-To: <20210816203702.7235-1-lance.richardson@broadcom.com>

[-- Attachment #1: Type: text/plain, Size: 2246 bytes --]

[ upstream commit 008feb839f4e2829db8510719f5a393da803fc1b ]

The burst receive function should return all packets currently
present in the receive ring up to the requested burst size,
update vector mode receive functions accordingly.

Fixes: 398358341419 ("net/bnxt: support NEON")
Fixes: bc4a000f2f53 ("net/bnxt: implement SSE vector mode")
Cc: stable@dpdk.org

Signed-off-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
---
 drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 29 ++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
index 7529d0316..369301eb3 100644
--- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
+++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c
@@ -203,9 +203,8 @@ bnxt_parse_csum(struct rte_mbuf *mbuf, struct rx_pkt_cmpl_hi *rxcmp1)
 	}
 }
 
-uint16_t
-bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
-		   uint16_t nb_pkts)
+static uint16_t
+recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
 {
 	struct bnxt_rx_queue *rxq = rx_queue;
 	struct bnxt_cp_ring_info *cpr = rxq->cp_ring;
@@ -230,9 +229,6 @@ bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 	if (rxq->rxrearm_nb >= RTE_BNXT_RXQ_REARM_THRESH)
 		bnxt_rxq_rearm(rxq, rxr);
 
-	/* Return no more than RTE_BNXT_MAX_RX_BURST per call. */
-	nb_pkts = RTE_MIN(nb_pkts, RTE_BNXT_MAX_RX_BURST);
-
 	/*
 	 * Make nb_pkts an integer multiple of RTE_BNXT_DESCS_PER_LOOP.
 	 * nb_pkts < RTE_BNXT_DESCS_PER_LOOP, just return no packet
@@ -354,6 +350,27 @@ bnxt_tx_cmp_vec(struct bnxt_tx_queue *txq, int nr_pkts)
 	txr->tx_cons = cons;
 }
 
+uint16_t
+bnxt_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)
+{
+	uint16_t cnt = 0;
+
+	while (nb_pkts > RTE_BNXT_MAX_RX_BURST) {
+		uint16_t burst;
+
+		burst = recv_burst_vec_sse(rx_queue, rx_pkts + cnt,
+					   RTE_BNXT_MAX_RX_BURST);
+
+		cnt += burst;
+		nb_pkts -= burst;
+
+		if (burst < RTE_BNXT_MAX_RX_BURST)
+			return cnt;
+	}
+
+	return cnt + recv_burst_vec_sse(rx_queue, rx_pkts + cnt, nb_pkts);
+}
+
 static void
 bnxt_handle_tx_cp_vec(struct bnxt_tx_queue *txq)
 {
-- 
2.25.1


  reply	other threads:[~2021-08-16 20:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-16 20:36 [dpdk-stable] [PATCH 19.11 0/3] net/bnxt: backports for 19.11 Lance Richardson
2021-08-16 20:37 ` Lance Richardson [this message]
2021-08-16 20:37 ` [dpdk-stable] [PATCH 19.11 2/3] net/bnxt: fix ring and context memory allocation Lance Richardson
2021-08-16 20:37 ` [dpdk-stable] [PATCH 19.11 3/3] net/bnxt: fix missing barriers in completion handling Lance Richardson
2021-08-17  9:43 ` [dpdk-stable] [PATCH 19.11 0/3] net/bnxt: backports for 19.11 Christian Ehrhardt

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=20210816203702.7235-2-lance.richardson@broadcom.com \
    --to=lance.richardson@broadcom.com \
    --cc=ajit.khaparde@broadcom.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).