[v14,5/6] drivers/net: enable device detach on secondary
Checks
Commit Message
With the enabling for hotplug on multi-process, it is not necessary
to prevent detaching a device from a secondary process.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/ena/ena_ethdev.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
Comments
On 10.08.2018 03:42, Qi Zhang wrote:
> With the enabling for hotplug on multi-process, it is not necessary
> to prevent detaching a device from a secondary process.
>
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
From the patch itself including description it is absolutely unclear
why detach works and where it actually happens.
Why is it OK to return 0 instead of error and that's it.
Why is it necessary to call uninit at all in the case of secondary
processes?
> -----Original Message-----
> From: Andrew Rybchenko [mailto:arybchenko@solarflare.com]
> Sent: Sunday, August 12, 2018 6:51 PM
> To: Zhang, Qi Z <qi.z.zhang@intel.com>; thomas@monjalon.net;
> gaetan.rivet@6wind.com; Burakov, Anatoly <anatoly.burakov@intel.com>
> Cc: Ananyev, Konstantin <konstantin.ananyev@intel.com>; dev@dpdk.org;
> Richardson, Bruce <bruce.richardson@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Shelton, Benjamin H
> <benjamin.h.shelton@intel.com>; Vangati, Narender
> <narender.vangati@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v14 5/6] drivers/net: enable device detach on
> secondary
>
> On 10.08.2018 03:42, Qi Zhang wrote:
> > With the enabling for hotplug on multi-process, it is not necessary to
> > prevent detaching a device from a secondary process.
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>
> From the patch itself including description it is absolutely unclear why
> detach works and where it actually happens.
OK, I will add more detail comment.
> Why is it OK to return 0 instead of error and that's it.
Obviously , something need to fix, since uninit is not only called by driver->remove
> Why is it necessary to call uninit at all in the case of secondary processes?
Will parse NULL to rte_eth_dev_pci_generic_remove for secondary process.
@@ -3468,7 +3468,7 @@ bnxt_dev_uninit(struct rte_eth_dev *eth_dev)
int rc;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return -EPERM;
+ return 0;
PMD_DRV_LOG(DEBUG, "Calling Device uninit\n");
bnxt_disable_int(bp);
@@ -1703,7 +1703,7 @@ static int eth_ena_dev_uninit(struct rte_eth_dev *eth_dev)
(struct ena_adapter *)(eth_dev->data->dev_private);
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return -EPERM;
+ return 0;
if (adapter->state != ENA_ADAPTER_STATE_CLOSED)
ena_close(eth_dev);
@@ -2038,7 +2038,7 @@ lio_eth_dev_uninit(struct rte_eth_dev *eth_dev)
PMD_INIT_FUNC_TRACE();
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return -EPERM;
+ return 0;
/* lio_free_sc_buffer_pool */
lio_free_sc_buffer_pool(lio_dev);
@@ -1697,7 +1697,7 @@ eth_virtio_dev_uninit(struct rte_eth_dev *eth_dev)
PMD_INIT_FUNC_TRACE();
if (rte_eal_process_type() == RTE_PROC_SECONDARY)
- return -EPERM;
+ return 0;
virtio_dev_stop(eth_dev);
virtio_dev_close(eth_dev);