From patchwork Mon Jan 4 19:43:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dheemanth Mallikarjun X-Patchwork-Id: 85988 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A77ACA09FF; Tue, 5 Jan 2021 15:06:13 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70AD116084E; Tue, 5 Jan 2021 15:06:13 +0100 (CET) Received: from EX13-EDG-OU-001.vmware.com (ex13-edg-ou-001.vmware.com [208.91.0.189]) by mails.dpdk.org (Postfix) with ESMTP id 106DA1606D1 for ; Mon, 4 Jan 2021 20:43:16 +0100 (CET) Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-001.vmware.com (10.113.208.155) with Microsoft SMTP Server id 15.0.1156.6; Mon, 4 Jan 2021 11:43:14 -0800 Received: from test.eng.vmware.com (unknown [10.173.12.155]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id F06F42084B; Mon, 4 Jan 2021 11:43:15 -0800 (PST) From: Dheemanth Mallikarjun To: CC: Date: Mon, 4 Jan 2021 11:43:08 -0800 Message-ID: <20210104194308.24228-1-dheemanthm@vmware.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Received-SPF: None (EX13-EDG-OU-001.vmware.com: dheemanthm@vmware.com does not designate permitted sender hosts) X-Mailman-Approved-At: Tue, 05 Jan 2021 15:06:12 +0100 Subject: [dpdk-dev] [PATCH v1 2/2] net/vmxnet3: Provided API to reset vmxnet device 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" 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 Acked-by: Yong Wang --- 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)