From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (xvm-189-124.dc0.ghst.net [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 92FCEA0A01; Mon, 4 Jan 2021 11:31:58 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 204191606E0; Mon, 4 Jan 2021 11:31:58 +0100 (CET) Received: from EX13-EDG-OU-002.vmware.com (ex13-edg-ou-002.vmware.com [208.91.0.190]) by mails.dpdk.org (Postfix) with ESMTP id BCE9B160671 for ; Sat, 2 Jan 2021 08:12:21 +0100 (CET) Received: from sc9-mailhost2.vmware.com (10.113.161.72) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Fri, 1 Jan 2021 23:12:12 -0800 Received: from test.eng.vmware.com (unknown [10.173.12.155]) by sc9-mailhost2.vmware.com (Postfix) with ESMTP id 57558202FA for ; Fri, 1 Jan 2021 23:12:17 -0800 (PST) From: Dheemanth Mallikarjun To: Date: Fri, 1 Jan 2021 23:12:09 -0800 Message-ID: <20210102071209.18885-1-dheemanthm@vmware.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: None (EX13-EDG-OU-002.vmware.com: dheemanthm@vmware.com does not designate permitted sender hosts) X-Mailman-Approved-At: Mon, 04 Jan 2021 11:31:57 +0100 Subject: [dpdk-dev] [PATCH v1 2/2] vmxnet3_dev_reset: 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" Signed-off-by: Dheemanth Mallikarjun --- 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