Change txgbe_dev_stop return value from void to int,
refer to the changes in main repo.
Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com>
---
drivers/net/txgbe/txgbe_ethdev.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
On 10/19/2020 9:54 AM, Jiawen Wu wrote:
> Change txgbe_dev_stop return value from void to int,
> refer to the changes in main repo.
>
Since stop dev_ops return type has been updated in the main repo, expectation
was this patchset introduce the 'stop' dev_ops with correct return type at first
place, instead of making this patch on top of your series to fix.
I have distributed this patch to the relevant commits while merging.
@@ -1602,7 +1602,7 @@ txgbe_dev_start(struct rte_eth_dev *dev)
/*
* Stop device: disable rx and tx functions to allow for reconfiguring.
*/
-static void
+static int
txgbe_dev_stop(struct rte_eth_dev *dev)
{
struct rte_eth_link link;
@@ -1614,7 +1614,7 @@ txgbe_dev_stop(struct rte_eth_dev *dev)
int vf;
if (hw->adapter_stopped)
- return;
+ return 0;
PMD_INIT_FUNC_TRACE();
@@ -1668,6 +1668,9 @@ txgbe_dev_stop(struct rte_eth_dev *dev)
wr32m(hw, TXGBE_LEDCTL, 0xFFFFFFFF, TXGBE_LEDCTL_SEL_MASK);
hw->adapter_stopped = true;
+ dev->data->dev_started = 0;
+
+ return 0;
}
/*
@@ -1726,17 +1729,13 @@ txgbe_dev_close(struct rte_eth_dev *dev)
txgbe_pf_reset_hw(hw);
- txgbe_dev_stop(dev);
+ ret = txgbe_dev_stop(dev);
txgbe_dev_free_queues(dev);
/* reprogram the RAR[0] in case user changed it. */
txgbe_set_rar(hw, 0, hw->mac.addr, 0, true);
- dev->dev_ops = NULL;
- dev->rx_pkt_burst = NULL;
- dev->tx_pkt_burst = NULL;
-
/* Unlock any pending hardware semaphore */
txgbe_swfw_lock_reset(hw);
@@ -1768,7 +1767,7 @@ txgbe_dev_close(struct rte_eth_dev *dev)
rte_free(dev->data->hash_mac_addrs);
dev->data->hash_mac_addrs = NULL;
- return 0;
+ return ret;
}
/*