From: Sathesh Edara <sedara@marvell.com>
To: <sburla@marvell.com>, <jerinj@marvell.com>, <sedara@marvell.com>,
"Radha Mohan Chintakuntla" <radhac@marvell.com>,
Veerasenareddy Burru <vburru@marvell.com>
Cc: <dev@dpdk.org>
Subject: [PATCH v1 1/2] net/octeon_ep: support device close
Date: Tue, 21 Feb 2023 06:36:25 -0800 [thread overview]
Message-ID: <20230221143627.219917-2-sedara@marvell.com> (raw)
In-Reply-To: <20230221143627.219917-1-sedara@marvell.com>
Added dev close functionality in the ethdev ops
and moves input and output queue deletion
functionality into it from otx_epdev_exit()
routine.
Signed-off-by: Sathesh Edara <sedara@marvell.com>
---
drivers/net/octeon_ep/otx_ep_ethdev.c | 63 ++++++++++++---------------
1 file changed, 29 insertions(+), 34 deletions(-)
diff --git a/drivers/net/octeon_ep/otx_ep_ethdev.c b/drivers/net/octeon_ep/otx_ep_ethdev.c
index c8f4abe4ca..0930efedce 100644
--- a/drivers/net/octeon_ep/otx_ep_ethdev.c
+++ b/drivers/net/octeon_ep/otx_ep_ethdev.c
@@ -395,6 +395,34 @@ otx_ep_dev_stats_get(struct rte_eth_dev *eth_dev,
return 0;
}
+static int
+otx_ep_dev_close(struct rte_eth_dev *eth_dev)
+{
+ struct otx_ep_device *otx_epvf = OTX_EP_DEV(eth_dev);
+ uint32_t num_queues, q_no;
+
+ otx_epvf->fn_list.disable_io_queues(otx_epvf);
+ num_queues = otx_epvf->nb_rx_queues;
+ for (q_no = 0; q_no < num_queues; q_no++) {
+ if (otx_ep_delete_oqs(otx_epvf, q_no)) {
+ otx_ep_err("Failed to delete OQ:%d\n", q_no);
+ return -EINVAL;
+ }
+ }
+ otx_ep_dbg("Num OQs:%d freed\n", otx_epvf->nb_rx_queues);
+
+ num_queues = otx_epvf->nb_tx_queues;
+ for (q_no = 0; q_no < num_queues; q_no++) {
+ if (otx_ep_delete_iqs(otx_epvf, q_no)) {
+ otx_ep_err("Failed to delete IQ:%d\n", q_no);
+ return -EINVAL;
+ }
+ }
+ otx_ep_dbg("Num IQs:%d freed\n", otx_epvf->nb_tx_queues);
+
+ return 0;
+}
+
static int
otx_ep_dev_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete)
{
@@ -424,47 +452,14 @@ static const struct eth_dev_ops otx_ep_eth_dev_ops = {
.stats_get = otx_ep_dev_stats_get,
.stats_reset = otx_ep_dev_stats_reset,
.link_update = otx_ep_dev_link_update,
+ .dev_close = otx_ep_dev_close,
};
-static int
-otx_epdev_exit(struct rte_eth_dev *eth_dev)
-{
- struct otx_ep_device *otx_epvf;
- uint32_t num_queues, q;
-
- otx_ep_info("%s:\n", __func__);
-
- otx_epvf = OTX_EP_DEV(eth_dev);
-
- otx_epvf->fn_list.disable_io_queues(otx_epvf);
-
- num_queues = otx_epvf->nb_rx_queues;
- for (q = 0; q < num_queues; q++) {
- if (otx_ep_delete_oqs(otx_epvf, q)) {
- otx_ep_err("Failed to delete OQ:%d\n", q);
- return -EINVAL;
- }
- }
- otx_ep_info("Num OQs:%d freed\n", otx_epvf->nb_rx_queues);
-
- num_queues = otx_epvf->nb_tx_queues;
- for (q = 0; q < num_queues; q++) {
- if (otx_ep_delete_iqs(otx_epvf, q)) {
- otx_ep_err("Failed to delete IQ:%d\n", q);
- return -EINVAL;
- }
- }
- otx_ep_dbg("Num IQs:%d freed\n", otx_epvf->nb_tx_queues);
-
- return 0;
-}
-
static int
otx_ep_eth_dev_uninit(struct rte_eth_dev *eth_dev)
{
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
return 0;
- otx_epdev_exit(eth_dev);
eth_dev->dev_ops = NULL;
eth_dev->rx_pkt_burst = NULL;
--
2.31.1
next prev parent reply other threads:[~2023-02-21 14:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-21 14:36 [PATCH v1 0/2] net/octeon_ep: support device close and port kind Sathesh Edara
2023-02-21 14:36 ` Sathesh Edara [this message]
2023-02-21 14:36 ` [PATCH v1 2/2] net/octeon_ep: support " Sathesh Edara
2023-03-02 17:05 ` Jerin Jacob
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=20230221143627.219917-2-sedara@marvell.com \
--to=sedara@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=radhac@marvell.com \
--cc=sburla@marvell.com \
--cc=vburru@marvell.com \
/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).