patches for DPDK stable branches
 help / color / Atom feed
* [dpdk-stable] [PATCH] net/cxgbe: fix segfault when accessing empty Tx mbuf list
@ 2020-09-01 17:20 Rahul Lakkireddy
  2020-09-17 15:09 ` Ferruh Yigit
  0 siblings, 1 reply; 2+ messages in thread
From: Rahul Lakkireddy @ 2020-09-01 17:20 UTC (permalink / raw)
  To: dev; +Cc: brian90013, kaara.satwik, stable

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@dpdk.org

Reported-by: Brian Poole <brian90013@gmail.com>
Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@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 60d325723..38b43772c 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,
 	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;
@@ -91,6 +94,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.24.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-stable] [PATCH] net/cxgbe: fix segfault when accessing empty Tx mbuf list
  2020-09-01 17:20 [dpdk-stable] [PATCH] net/cxgbe: fix segfault when accessing empty Tx mbuf list Rahul Lakkireddy
@ 2020-09-17 15:09 ` Ferruh Yigit
  0 siblings, 0 replies; 2+ messages in thread
From: Ferruh Yigit @ 2020-09-17 15:09 UTC (permalink / raw)
  To: Rahul Lakkireddy, dev; +Cc: brian90013, kaara.satwik, stable

On 9/1/2020 6:20 PM, Rahul Lakkireddy wrote:
> 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@dpdk.org
> 
> Reported-by: Brian Poole <brian90013@gmail.com>
> Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-01 17:20 [dpdk-stable] [PATCH] net/cxgbe: fix segfault when accessing empty Tx mbuf list Rahul Lakkireddy
2020-09-17 15:09 ` Ferruh Yigit

patches for DPDK stable branches

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/ public-inbox