Thread (2 messages) 2 messages, 2 authors, 2024-04-04
STALE786d

[PATCH] net/ixgbe: add param check when tx_queue or rx_queqe is null

From: keivinwang <hidden>
Date: 2024-03-25 07:55:28
Subsystem: networking drivers, the rest · Maintainers: Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

add param check when tx_queue or rx_queqe is null.

Signed-off-by: keivinwang <redacted>
---
 drivers/net/ixgbe/ixgbe_rxtx.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ixgbe/ixgbe_rxtx.c b/drivers/net/ixgbe/ixgbe_rxtx.c
index f6c17d4efb..245b3527db 100644
--- a/drivers/net/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/ixgbe/ixgbe_rxtx.c
@@ -2539,6 +2539,8 @@ static const struct ixgbe_txq_ops def_txq_ops = {
 void __rte_cold
 ixgbe_set_tx_function(struct rte_eth_dev *dev, struct ixgbe_tx_queue *txq)
 {
+	if (txq == NULL)
+		return;
 	/* Use a simple Tx queue (no offloads, no multi segs) if possible */
 	if ((txq->offloads == 0) &&
 #ifdef RTE_LIB_SECURITY
@@ -4953,12 +4955,13 @@ ixgbe_set_rx_function(struct rte_eth_dev *dev)
 
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		struct ixgbe_rx_queue *rxq = dev->data->rx_queues[i];
-
-		rxq->rx_using_sse = rx_using_sse;
+		if (rxq) {
+			rxq->rx_using_sse = rx_using_sse;
 #ifdef RTE_LIB_SECURITY
-		rxq->using_ipsec = !!(dev->data->dev_conf.rxmode.offloads &
-				RTE_ETH_RX_OFFLOAD_SECURITY);
+			rxq->using_ipsec = !!(dev->data->dev_conf.rxmode.offloads &
+					RTE_ETH_RX_OFFLOAD_SECURITY);
 #endif
+		}
 	}
 }
 
-- 
2.44.0.windows.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help