DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dheemanth Mallikarjun <dheemanthm@vmware.com>
To: <dev@dpdk.org>
Cc: <yongwang@vmware.com>
Subject: [dpdk-dev] [PATCH v1 2/2] net/vmxnet3: Provided API to reset vmxnet device
Date: Mon, 4 Jan 2021 11:43:08 -0800	[thread overview]
Message-ID: <20210104194308.24228-1-dheemanthm@vmware.com> (raw)

The vmxnet3 driver didn't have the dev_reset function
pointer set. Hence, provided the necessary function
pointer so that DPDK developers can use the rte_eth_dev_reset
API to reset the vmxnet3 device data.

Signed-off-by: Dheemanth Mallikarjun <dheemanthm@vmware.com>
---
 drivers/net/vmxnet3/vmxnet3_ethdev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 23a2ebbef..814ccfa79 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -67,6 +67,7 @@ static int vmxnet3_dev_configure(struct rte_eth_dev *dev);
 static int vmxnet3_dev_start(struct rte_eth_dev *dev);
 static int vmxnet3_dev_stop(struct rte_eth_dev *dev);
 static int vmxnet3_dev_close(struct rte_eth_dev *dev);
+static int vmxnet3_dev_reset(struct rte_eth_dev *dev);
 static void vmxnet3_dev_set_rxmode(struct vmxnet3_hw *hw, uint32_t feature, int set);
 static int vmxnet3_dev_promiscuous_enable(struct rte_eth_dev *dev);
 static int vmxnet3_dev_promiscuous_disable(struct rte_eth_dev *dev);
@@ -112,6 +113,7 @@ static const struct eth_dev_ops vmxnet3_eth_dev_ops = {
 	.dev_start            = vmxnet3_dev_start,
 	.dev_stop             = vmxnet3_dev_stop,
 	.dev_close            = vmxnet3_dev_close,
+	.dev_reset            = vmxnet3_dev_reset,
 	.promiscuous_enable   = vmxnet3_dev_promiscuous_enable,
 	.promiscuous_disable  = vmxnet3_dev_promiscuous_disable,
 	.allmulticast_enable  = vmxnet3_dev_allmulticast_enable,
@@ -913,6 +915,18 @@ vmxnet3_dev_close(struct rte_eth_dev *dev)
 	return ret;
 }
 
+static int
+vmxnet3_dev_reset(struct rte_eth_dev *dev)
+{
+	int ret;
+
+	ret = eth_vmxnet3_dev_uninit(dev);
+	if (ret)
+		return ret;
+	ret = eth_vmxnet3_dev_init(dev);
+	return ret;
+}
+
 static void
 vmxnet3_hw_tx_stats_get(struct vmxnet3_hw *hw, unsigned int q,
 			struct UPT1_TxStats *res)
-- 
2.17.1


             reply	other threads:[~2021-01-05 14:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 19:43 Dheemanth Mallikarjun [this message]
2021-01-15 18:43 ` Ferruh Yigit
2021-02-06 18:05 ` Yong Wang
2021-02-22 16:53   ` Ferruh Yigit

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=20210104194308.24228-1-dheemanthm@vmware.com \
    --to=dheemanthm@vmware.com \
    --cc=dev@dpdk.org \
    --cc=yongwang@vmware.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).