[v5,1/3] ethdev: remove forcing stopped state upon close
Checks
Commit Message
When closing a port, it is supposed to be already stopped,
and marked as such with "dev_started" state zeroed by the stop API.
Resetting "dev_started" before calling the driver close operation
was hiding the case of not properly stopped port being closed.
The flag "dev_started" is not changed anymore in "rte_eth_dev_close()".
In case the "dev_stop" function is called from "dev_close",
bypassing "rte_eth_dev_stop()" API,
the "dev_started" state must be explicitly reset in the PMD
in order to keep the same behaviour.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
drivers/net/ark/ark_ethdev.c | 1 +
drivers/net/atlantic/atl_ethdev.c | 1 +
drivers/net/dpaa/dpaa_ethdev.c | 1 +
drivers/net/e1000/em_ethdev.c | 2 ++
drivers/net/e1000/igb_ethdev.c | 1 +
drivers/net/ena/ena_ethdev.c | 1 +
drivers/net/enetc/enetc_ethdev.c | 1 +
drivers/net/fm10k/fm10k_ethdev.c | 1 +
drivers/net/hinic/hinic_pmd_ethdev.c | 2 ++
drivers/net/hns3/hns3_ethdev.c | 1 +
drivers/net/hns3/hns3_ethdev_vf.c | 1 +
drivers/net/i40e/i40e_ethdev.c | 1 +
drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
drivers/net/iavf/iavf_ethdev.c | 1 +
drivers/net/ice/ice_ethdev.c | 1 +
drivers/net/igc/igc_ethdev.c | 1 +
drivers/net/ixgbe/ixgbe_ethdev.c | 1 +
drivers/net/kni/rte_eth_kni.c | 1 +
drivers/net/liquidio/lio_ethdev.c | 1 +
drivers/net/mvneta/mvneta_ethdev.c | 2 ++
drivers/net/netvsc/hn_ethdev.c | 1 +
drivers/net/nfb/nfb_ethdev.c | 2 ++
drivers/net/pfe/pfe_ethdev.c | 2 ++
drivers/net/qede/qede_ethdev.c | 1 +
drivers/net/ring/rte_eth_ring.c | 1 +
drivers/net/szedata2/rte_eth_szedata2.c | 2 ++
drivers/net/thunderx/nicvf_ethdev.c | 1 +
drivers/net/vhost/rte_eth_vhost.c | 1 +
drivers/net/virtio/virtio_ethdev.c | 1 +
drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 +
lib/librte_ethdev/rte_ethdev.c | 1 -
31 files changed, 36 insertions(+), 2 deletions(-)
Comments
On 10/13/2020 11:06 AM, Thomas Monjalon wrote:
> When closing a port, it is supposed to be already stopped,
> and marked as such with "dev_started" state zeroed by the stop API.
>
> Resetting "dev_started" before calling the driver close operation
> was hiding the case of not properly stopped port being closed.
> The flag "dev_started" is not changed anymore in "rte_eth_dev_close()".
>
> In case the "dev_stop" function is called from "dev_close",
> bypassing "rte_eth_dev_stop()" API,
> the "dev_started" state must be explicitly reset in the PMD
> in order to keep the same behaviour.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
<...>
> @@ -1497,6 +1497,7 @@ eth_igb_stop(struct rte_eth_dev *dev)
> }
>
> adapter->stopped = true;
> + dev->data->dev_started = 0;
> }
'igbvf_dev_stop()' may be missed.
<...>
> @@ -2917,6 +2917,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
> adapter->rss_reta_updated = 0;
>
> hw->adapter_stopped = true;
> + dev->data->dev_started = 0;
> }
'ixgbevf_dev_stop()' may be missed.
Also many virtual PMDs doesn't call 'dev_stop()' from the 'dev_close()', for
many cases they may not needed to, since there is no device to stop.
But for the sake of the correct status, should 'dev_started' set to '0' in
'dev_close()' dev_ops, or do you think can we ignore this?
On 10/13/2020 11:06 AM, Thomas Monjalon wrote:
> When closing a port, it is supposed to be already stopped,
> and marked as such with "dev_started" state zeroed by the stop API.
>
> Resetting "dev_started" before calling the driver close operation
> was hiding the case of not properly stopped port being closed.
> The flag "dev_started" is not changed anymore in "rte_eth_dev_close()".
>
> In case the "dev_stop" function is called from "dev_close",
> bypassing "rte_eth_dev_stop()" API,
> the "dev_started" state must be explicitly reset in the PMD
> in order to keep the same behaviour.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> ---
> drivers/net/ark/ark_ethdev.c | 1 +
> drivers/net/atlantic/atl_ethdev.c | 1 +
> drivers/net/dpaa/dpaa_ethdev.c | 1 +
> drivers/net/e1000/em_ethdev.c | 2 ++
> drivers/net/e1000/igb_ethdev.c | 1 +
> drivers/net/ena/ena_ethdev.c | 1 +
> drivers/net/enetc/enetc_ethdev.c | 1 +
> drivers/net/fm10k/fm10k_ethdev.c | 1 +
> drivers/net/hinic/hinic_pmd_ethdev.c | 2 ++
> drivers/net/hns3/hns3_ethdev.c | 1 +
> drivers/net/hns3/hns3_ethdev_vf.c | 1 +
> drivers/net/i40e/i40e_ethdev.c | 1 +
> drivers/net/i40e/i40e_ethdev_vf.c | 2 +-
> drivers/net/iavf/iavf_ethdev.c | 1 +
> drivers/net/ice/ice_ethdev.c | 1 +
> drivers/net/igc/igc_ethdev.c | 1 +
> drivers/net/ixgbe/ixgbe_ethdev.c | 1 +
> drivers/net/kni/rte_eth_kni.c | 1 +
> drivers/net/liquidio/lio_ethdev.c | 1 +
> drivers/net/mvneta/mvneta_ethdev.c | 2 ++
> drivers/net/netvsc/hn_ethdev.c | 1 +
> drivers/net/nfb/nfb_ethdev.c | 2 ++
> drivers/net/pfe/pfe_ethdev.c | 2 ++
> drivers/net/qede/qede_ethdev.c | 1 +
> drivers/net/ring/rte_eth_ring.c | 1 +
> drivers/net/szedata2/rte_eth_szedata2.c | 2 ++
> drivers/net/thunderx/nicvf_ethdev.c | 1 +
> drivers/net/vhost/rte_eth_vhost.c | 1 +
> drivers/net/virtio/virtio_ethdev.c | 1 +
> drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 +
> lib/librte_ethdev/rte_ethdev.c | 1 -
> 31 files changed, 36 insertions(+), 2 deletions(-)
Following non-virtual PMDs doesn't call 'dev_stop()' from 'dev_close()',
maintainers of the PMDs cc'ed.
avp
axgbe
bnx2x
cxgbe
dpaa2
enic
ice_dcf
ionic
ipn3ke
mlx4
mlx5
mvpp2
nfp
octeontx
octeontx2
sfc
Can you please double check for your driver:
1) Device stopped properly before it has been closed?
2) The device stopped state ('dev->data->dev_started') is correct if device
closed without explicitly stopped first.
Thanks,
ferruh
13/10/2020 14:36, Ferruh Yigit:
> On 10/13/2020 11:06 AM, Thomas Monjalon wrote:
> > When closing a port, it is supposed to be already stopped,
> > and marked as such with "dev_started" state zeroed by the stop API.
> >
> > Resetting "dev_started" before calling the driver close operation
> > was hiding the case of not properly stopped port being closed.
> > The flag "dev_started" is not changed anymore in "rte_eth_dev_close()".
> >
> > In case the "dev_stop" function is called from "dev_close",
> > bypassing "rte_eth_dev_stop()" API,
> > the "dev_started" state must be explicitly reset in the PMD
> > in order to keep the same behaviour.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>
> <...>
>
> > @@ -1497,6 +1497,7 @@ eth_igb_stop(struct rte_eth_dev *dev)
> > }
> >
> > adapter->stopped = true;
> > + dev->data->dev_started = 0;
> > }
>
> 'igbvf_dev_stop()' may be missed.
Will check
> <...>
>
> > @@ -2917,6 +2917,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
> > adapter->rss_reta_updated = 0;
> >
> > hw->adapter_stopped = true;
> > + dev->data->dev_started = 0;
> > }
>
> 'ixgbevf_dev_stop()' may be missed.
Will check
> Also many virtual PMDs doesn't call 'dev_stop()' from the 'dev_close()', for
> many cases they may not needed to, since there is no device to stop.
> But for the sake of the correct status, should 'dev_started' set to '0' in
> 'dev_close()' dev_ops, or do you think can we ignore this?
I think we can ignore for this patch,
but maybe these PMDs could be updated separately
to comply with the stop/close sequence.
13/10/2020 14:45, Ferruh Yigit:
> On 10/13/2020 11:06 AM, Thomas Monjalon wrote:
> > When closing a port, it is supposed to be already stopped,
> > and marked as such with "dev_started" state zeroed by the stop API.
> >
> > Resetting "dev_started" before calling the driver close operation
> > was hiding the case of not properly stopped port being closed.
> > The flag "dev_started" is not changed anymore in "rte_eth_dev_close()".
> >
> > In case the "dev_stop" function is called from "dev_close",
> > bypassing "rte_eth_dev_stop()" API,
> > the "dev_started" state must be explicitly reset in the PMD
> > in order to keep the same behaviour.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> > Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> > Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
[...]
> Following non-virtual PMDs doesn't call 'dev_stop()' from 'dev_close()',
> maintainers of the PMDs cc'ed.
>
> avp
> axgbe
> bnx2x
> cxgbe
> dpaa2
> enic
> ice_dcf
> ionic
> ipn3ke
> mlx4
> mlx5
> mvpp2
> nfp
> octeontx
> octeontx2
> sfc
>
> Can you please double check for your driver:
>
> 1) Device stopped properly before it has been closed?
>
> 2) The device stopped state ('dev->data->dev_started') is correct if device
> closed without explicitly stopped first.
The application is supposed to call stop before close,
so I don't know what has to be checked.
The automatic stop in close is an extra feature per PMD choice.
On 10/13/2020 1:51 PM, Thomas Monjalon wrote:
> 13/10/2020 14:45, Ferruh Yigit:
>> On 10/13/2020 11:06 AM, Thomas Monjalon wrote:
>>> When closing a port, it is supposed to be already stopped,
>>> and marked as such with "dev_started" state zeroed by the stop API.
>>>
>>> Resetting "dev_started" before calling the driver close operation
>>> was hiding the case of not properly stopped port being closed.
>>> The flag "dev_started" is not changed anymore in "rte_eth_dev_close()".
>>>
>>> In case the "dev_stop" function is called from "dev_close",
>>> bypassing "rte_eth_dev_stop()" API,
>>> the "dev_started" state must be explicitly reset in the PMD
>>> in order to keep the same behaviour.
>>>
>>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
>>> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
>>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> [...]
>> Following non-virtual PMDs doesn't call 'dev_stop()' from 'dev_close()',
>> maintainers of the PMDs cc'ed.
>>
>> avp
>> axgbe
>> bnx2x
>> cxgbe
>> dpaa2
>> enic
>> ice_dcf
>> ionic
>> ipn3ke
>> mlx4
>> mlx5
>> mvpp2
>> nfp
>> octeontx
>> octeontx2
>> sfc
>>
>> Can you please double check for your driver:
>>
>> 1) Device stopped properly before it has been closed?
>>
>> 2) The device stopped state ('dev->data->dev_started') is correct if device
>> closed without explicitly stopped first.
>
> The application is supposed to call stop before close,
> so I don't know what has to be checked.
> The automatic stop in close is an extra feature per PMD choice.
>
A device can be hot-removed without stop, that is why I was thinking 'close()'
should stop the device (if it is not already).
Even current 'rte_eth_dev_close()' API doesn't check if the port stopped or not.
If application does stop -> close/remove in order, that would work, but for the
case it didn't, PMD ensuring the device stopped before close is safer.
13/10/2020 19:54, Ferruh Yigit:
> On 10/13/2020 1:51 PM, Thomas Monjalon wrote:
> > 13/10/2020 14:45, Ferruh Yigit:
> >> On 10/13/2020 11:06 AM, Thomas Monjalon wrote:
> >>> When closing a port, it is supposed to be already stopped,
> >>> and marked as such with "dev_started" state zeroed by the stop API.
> >>>
> >>> Resetting "dev_started" before calling the driver close operation
> >>> was hiding the case of not properly stopped port being closed.
> >>> The flag "dev_started" is not changed anymore in "rte_eth_dev_close()".
> >>>
> >>> In case the "dev_stop" function is called from "dev_close",
> >>> bypassing "rte_eth_dev_stop()" API,
> >>> the "dev_started" state must be explicitly reset in the PMD
> >>> in order to keep the same behaviour.
> >>>
> >>> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> >>> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> >>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
> > [...]
> >> Following non-virtual PMDs doesn't call 'dev_stop()' from 'dev_close()',
> >> maintainers of the PMDs cc'ed.
> >>
> >> avp
> >> axgbe
> >> bnx2x
> >> cxgbe
> >> dpaa2
> >> enic
> >> ice_dcf
> >> ionic
> >> ipn3ke
> >> mlx4
> >> mlx5
> >> mvpp2
> >> nfp
> >> octeontx
> >> octeontx2
> >> sfc
> >>
> >> Can you please double check for your driver:
> >>
> >> 1) Device stopped properly before it has been closed?
> >>
> >> 2) The device stopped state ('dev->data->dev_started') is correct if device
> >> closed without explicitly stopped first.
> >
> > The application is supposed to call stop before close,
> > so I don't know what has to be checked.
> > The automatic stop in close is an extra feature per PMD choice.
> >
>
> A device can be hot-removed without stop, that is why I was thinking 'close()'
> should stop the device (if it is not already).
>
> Even current 'rte_eth_dev_close()' API doesn't check if the port stopped or not.
>
> If application does stop -> close/remove in order, that would work, but for the
> case it didn't, PMD ensuring the device stopped before close is safer.
Yes that's probably a case which not well tested.
@@ -595,6 +595,7 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
if (ark->started == 0)
return;
ark->started = 0;
+ dev->data->dev_started = 0;
/* Stop the extension first */
if (ark->user_ext.dev_stop)
@@ -609,6 +609,7 @@ atl_dev_stop(struct rte_eth_dev *dev)
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_started = 0;
/* disable interrupts */
atl_disable_intr(hw);
@@ -420,6 +420,7 @@ static void dpaa_eth_dev_stop(struct rte_eth_dev *dev)
struct fman_if *fif = dev->process_private;
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_started = 0;
if (!fif->is_shared_mac)
fman_if_disable_rx(fif);
@@ -717,6 +717,8 @@ eth_em_stop(struct rte_eth_dev *dev)
struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
+ dev->data->dev_started = 0;
+
eth_em_rxtx_control(dev, false);
em_rxq_intr_disable(hw);
em_lsc_intr_disable(hw);
@@ -1497,6 +1497,7 @@ eth_igb_stop(struct rte_eth_dev *dev)
}
adapter->stopped = true;
+ dev->data->dev_started = 0;
}
static int
@@ -1118,6 +1118,7 @@ static void ena_stop(struct rte_eth_dev *dev)
++adapter->dev_stats.dev_stop;
adapter->state = ENA_ADAPTER_STATE_STOPPED;
+ dev->data->dev_started = 0;
}
static int ena_create_io_queue(struct ena_ring *ring)
@@ -54,6 +54,7 @@ enetc_dev_stop(struct rte_eth_dev *dev)
uint32_t val;
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_started = 0;
/* Disable port */
val = enetc_port_rd(enetc_hw, ENETC_PMR);
enetc_port_wr(enetc_hw, ENETC_PMR, val & (~ENETC_PMR_EN));
@@ -1161,6 +1161,7 @@ fm10k_dev_stop(struct rte_eth_dev *dev)
int i;
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_started = 0;
if (dev->data->tx_queues)
for (i = 0; i < dev->data->nb_tx_queues; i++)
@@ -1189,6 +1189,8 @@ static void hinic_dev_stop(struct rte_eth_dev *dev)
name = dev->data->name;
port_id = dev->data->port_id;
+ dev->data->dev_started = 0;
+
if (!rte_bit_relaxed_test_and_clear32(HINIC_DEV_START,
&nic_dev->dev_status)) {
PMD_DRV_LOG(INFO, "Device %s already stopped", name);
@@ -4997,6 +4997,7 @@ hns3_dev_stop(struct rte_eth_dev *dev)
struct hns3_hw *hw = &hns->hw;
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_started = 0;
hw->adapter_state = HNS3_NIC_STOPPING;
hns3_set_rxtx_function(dev);
@@ -1952,6 +1952,7 @@ hns3vf_dev_stop(struct rte_eth_dev *dev)
struct hns3_hw *hw = &hns->hw;
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_started = 0;
hw->adapter_state = HNS3_NIC_STOPPING;
hns3_set_rxtx_function(dev);
@@ -2599,6 +2599,7 @@ i40e_dev_stop(struct rte_eth_dev *dev)
pf->tm_conf.committed = false;
hw->adapter_stopped = 1;
+ dev->data->dev_started = 0;
pf->adapter->rss_reta_updated = 0;
}
@@ -2207,7 +2207,7 @@ i40evf_dev_stop(struct rte_eth_dev *dev)
i40evf_add_del_mc_addr_list(dev, vf->mc_addrs, vf->mc_addrs_num,
FALSE);
hw->adapter_stopped = 1;
-
+ dev->data->dev_started = 0;
}
static int
@@ -562,6 +562,7 @@ iavf_dev_stop(struct rte_eth_dev *dev)
false);
adapter->stopped = 1;
+ dev->data->dev_started = 0;
}
static int
@@ -2376,6 +2376,7 @@ ice_dev_stop(struct rte_eth_dev *dev)
}
pf->adapter_stopped = true;
+ dev->data->dev_started = 0;
}
static int
@@ -616,6 +616,7 @@ eth_igc_stop(struct rte_eth_dev *dev)
struct rte_intr_handle *intr_handle = &pci_dev->intr_handle;
struct rte_eth_link link;
+ dev->data->dev_started = 0;
adapter->stopped = 1;
/* disable receive and transmit */
@@ -2917,6 +2917,7 @@ ixgbe_dev_stop(struct rte_eth_dev *dev)
adapter->rss_reta_updated = 0;
hw->adapter_stopped = true;
+ dev->data->dev_started = 0;
}
/*
@@ -196,6 +196,7 @@ eth_kni_dev_stop(struct rte_eth_dev *dev)
}
dev->data->dev_link.link_status = 0;
+ dev->data->dev_started = 0;
}
static int
@@ -1471,6 +1471,7 @@ lio_dev_stop(struct rte_eth_dev *eth_dev)
struct lio_device *lio_dev = LIO_DEV(eth_dev);
lio_dev_info(lio_dev, "Stopping port %d\n", eth_dev->data->port_id);
+ eth_dev->data->dev_started = 0;
lio_dev->intf_open = 0;
rte_mb();
@@ -413,6 +413,8 @@ mvneta_dev_stop(struct rte_eth_dev *dev)
{
struct mvneta_priv *priv = dev->data->dev_private;
+ dev->data->dev_started = 0;
+
if (!priv->ppio)
return;
@@ -833,6 +833,7 @@ hn_dev_stop(struct rte_eth_dev *dev)
struct hn_data *hv = dev->data->dev_private;
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_started = 0;
hn_rndis_set_rxfilter(hv, 0);
hn_vf_stop(dev);
@@ -158,6 +158,8 @@ nfb_eth_dev_stop(struct rte_eth_dev *dev)
uint16_t nb_rx = dev->data->nb_rx_queues;
uint16_t nb_tx = dev->data->nb_tx_queues;
+ dev->data->dev_started = 0;
+
for (i = 0; i < nb_tx; i++)
nfb_eth_tx_queue_stop(dev, i);
@@ -378,6 +378,8 @@ pfe_eth_stop(struct rte_eth_dev *dev/*, int wake*/)
{
struct pfe_eth_priv_s *priv = dev->data->dev_private;
+ dev->data->dev_started = 0;
+
gemac_disable(priv->EMAC_baseaddr);
gpi_disable(priv->GPI_baseaddr);
@@ -1169,6 +1169,7 @@ static void qede_dev_stop(struct rte_eth_dev *eth_dev)
struct ecore_dev *edev = QEDE_INIT_EDEV(qdev);
PMD_INIT_FUNC_TRACE(edev);
+ eth_dev->data->dev_started = 0;
/* Bring the link down */
qede_dev_set_link_state(eth_dev, false);
@@ -108,6 +108,7 @@ eth_dev_start(struct rte_eth_dev *dev)
static void
eth_dev_stop(struct rte_eth_dev *dev)
{
+ dev->data->dev_started = 0;
dev->data->dev_link.link_status = ETH_LINK_DOWN;
}
@@ -1020,6 +1020,8 @@ eth_dev_stop(struct rte_eth_dev *dev)
uint16_t nb_rx = dev->data->nb_rx_queues;
uint16_t nb_tx = dev->data->nb_tx_queues;
+ dev->data->dev_started = 0;
+
for (i = 0; i < nb_tx; i++)
eth_tx_queue_stop(dev, i);
@@ -1766,6 +1766,7 @@ nicvf_dev_stop_cleanup(struct rte_eth_dev *dev, bool cleanup)
struct nicvf *nic = nicvf_pmd_priv(dev);
PMD_INIT_FUNC_TRACE();
+ dev->data->dev_started = 0;
/* Teardown secondary vf first */
for (i = 0; i < nic->sqs_count; i++) {
@@ -1158,6 +1158,7 @@ eth_dev_stop(struct rte_eth_dev *dev)
{
struct pmd_internal *internal = dev->data->dev_private;
+ dev->data->dev_started = 0;
rte_atomic32_set(&internal->started, 0);
update_queuing_status(dev);
}
@@ -2523,6 +2523,7 @@ virtio_dev_stop(struct rte_eth_dev *dev)
struct rte_intr_conf *intr_conf = &dev->data->dev_conf.intr_conf;
PMD_INIT_LOG(DEBUG, "stop");
+ dev->data->dev_started = 0;
rte_spinlock_lock(&hw->state_lock);
if (!hw->started)
@@ -858,6 +858,7 @@ vmxnet3_dev_stop(struct rte_eth_dev *dev)
rte_eth_linkstatus_set(dev, &link);
hw->adapter_stopped = 1;
+ dev->data->dev_started = 0;
}
static void
@@ -1716,7 +1716,6 @@ rte_eth_dev_close(uint16_t port_id)
dev = &rte_eth_devices[port_id];
RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_close);
- dev->data->dev_started = 0;
(*dev->dev_ops->dev_close)(dev);
rte_ethdev_trace_close(port_id);