From f0beaf802145e21e1ce60d4ca2724436b70c316e Mon Sep 17 00:00:00 2001 From: Lance Richardson Date: Mon, 14 Dec 2020 13:53:52 -0500 Subject: [PATCH] net/bnxt: limit Rx representor packets per poll Without some limit on the number of packets transferred from the HW ring to the representor ring per burst receive call, an entire ring's worth of packets can be transferred. This can break assumptions about ring indices (index on return could be identical to the index on entry, which is assumed to mean that no packets were processed), and can result in representor packets being dropped unnecessarily due to representor ring overflow. Fix by limiting the number of representor packets transferred per poll to requested burst size. Fixes: 6dc83230b43b ("net/bnxt: support port representor data path") Cc: stable@dpdk.org Signed-off-by: Lance Richardson Reviewed-by: Ajit Khaparde Reviewed-by: Somnath Kotur --- drivers/net/bnxt/bnxt_rxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c index 445e6150d1..e2d388e69f 100644 --- a/drivers/net/bnxt/bnxt_rxr.c +++ b/drivers/net/bnxt/bnxt_rxr.c @@ -901,7 +901,7 @@ uint16_t bnxt_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, } raw_cons = NEXT_RAW_CMP(raw_cons); - if (nb_rx_pkts == nb_pkts || evt) + if (nb_rx_pkts == nb_pkts || nb_rep_rx_pkts == nb_pkts || evt) break; /* Post some Rx buf early in case of larger burst processing */ if (nb_rx_pkts == BNXT_RX_POST_THRESH) -- 2.20.1