From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id EC78343D43; Mon, 25 Mar 2024 08:55:27 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B43FD40271; Mon, 25 Mar 2024 08:55:27 +0100 (CET) Received: from m16.mail.126.com (m16.mail.126.com [220.197.31.7]) by mails.dpdk.org (Postfix) with ESMTP id 7F25A4026E for ; Sat, 23 Mar 2024 15:49:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=xmvVe Yne5brg+eXv6AVpVob81d+mLkG+Fydt0LrbtSo=; b=ZmRXdQg3mQ2IUkk8F2Mol bhLxaH58QSuqan1kN275OBpWG1j1XWS9gkDKAtUWaXfofpfMqOLgnz+faMb/SfvT LN2VI2OThbrp+NxqKrQwXqDAjEbyPOtEeRHTmAosTznf/QUUWAQPK6gELJdl/yCU vv7a4IDkr7+gFsyNl/VgHk= Received: from localhost.localdomain (unknown [112.86.233.237]) by gzga-smtp-mta-g0-4 (Coremail) with SMTP id _____wD3X1rZ6_5l0bowAQ--.29864S2; Sat, 23 Mar 2024 22:48:57 +0800 (CST) From: keivinwang To: dev@dpdk.org Cc: xuanziyang2@huawei.com, cloud.wangxiaoyun@huawei.com, zhouguoyang@huawei.com Subject: [PATCH] net/ixgbe: add param check when tx_queue or rx_queqe is null Date: Sat, 23 Mar 2024 22:48:42 +0800 Message-Id: <20240323144842.12331-1-keivinwang@126.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: _____wD3X1rZ6_5l0bowAQ--.29864S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7uryUZrW5WFWrXFy5KFWrAFb_yoW8JFyfpF 4kG3WSya1rXr47Zw18uw4fua4a9an2gF1xWFySk3s8Zr15AFyvgF1DKFyUZFyDtryUZF4x ZF18GF4av3W3A37anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07UD5rxUUUUU= X-Originating-IP: [112.86.233.237] X-CM-SenderInfo: xnhl4xxqzd0wa6rslhhfrp/1tbiFh6ql2VLZonxggAAsH X-Mailman-Approved-At: Mon, 25 Mar 2024 08:55:27 +0100 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org add param check when tx_queue or rx_queqe is null. Signed-off-by: keivinwang --- 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