[dpdk-stable] patch 'net/cxgbe: fix crash when accessing empty Tx mbuf list' has been queued to stable release 19.11.6

luca.boccassi at gmail.com luca.boccassi at gmail.com
Wed Oct 28 11:43:26 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.6

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 10/30/20. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Thanks.

Luca Boccassi

---
>From 4c661677f11c87e3ffe0d6d6846a90477ce7b281 Mon Sep 17 00:00:00 2001
From: Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>
Date: Tue, 1 Sep 2020 22:50:09 +0530
Subject: [PATCH] net/cxgbe: fix crash when accessing empty Tx mbuf list

[ upstream commit dca62adebf68ec94d84444fd2a61f03f73f51ffb ]

Ensure packets are available before accessing the mbuf list in Tx
burst function. Otherwise, just reclaim completed Tx descriptors and
exit.

Fixes: b1df19e43e1d ("net/cxgbe: fix prefetch for non-coalesced Tx packets")

Reported-by: Brian Poole <brian90013 at gmail.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>
---
 drivers/net/cxgbe/cxgbe_ethdev.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 51b63ef574..abd455c6ea 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -74,6 +74,9 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 	t4_os_lock(&txq->txq_lock);
 	/* free up desc from already completed tx */
 	reclaim_completed_tx(&txq->q);
+	if (unlikely(!nb_pkts))
+		goto out_unlock;
+
 	rte_prefetch0(rte_pktmbuf_mtod(tx_pkts[0], volatile void *));
 	while (total_sent < nb_pkts) {
 		pkts_remain = nb_pkts - total_sent;
@@ -94,6 +97,7 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
 		reclaim_completed_tx(&txq->q);
 	}
 
+out_unlock:
 	t4_os_unlock(&txq->txq_lock);
 	return total_sent;
 }
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-10-28 10:35:13.256518858 +0000
+++ 0047-net-cxgbe-fix-crash-when-accessing-empty-Tx-mbuf-lis.patch	2020-10-28 10:35:11.512830142 +0000
@@ -1,14 +1,15 @@
-From dca62adebf68ec94d84444fd2a61f03f73f51ffb Mon Sep 17 00:00:00 2001
+From 4c661677f11c87e3ffe0d6d6846a90477ce7b281 Mon Sep 17 00:00:00 2001
 From: Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>
 Date: Tue, 1 Sep 2020 22:50:09 +0530
 Subject: [PATCH] net/cxgbe: fix crash when accessing empty Tx mbuf list
 
+[ upstream commit dca62adebf68ec94d84444fd2a61f03f73f51ffb ]
+
 Ensure packets are available before accessing the mbuf list in Tx
 burst function. Otherwise, just reclaim completed Tx descriptors and
 exit.
 
 Fixes: b1df19e43e1d ("net/cxgbe: fix prefetch for non-coalesced Tx packets")
-Cc: stable at dpdk.org
 
 Reported-by: Brian Poole <brian90013 at gmail.com>
 Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy at chelsio.com>
@@ -17,10 +18,10 @@
  1 file changed, 4 insertions(+)
 
 diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
-index 7c6016d5cf..1205e17a6c 100644
+index 51b63ef574..abd455c6ea 100644
 --- a/drivers/net/cxgbe/cxgbe_ethdev.c
 +++ b/drivers/net/cxgbe/cxgbe_ethdev.c
-@@ -71,6 +71,9 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+@@ -74,6 +74,9 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
  	t4_os_lock(&txq->txq_lock);
  	/* free up desc from already completed tx */
  	reclaim_completed_tx(&txq->q);
@@ -30,7 +31,7 @@
  	rte_prefetch0(rte_pktmbuf_mtod(tx_pkts[0], volatile void *));
  	while (total_sent < nb_pkts) {
  		pkts_remain = nb_pkts - total_sent;
-@@ -91,6 +94,7 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
+@@ -94,6 +97,7 @@ uint16_t cxgbe_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,
  		reclaim_completed_tx(&txq->q);
  	}
  


More information about the stable mailing list