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 81A79A034F; Mon, 11 Oct 2021 09:25:59 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1F90140E0F; Mon, 11 Oct 2021 09:25:59 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id D777D40E01; Mon, 11 Oct 2021 09:25:57 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10133"; a="213762060" X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="213762060" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 00:25:56 -0700 X-IronPort-AV: E=Sophos;i="5.85,364,1624345200"; d="scan'208";a="490360745" Received: from unknown (HELO localhost.localdomain) ([10.240.183.93]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Oct 2021 00:25:54 -0700 From: dapengx.yu@intel.com To: Qiming Yang , Qi Zhang Cc: dev@dpdk.org, Dapeng Yu , stable@dpdk.org Date: Mon, 11 Oct 2021 15:25:46 +0800 Message-Id: <20211011072546.371639-1-dapengx.yu@intel.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] net/ice: fix freeing queues on DCF device reset 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 Sender: "dev" From: Dapeng Yu In function ice_dcf_stop_queues(), RX queues and TX queues are actually not freed, so their pointers shall not be set to NULL when queues are stopped. This patch adds function call to free queues on DCF device close and reset, which also set the RX and TX queues' pointers to NULL on freeing queues, and avoids referring to the released resource when device is started again. Fixes: 1a86f4dbdf42 ("net/ice: support DCF device reset") Cc: stable@dpdk.org Signed-off-by: Dapeng Yu --- drivers/net/ice/ice_dcf_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c index 4e4cdbcd7d..d62ab2694d 100644 --- a/drivers/net/ice/ice_dcf_ethdev.c +++ b/drivers/net/ice/ice_dcf_ethdev.c @@ -603,7 +603,6 @@ ice_dcf_stop_queues(struct rte_eth_dev *dev) txq->tx_rel_mbufs(txq); reset_tx_queue(txq); dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; - dev->data->tx_queues[i] = NULL; } for (i = 0; i < dev->data->nb_rx_queues; i++) { rxq = dev->data->rx_queues[i]; @@ -612,7 +611,6 @@ ice_dcf_stop_queues(struct rte_eth_dev *dev) rxq->rx_rel_mbufs(rxq); reset_rx_queue(rxq); dev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; - dev->data->rx_queues[i] = NULL; } } @@ -905,6 +903,8 @@ ice_dcf_dev_close(struct rte_eth_dev *dev) (void)ice_dcf_dev_stop(dev); + ice_free_queues(dev); + ice_dcf_free_repr_info(adapter); ice_dcf_uninit_parent_adapter(dev); ice_dcf_uninit_hw(dev, &adapter->real_hw); -- 2.27.0