DPDK patches and discussions
 help / color / mirror / Atom feed
From: dapengx.yu@intel.com
To: Qiming Yang <qiming.yang@intel.com>, Qi Zhang <qi.z.zhang@intel.com>
Cc: dev@dpdk.org, Dapeng Yu <dapengx.yu@intel.com>, stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/ice: fix freeing queues on DCF device reset
Date: Mon, 11 Oct 2021 15:25:46 +0800	[thread overview]
Message-ID: <20211011072546.371639-1-dapengx.yu@intel.com> (raw)

From: Dapeng Yu <dapengx.yu@intel.com>

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 <dapengx.yu@intel.com>
---
 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


             reply	other threads:[~2021-10-11  7:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-11  7:25 dapengx.yu [this message]
2021-10-13 11:00 ` Zhang, Qi Z

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211011072546.371639-1-dapengx.yu@intel.com \
    --to=dapengx.yu@intel.com \
    --cc=dev@dpdk.org \
    --cc=qi.z.zhang@intel.com \
    --cc=qiming.yang@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).