From: Shahed Shaikh <shahed.sha...@cavium.com>

Implement eth_dev_ops->dev_reset callback.

Signed-off-by: Shahed Shaikh <shahed.sha...@cavium.com>
---
 drivers/net/qede/qede_ethdev.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/net/qede/qede_ethdev.c b/drivers/net/qede/qede_ethdev.c
index 322400c..36a51f6 100644
--- a/drivers/net/qede/qede_ethdev.c
+++ b/drivers/net/qede/qede_ethdev.c
@@ -14,6 +14,9 @@
 int qede_logtype_driver;
 
 static const struct qed_eth_ops *qed_ops;
+static int qede_eth_dev_uninit(struct rte_eth_dev *eth_dev);
+static int qede_eth_dev_init(struct rte_eth_dev *eth_dev);
+
 #define QEDE_SP_TIMER_PERIOD   10000 /* 100ms */
 
 struct rte_qede_xstats_name_off {
@@ -2295,6 +2298,18 @@ static int qede_set_mtu(struct rte_eth_dev *dev, 
uint16_t mtu)
        return 0;
 }
 
+static int
+qede_dev_reset(struct rte_eth_dev *dev)
+{
+       int ret;
+
+       ret = qede_eth_dev_uninit(dev);
+       if (ret)
+               return ret;
+
+       return qede_eth_dev_init(dev);
+}
+
 static const struct eth_dev_ops qede_eth_dev_ops = {
        .dev_configure = qede_dev_configure,
        .dev_infos_get = qede_dev_info_get,
@@ -2304,6 +2319,7 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t 
mtu)
        .tx_queue_setup = qede_tx_queue_setup,
        .tx_queue_release = qede_tx_queue_release,
        .dev_start = qede_dev_start,
+       .dev_reset = qede_dev_reset,
        .dev_set_link_up = qede_dev_set_link_up,
        .dev_set_link_down = qede_dev_set_link_down,
        .link_update = qede_link_update,
@@ -2346,6 +2362,7 @@ static int qede_set_mtu(struct rte_eth_dev *dev, uint16_t 
mtu)
        .tx_queue_setup = qede_tx_queue_setup,
        .tx_queue_release = qede_tx_queue_release,
        .dev_start = qede_dev_start,
+       .dev_reset = qede_dev_reset,
        .dev_set_link_up = qede_dev_set_link_up,
        .dev_set_link_down = qede_dev_set_link_down,
        .link_update = qede_link_update,
-- 
1.7.10.3

Reply via email to