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 155E4A0509; Tue, 29 Mar 2022 12:29:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AD8142898; Tue, 29 Mar 2022 12:29:07 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 3FBFA42880 for ; Tue, 29 Mar 2022 12:29:05 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 22T9Olm5007710 for ; Tue, 29 Mar 2022 03:29:04 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=/mFS0w+CRC7jYOvCkJKC47gnmq3Q2/n731UaTGQTS0k=; b=OW+AJGlgni7dYEdjWTfgBfoURaIbgLm4GKt6JiH5lgg6DbDsV55Zco/3w43SJlOmaK4N C44tbfRWA2rGOa3unq9gfANce21Vs+v2w0GFXsGbpxznPOIICzS9J3bwotEGL0JRcRx9 PgoupSsCVABb/l1Vlf4Pujvu0OnWxrbb2E/nLcAUOmpvQf6aFmNqNzT3kiwOYSn2+zn7 W/ofKyYa/qWlg+4xj1+n8bRv2MS5OJIuaeMpDaaIGPsVxydwvLlDZn51jCkxILMRsR7l Yy3ZMM0NPIsmn52umIGasF7oP8Ia79b0AaXSzkDf+k5IKV/HbAi7jKuaAM692BS1B70G 2A== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3f3yf3r80k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 29 Mar 2022 03:29:04 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 29 Mar 2022 03:29:02 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 29 Mar 2022 03:29:02 -0700 Received: from localhost.localdomain (unknown [10.28.34.25]) by maili.marvell.com (Postfix) with ESMTP id E95833F703F; Tue, 29 Mar 2022 03:29:00 -0700 (PDT) From: To: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao CC: Subject: [PATCH] net/cnxk: fix crash during hotplug detach operation Date: Tue, 29 Mar 2022 15:58:57 +0530 Message-ID: <20220329102857.2872895-1-skori@marvell.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: Hsj9oAQpYtX00VIh2Xd370_IeNTRrdhv X-Proofpoint-GUID: Hsj9oAQpYtX00VIh2Xd370_IeNTRrdhv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-29_02,2022-03-29_01,2022-02-23_01 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 From: Sunil Kumar Kori hot_plug application does not perform any port setup configuration via rte_eth_dev_configure() API. All the probed Ethernet ports do not contain any Rx and Tx queues. While detaching a device via rte_eal_hotplug_remove(), CNXK driver expects Rx and Tx queues structures populated during reset of PFC. So application gets crashed as data->rx_queues and data->tx_queues are NULL. Fixes: 9544713564f5 ("net/cnxk: support priority flow control") Signed-off-by: Sunil Kumar Kori --- drivers/net/cnxk/cnxk_ethdev_ops.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c index f4a0562475..15d8e8efa6 100644 --- a/drivers/net/cnxk/cnxk_ethdev_ops.c +++ b/drivers/net/cnxk/cnxk_ethdev_ops.c @@ -1069,6 +1069,11 @@ nix_priority_flow_ctrl_configure(struct rte_eth_dev *eth_dev, rx_pause = (mode == RTE_ETH_FC_FULL) || (mode == RTE_ETH_FC_RX_PAUSE); tx_pause = (mode == RTE_ETH_FC_FULL) || (mode == RTE_ETH_FC_TX_PAUSE); + if (data->rx_queues == NULL || data->tx_queues == NULL) { + rc = 0; + goto exit; + } + /* Configure CQs */ memset(&fc_cfg, 0, sizeof(struct roc_nix_fc_cfg)); rxq = ((struct cnxk_eth_rxq_sp *)data->rx_queues[conf->rx_qid]) - 1; -- 2.25.1