DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 0/3] Remove RTE_ETH_DEV_DETACHABLE
@ 2017-10-24  8:59 Gaetan Rivet
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag Gaetan Rivet
                   ` (3 more replies)
  0 siblings, 4 replies; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24  8:59 UTC (permalink / raw)
  To: dev
  Cc: Gaetan Rivet, Ajit Khaparde, Alejandro Lucero, Andrew Rybchenko,
	Beilei Xing, Bruce Richardson, Cristian Dumitrescu,
	Declan Doherty, Ferruh Yigit, Jing Chen, John Miller,
	John W. Linville, Konstantin Ananyev, Matt Peters,
	Nelio Laranjeiro, Pascal Mazon, Shrikrishna Khare,
	Srisivasubramanian Srinivasan, Tetsuya Mukawa, Wenzhuo Lu,
	Yongseok Koh

This flag was deprecated in the previous release, and this is its removal.

We are going from an explicit support of device detach, to an implicit one,
with specific checks in place for PMDs not supporting the feature.

Attempting to Cc all relevant maintainers:

Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Alejandro Lucero <alejandro.lucero@netronome.com>
Cc: Andrew Rybchenko <arybchenko@solarflare.com>
Cc: Beilei Xing <beilei.xing@intel.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Cc: Declan Doherty <declan.doherty@intel.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Jing Chen <jing.d.chen@intel.com>
Cc: John Miller <john.miller@atomicrules.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: Matt Peters <matt.peters@windriver.com>
Cc: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Cc: Pascal Mazon <pascal.mazon@6wind.com>
Cc: Shrikrishna Khare <skhare@vmware.com>
Cc: Srisivasubramanian Srinivasan <ssrinivasan@cavium.com>
Cc: Tetsuya Mukawa <mtetsuyah@gmail.com>
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
Cc: Yongseok Koh <yskoh@mellanox.com>

Sorry for any undue ML traffic going your way if you are not interested
in this series.

I'd like to highlight Alejandro Lucero for the NFP PMD, as the patch is
somewhat more involved for this PMD and I don't have the hardware available
to validate the change.

Gaetan Rivet (3):
  ethdev: remove detachable device flag
  doc: follow detachable flag disappearance
  pci: propagate PMD removal error value for unplug

 doc/guides/prog_guide/port_hotplug_framework.rst |  8 ++------
 drivers/net/af_packet/rte_eth_af_packet.c        |  1 -
 drivers/net/ark/ark_ethdev.c                     |  1 -
 drivers/net/avp/avp_ethdev.c                     |  2 --
 drivers/net/bnxt/bnxt_ethdev.c                   |  1 -
 drivers/net/bonding/rte_eth_bond_pmd.c           |  3 +--
 drivers/net/e1000/em_ethdev.c                    |  1 -
 drivers/net/e1000/igb_ethdev.c                   |  2 --
 drivers/net/fm10k/fm10k_ethdev.c                 |  1 -
 drivers/net/i40e/i40e_ethdev.c                   |  1 -
 drivers/net/i40e/i40e_ethdev_vf.c                |  1 -
 drivers/net/ixgbe/ixgbe_ethdev.c                 |  2 --
 drivers/net/kni/rte_eth_kni.c                    |  2 --
 drivers/net/liquidio/lio_ethdev.c                |  1 -
 drivers/net/mlx4/mlx4.c                          |  1 -
 drivers/net/mlx5/mlx5.c                          |  1 -
 drivers/net/nfp/nfp_net.c                        | 19 ++++++++++++++++---
 drivers/net/null/rte_eth_null.c                  |  2 --
 drivers/net/pcap/rte_eth_pcap.c                  |  1 -
 drivers/net/ring/rte_eth_ring.c                  |  1 -
 drivers/net/sfc/sfc_ethdev.c                     |  2 --
 drivers/net/softnic/rte_eth_softnic.c            |  1 -
 drivers/net/tap/rte_eth_tap.c                    |  2 +-
 drivers/net/vhost/rte_eth_vhost.c                |  3 +--
 drivers/net/virtio/virtio_ethdev.c               |  1 -
 drivers/net/virtio/virtio_user_ethdev.c          |  1 -
 drivers/net/vmxnet3/vmxnet3_ethdev.c             |  1 -
 lib/librte_eal/common/eal_common_pci.c           | 14 ++++++++++----
 lib/librte_ether/rte_ethdev.c                    | 19 -------------------
 lib/librte_ether/rte_ethdev.h                    |  2 --
 30 files changed, 31 insertions(+), 67 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag
  2017-10-24  8:59 [dpdk-dev] [PATCH v1 0/3] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
@ 2017-10-24  8:59 ` Gaetan Rivet
  2017-10-24  9:13   ` Andrew Rybchenko
  2017-10-24  9:23   ` Thomas Monjalon
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag disappearance Gaetan Rivet
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24  8:59 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet

This flag is not necessary at the ether layer anymore.
Buses are able to advertize their hotplug support. The ether layer can
rely upon this capability instead of a special flag.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c |  1 -
 drivers/net/ark/ark_ethdev.c              |  1 -
 drivers/net/avp/avp_ethdev.c              |  2 --
 drivers/net/bnxt/bnxt_ethdev.c            |  1 -
 drivers/net/bonding/rte_eth_bond_pmd.c    |  3 +--
 drivers/net/e1000/em_ethdev.c             |  1 -
 drivers/net/e1000/igb_ethdev.c            |  2 --
 drivers/net/fm10k/fm10k_ethdev.c          |  1 -
 drivers/net/i40e/i40e_ethdev.c            |  1 -
 drivers/net/i40e/i40e_ethdev_vf.c         |  1 -
 drivers/net/ixgbe/ixgbe_ethdev.c          |  2 --
 drivers/net/kni/rte_eth_kni.c             |  2 --
 drivers/net/liquidio/lio_ethdev.c         |  1 -
 drivers/net/mlx4/mlx4.c                   |  1 -
 drivers/net/mlx5/mlx5.c                   |  1 -
 drivers/net/nfp/nfp_net.c                 | 19 ++++++++++++++++---
 drivers/net/null/rte_eth_null.c           |  2 --
 drivers/net/pcap/rte_eth_pcap.c           |  1 -
 drivers/net/ring/rte_eth_ring.c           |  1 -
 drivers/net/sfc/sfc_ethdev.c              |  2 --
 drivers/net/softnic/rte_eth_softnic.c     |  1 -
 drivers/net/tap/rte_eth_tap.c             |  2 +-
 drivers/net/vhost/rte_eth_vhost.c         |  3 +--
 drivers/net/virtio/virtio_ethdev.c        |  1 -
 drivers/net/virtio/virtio_user_ethdev.c   |  1 -
 drivers/net/vmxnet3/vmxnet3_ethdev.c      |  1 -
 lib/librte_ether/rte_ethdev.c             | 19 -------------------
 lib/librte_ether/rte_ethdev.h             |  2 --
 28 files changed, 19 insertions(+), 57 deletions(-)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 46b8250..c6b86a3 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -814,7 +814,6 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
 
 	(*eth_dev)->data = data;
 	(*eth_dev)->dev_ops = &ops;
-	(*eth_dev)->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 
 	return 0;
 
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index dae1f3d..1760628 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -342,7 +342,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
 	/* We are a single function multi-port device. */
 	ret = ark_config_device(dev);
 	dev->dev_ops = &ark_eth_dev_ops;
-	dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	dev->data->mac_addrs = rte_zmalloc("ark", ETHER_ADDR_LEN, 0);
 	if (!dev->data->mac_addrs) {
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index b97a90c..d729b26 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -1004,8 +1004,6 @@ eth_avp_dev_init(struct rte_eth_dev *eth_dev)
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
-
 	/* Check current migration status */
 	if (avp_dev_migration_pending(eth_dev)) {
 		PMD_DRV_LOG(ERR, "VM live migration operation in progress\n");
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index d3da301..29252d8 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2780,7 +2780,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		RTE_LOG(INFO, PMD, "%s\n", bnxt_version);
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	bp = eth_dev->data->dev_private;
 
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 3fbc1b1..cbc7ddd 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2761,8 +2761,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
 	}
 
 	eth_dev->dev_ops = &default_dev_ops;
-	eth_dev->data->dev_flags = RTE_ETH_DEV_INTR_LSC |
-		RTE_ETH_DEV_DETACHABLE;
+	eth_dev->data->dev_flags = RTE_ETH_DEV_INTR_LSC;
 
 	rte_spinlock_init(&internals->lock);
 
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 6ebfa6d..a599260 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -341,7 +341,6 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
 	hw->device_id = pci_dev->id.device_id;
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 003bdf0..2fd679b 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -818,7 +818,6 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->hw_addr= (void *)pci_dev->mem_resource[0].addr;
 
@@ -1053,7 +1052,6 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
 
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 586f482..d760600 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2909,7 +2909,6 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 	}
 
 	rte_eth_copy_pci_info(dev, pdev);
-	dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	macvlan = FM10K_DEV_PRIVATE_TO_MACVLAN(dev->data->dev_private);
 	memset(macvlan, 0, sizeof(*macvlan));
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index f40c463..d360a32 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1100,7 +1100,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)
 	intr_handle = &pci_dev->intr_handle;
 
 	rte_eth_copy_pci_info(dev, pci_dev);
-	dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	pf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	pf->adapter->eth_dev = dev;
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 9f14875..bc8bbca 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1461,7 +1461,6 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
 	i40e_set_default_ptype_table(eth_dev);
 	i40e_set_default_pctype_table(eth_dev);
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->vendor_id = pci_dev->id.vendor_id;
 	hw->device_id = pci_dev->id.device_id;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 14b9c53..ad18b6f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1168,7 +1168,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	/* Vendor and Device ID need to be set before init of shared code */
 	hw->device_id = pci_dev->id.device_id;
@@ -1627,7 +1626,6 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index d290c79..d68ff7a 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -397,8 +397,6 @@ eth_kni_create(struct rte_vdev_device *vdev,
 	eth_dev->data = data;
 	eth_dev->dev_ops = &eth_kni_ops;
 
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
-
 	internals->no_request_thread = args->no_request_thread;
 
 	return eth_dev;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 239f6af..924eb26 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -2079,7 +2079,6 @@ lio_eth_dev_init(struct rte_eth_dev *eth_dev)
 		return 0;
 
 	rte_eth_copy_pci_info(eth_dev, pdev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	if (pdev->mem_resource[0].addr) {
 		lio_dev->hw_addr = pdev->mem_resource[0].addr;
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index a297b9a..59286af 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -642,7 +642,6 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		eth_dev->intr_handle = &priv->intr_handle;
 		priv->dev = eth_dev;
 		eth_dev->dev_ops = &mlx4_dev_ops;
-		eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 		/* Bring Ethernet device up. */
 		DEBUG("forcing Ethernet interface up");
 		mlx4_dev_set_link_up(priv->dev);
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 29221dc..9abe333 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -917,7 +917,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		eth_dev->data->mac_addrs = priv->mac;
 		eth_dev->device = &pci_dev->device;
 		rte_eth_copy_pci_info(eth_dev, pci_dev);
-		eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 		eth_dev->device->driver = &mlx5_driver.driver;
 		priv->dev = eth_dev;
 		eth_dev->dev_ops = &mlx5_dev_ops;
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 0917b9c..b2ad20e 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -2668,9 +2668,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 		return 0;
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	/* hotplug is not possible with multiport PF */
-	if (!hw->pf_multiport_enabled)
-		eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
@@ -3016,6 +3013,22 @@ static int eth_nfp_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 static int eth_nfp_pci_remove(struct rte_pci_device *pci_dev)
 {
+	struct rte_eth_dev *eth_dev;
+	struct nfp_net_hw *hw, *hwport0;
+	int port = 0;
+
+	eth_dev = rte_eth_dev_allocated(pci_dev->device.name);
+	if ((pci_dev->id.device_id == PCI_DEVICE_ID_NFP4000_PF_NIC) ||
+	    (pci_dev->id.device_id == PCI_DEVICE_ID_NFP6000_PF_NIC)) {
+		port = get_pf_port_number(eth_dev->data->name);
+		hwport0 = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+		hw = &hwport0[port];
+	} else {
+		hw = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+	}
+	/* hotplug is not possible with multiport PF */
+	if (!hw->pf_multiport_enabled)
+		return -ENOTSUP;
 	return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
 }
 
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 47c7b14..3433c9c 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -542,8 +542,6 @@ eth_dev_null_create(struct rte_vdev_device *dev,
 	eth_dev->data = data;
 	eth_dev->dev_ops = &ops;
 
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
-
 	/* finally assign rx and tx ops */
 	if (packet_copy) {
 		eth_dev->rx_pkt_burst = eth_null_copy_rx;
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 1b8a74e..3205df8 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -840,7 +840,6 @@ pmd_init_internals(struct rte_vdev_device *vdev,
 	 */
 	(*eth_dev)->data = data;
 	(*eth_dev)->dev_ops = &ops;
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 
 	return 0;
 }
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 61473ca..d82d207 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -358,7 +358,6 @@ do_eth_dev_ring_create(const char *name,
 
 	eth_dev->data = data;
 	eth_dev->dev_ops = &ops;
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	data->kdrv = RTE_KDRV_NONE;
 	data->numa_node = numa_node;
 
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index bd09191..cd82b0d 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1791,8 +1791,6 @@ sfc_eth_dev_init(struct rte_eth_dev *dev)
 	/* Copy PCI device info to the dev->data */
 	rte_eth_copy_pci_info(dev, pci_dev);
 
-	dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
-
 	rc = sfc_kvargs_parse(sa);
 	if (rc != 0)
 		goto fail_kvargs_parse;
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 34dceae..abb617a 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -557,7 +557,6 @@ pmd_ethdev_register(struct rte_vdev_device *vdev,
 	soft_dev->data->promiscuous = 1;
 	soft_dev->data->kdrv = RTE_KDRV_NONE;
 	soft_dev->data->numa_node = numa_node;
-	soft_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 
 	return 0;
 }
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 61c6774..64dd3b0 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1268,7 +1268,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name,
 	/* Setup some default values */
 	rte_memcpy(data, dev->data, sizeof(*data));
 	data->dev_private = pmd;
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE | RTE_ETH_DEV_INTR_LSC;
+	data->dev_flags = RTE_ETH_DEV_INTR_LSC;
 	data->numa_node = numa_node;
 
 	data->dev_link = pmd_link;
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 3534649..f98c980 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1086,8 +1086,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,
 	internal->max_queues = queues;
 	data->dev_link = pmd_link;
 	data->mac_addrs = eth_addr;
-	data->dev_flags =
-		RTE_ETH_DEV_DETACHABLE | RTE_ETH_DEV_INTR_LSC;
+	data->dev_flags = RTE_ETH_DEV_INTR_LSC;
 
 	eth_dev->dev_ops = &ops;
 
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 0ec54a9..f3d36a0 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1384,7 +1384,6 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
 		rte_eth_copy_pci_info(eth_dev, pci_dev);
 	}
 
-	eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	/* If host does not support both status and MSI-X then disable LSC */
 	if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS) && hw->use_msix)
 		eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 57c964d..595585a 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -372,7 +372,6 @@ virtio_user_eth_dev_alloc(struct rte_vdev_device *vdev)
 	hw->use_simple_rx = 0;
 	hw->use_simple_tx = 0;
 	hw->virtio_user_dev = dev;
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	return eth_dev;
 }
 
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 58bc4f2..6f5cadf 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -309,7 +309,6 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
 		return 0;
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	/* Vendor and Device ID need to be set before init of shared code */
 	hw->device_id = pci_dev->id.device_id;
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 0b1e928..60a130b 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -356,21 +356,6 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id)
 	return -ENODEV;
 }
 
-static int
-rte_eth_dev_is_detachable(uint16_t port_id)
-{
-	uint32_t dev_flags;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
-
-	dev_flags = rte_eth_devices[port_id].data->dev_flags;
-	if ((dev_flags & RTE_ETH_DEV_DETACHABLE) &&
-		(!(dev_flags & RTE_ETH_DEV_BONDED_SLAVE)))
-		return 0;
-	else
-		return 1;
-}
-
 /* attach the new device, then store port_id of the device */
 int
 rte_eth_dev_attach(const char *devargs, uint16_t *port_id)
@@ -428,10 +413,6 @@ rte_eth_dev_detach(uint16_t port_id, char *name)
 		goto err;
 	}
 
-	/* FIXME: move this to eal, once device flags are relocated there */
-	if (rte_eth_dev_is_detachable(port_id))
-		goto err;
-
 	snprintf(name, sizeof(rte_eth_devices[port_id].data->name),
 		 "%s", rte_eth_devices[port_id].data->name);
 
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index aaf02b3..34cdf56 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1798,8 +1798,6 @@ struct rte_eth_dev_data {
 	/**< VLAN filter configuration. */
 };
 
-/** Device supports hotplug detach */
-#define RTE_ETH_DEV_DETACHABLE   0x0001
 /** Device supports link state interrupt */
 #define RTE_ETH_DEV_INTR_LSC     0x0002
 /** Device is a bonded slave */
-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag disappearance
  2017-10-24  8:59 [dpdk-dev] [PATCH v1 0/3] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag Gaetan Rivet
@ 2017-10-24  8:59 ` Gaetan Rivet
  2017-10-25  8:55   ` Mcnamara, John
  2017-10-25  8:56   ` Mcnamara, John
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 3/3] pci: propagate PMD removal error value for unplug Gaetan Rivet
  2017-10-24 10:35 ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
  3 siblings, 2 replies; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24  8:59 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet

Update documentation to new API.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 doc/guides/prog_guide/port_hotplug_framework.rst | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/doc/guides/prog_guide/port_hotplug_framework.rst b/doc/guides/prog_guide/port_hotplug_framework.rst
index ee76577..fb0efc1 100644
--- a/doc/guides/prog_guide/port_hotplug_framework.rst
+++ b/doc/guides/prog_guide/port_hotplug_framework.rst
@@ -101,10 +101,6 @@ Limitations
 
 *       The framework can only be enabled with Linux. BSD is not supported.
 
-*       To detach a port, the port should be backed by a device that igb_uio
-        or VFIO manages.
-
 *       Not all PMDs support detaching feature.
-        To know whether a PMD can support detaching, search for the
-        "RTE_ETH_DEV_DETACHABLE" flag in rte_eth_dev::data::dev_flags. If the flag is
-        defined in the PMD, detaching is supported.
+        The underlying bus must support hot-unplug. If not supported,
+        the function ``rte_eth_dev_detach()`` will return negative ENOTSUP.
-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v1 3/3] pci: propagate PMD removal error value for unplug
  2017-10-24  8:59 [dpdk-dev] [PATCH v1 0/3] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag Gaetan Rivet
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag disappearance Gaetan Rivet
@ 2017-10-24  8:59 ` Gaetan Rivet
  2017-10-24 10:35 ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
  3 siblings, 0 replies; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24  8:59 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet

If a PCI device detach removal fails, returns the actual removal
operator error value.

Use this value within pci->unplug, as it may help applications solve an
issue with the feature or more accurately warn their users.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/common/eal_common_pci.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 0f0e4b9..fb92ee7 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -263,6 +263,7 @@ rte_pci_detach_dev(struct rte_pci_device *dev)
 {
 	struct rte_pci_addr *loc;
 	struct rte_pci_driver *dr;
+	int ret = 0;
 
 	if (dev == NULL)
 		return -EINVAL;
@@ -277,8 +278,11 @@ rte_pci_detach_dev(struct rte_pci_device *dev)
 	RTE_LOG(DEBUG, EAL, "  remove driver: %x:%x %s\n", dev->id.vendor_id,
 			dev->id.device_id, dr->driver.name);
 
-	if (dr->remove && (dr->remove(dev) < 0))
-		return -1;	/* negative value is an error */
+	if (dr->remove) {
+		ret = dr->remove(dev);
+		if (ret < 0)
+			return ret;
+	}
 
 	/* clear driver structure */
 	dev->driver = NULL;
@@ -551,8 +555,10 @@ pci_unplug(struct rte_device *dev)
 
 	pdev = RTE_DEV_TO_PCI(dev);
 	ret = rte_pci_detach_dev(pdev);
-	rte_pci_remove_device(pdev);
-	free(pdev);
+	if (ret == 0) {
+		rte_pci_remove_device(pdev);
+		free(pdev);
+	}
 	return ret;
 }
 
-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag Gaetan Rivet
@ 2017-10-24  9:13   ` Andrew Rybchenko
  2017-10-24  9:23   ` Thomas Monjalon
  1 sibling, 0 replies; 27+ messages in thread
From: Andrew Rybchenko @ 2017-10-24  9:13 UTC (permalink / raw)
  To: Gaetan Rivet, dev

On 10/24/2017 11:59 AM, Gaetan Rivet wrote:
> This flag is not necessary at the ether layer anymore.
> Buses are able to advertize their hotplug support. The ether layer can
> rely upon this capability instead of a special flag.
>
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>

Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>

> ---
>   drivers/net/af_packet/rte_eth_af_packet.c |  1 -
>   drivers/net/ark/ark_ethdev.c              |  1 -
>   drivers/net/avp/avp_ethdev.c              |  2 --
>   drivers/net/bnxt/bnxt_ethdev.c            |  1 -
>   drivers/net/bonding/rte_eth_bond_pmd.c    |  3 +--
>   drivers/net/e1000/em_ethdev.c             |  1 -
>   drivers/net/e1000/igb_ethdev.c            |  2 --
>   drivers/net/fm10k/fm10k_ethdev.c          |  1 -
>   drivers/net/i40e/i40e_ethdev.c            |  1 -
>   drivers/net/i40e/i40e_ethdev_vf.c         |  1 -
>   drivers/net/ixgbe/ixgbe_ethdev.c          |  2 --
>   drivers/net/kni/rte_eth_kni.c             |  2 --
>   drivers/net/liquidio/lio_ethdev.c         |  1 -
>   drivers/net/mlx4/mlx4.c                   |  1 -
>   drivers/net/mlx5/mlx5.c                   |  1 -
>   drivers/net/nfp/nfp_net.c                 | 19 ++++++++++++++++---
>   drivers/net/null/rte_eth_null.c           |  2 --
>   drivers/net/pcap/rte_eth_pcap.c           |  1 -
>   drivers/net/ring/rte_eth_ring.c           |  1 -
>   drivers/net/sfc/sfc_ethdev.c              |  2 --
>   drivers/net/softnic/rte_eth_softnic.c     |  1 -
>   drivers/net/tap/rte_eth_tap.c             |  2 +-
>   drivers/net/vhost/rte_eth_vhost.c         |  3 +--
>   drivers/net/virtio/virtio_ethdev.c        |  1 -
>   drivers/net/virtio/virtio_user_ethdev.c   |  1 -
>   drivers/net/vmxnet3/vmxnet3_ethdev.c      |  1 -
>   lib/librte_ether/rte_ethdev.c             | 19 -------------------
>   lib/librte_ether/rte_ethdev.h             |  2 --
>   28 files changed, 19 insertions(+), 57 deletions(-)

<...>

> diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
> index bd09191..cd82b0d 100644
> --- a/drivers/net/sfc/sfc_ethdev.c
> +++ b/drivers/net/sfc/sfc_ethdev.c
> @@ -1791,8 +1791,6 @@ sfc_eth_dev_init(struct rte_eth_dev *dev)
>   	/* Copy PCI device info to the dev->data */
>   	rte_eth_copy_pci_info(dev, pci_dev);
>   
> -	dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
> -
>   	rc = sfc_kvargs_parse(sa);
>   	if (rc != 0)
>   		goto fail_kvargs_parse;

<...>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag Gaetan Rivet
  2017-10-24  9:13   ` Andrew Rybchenko
@ 2017-10-24  9:23   ` Thomas Monjalon
  2017-10-24  9:27     ` Gaëtan Rivet
  1 sibling, 1 reply; 27+ messages in thread
From: Thomas Monjalon @ 2017-10-24  9:23 UTC (permalink / raw)
  To: Gaetan Rivet; +Cc: dev

24/10/2017 10:59, Gaetan Rivet:
> This flag is not necessary at the ether layer anymore.
> Buses are able to advertize their hotplug support. The ether layer can
> rely upon this capability instead of a special flag.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>

Please update the release notes in API section
and remove the deprecation notice.
Thanks

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag
  2017-10-24  9:23   ` Thomas Monjalon
@ 2017-10-24  9:27     ` Gaëtan Rivet
  0 siblings, 0 replies; 27+ messages in thread
From: Gaëtan Rivet @ 2017-10-24  9:27 UTC (permalink / raw)
  To: Thomas Monjalon; +Cc: dev

On Tue, Oct 24, 2017 at 11:23:44AM +0200, Thomas Monjalon wrote:
> 24/10/2017 10:59, Gaetan Rivet:
> > This flag is not necessary at the ether layer anymore.
> > Buses are able to advertize their hotplug support. The ether layer can
> > rely upon this capability instead of a special flag.
> > 
> > Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
> 
> Please update the release notes in API section
> and remove the deprecation notice.
> Thanks
> 

Sure.

I missed a BONDED_SLAVE issue as well, and can divide the 1/3 patch in
two (first the ether changes, second the flag removal).

Will send a v2 shortly.

-- 
Gaëtan Rivet
6WIND

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE
  2017-10-24  8:59 [dpdk-dev] [PATCH v1 0/3] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
                   ` (2 preceding siblings ...)
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 3/3] pci: propagate PMD removal error value for unplug Gaetan Rivet
@ 2017-10-24 10:35 ` Gaetan Rivet
  2017-10-24 10:35   ` [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach Gaetan Rivet
                     ` (2 more replies)
  3 siblings, 3 replies; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24 10:35 UTC (permalink / raw)
  To: dev
  Cc: Gaetan Rivet, Ajit Khaparde, Alejandro Lucero, Beilei Xing,
	Bruce Richardson, Cristian Dumitrescu, Declan Doherty,
	Ferruh Yigit, Jing Chen, John Miller, John W. Linville,
	Konstantin Ananyev, Matt Peters, Nelio Laranjeiro, Pascal Mazon,
	Shrikrishna Khare, Srisivasubramanian Srinivasan, Tetsuya Mukawa,
	Wenzhuo Lu, Yongseok Koh

This flag was deprecated in the previous release, and this is its removal.

We are going from an explicit support of device detach, to an implicit one,
with specific checks in place for PMDs not supporting the feature.

Attempting to Cc all relevant maintainers:

Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
Cc: Alejandro Lucero <alejandro.lucero@netronome.com>
Cc: Beilei Xing <beilei.xing@intel.com>
Cc: Bruce Richardson <bruce.richardson@intel.com>
Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Cc: Declan Doherty <declan.doherty@intel.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Jing Chen <jing.d.chen@intel.com>
Cc: John Miller <john.miller@atomicrules.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: Konstantin Ananyev <konstantin.ananyev@intel.com>
Cc: Matt Peters <matt.peters@windriver.com>
Cc: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
Cc: Pascal Mazon <pascal.mazon@6wind.com>
Cc: Shrikrishna Khare <skhare@vmware.com>
Cc: Srisivasubramanian Srinivasan <ssrinivasan@cavium.com>
Cc: Tetsuya Mukawa <mtetsuyah@gmail.com>
Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
Cc: Yongseok Koh <yskoh@mellanox.com>

Sorry for any undue ML traffic going your way if you are not interested
in this series.

I'd like to highlight Alejandro Lucero for the NFP PMD, as the patch is
somewhat more involved for this PMD and I don't have the hardware available
to validate the change.

v2:

  + Split ether patch:
    First remove the use of the flag, then remove the flag

  + Restore RTE_ETH_DEV_BONDED_SLAVE check,
    previously hastily removed along the DETACHABLE one.

  + Added release note, removed deprecation notice

Gaetan Rivet (6):
  ethdev: do not rely on detachable flag in detach
  ethdev: remove detachable device flag
  pci: propagate PMD removal error value for unplug
  doc: follow detachable flag disappearance
  doc: update detachable flag deprecation notice
  doc: note ether API change for detachable flag

 doc/guides/prog_guide/port_hotplug_framework.rst |  8 ++------
 doc/guides/rel_notes/deprecation.rst             |  8 --------
 doc/guides/rel_notes/release_17_11.rst           |  6 ++++++
 drivers/net/af_packet/rte_eth_af_packet.c        |  1 -
 drivers/net/ark/ark_ethdev.c                     |  1 -
 drivers/net/avp/avp_ethdev.c                     |  2 --
 drivers/net/bnxt/bnxt_ethdev.c                   |  1 -
 drivers/net/bonding/rte_eth_bond_pmd.c           |  3 +--
 drivers/net/e1000/em_ethdev.c                    |  1 -
 drivers/net/e1000/igb_ethdev.c                   |  2 --
 drivers/net/fm10k/fm10k_ethdev.c                 |  1 -
 drivers/net/i40e/i40e_ethdev.c                   |  1 -
 drivers/net/i40e/i40e_ethdev_vf.c                |  1 -
 drivers/net/ixgbe/ixgbe_ethdev.c                 |  2 --
 drivers/net/kni/rte_eth_kni.c                    |  2 --
 drivers/net/liquidio/lio_ethdev.c                |  1 -
 drivers/net/mlx4/mlx4.c                          |  1 -
 drivers/net/mlx5/mlx5.c                          |  1 -
 drivers/net/nfp/nfp_net.c                        | 19 ++++++++++++++---
 drivers/net/null/rte_eth_null.c                  |  2 --
 drivers/net/pcap/rte_eth_pcap.c                  |  1 -
 drivers/net/ring/rte_eth_ring.c                  |  1 -
 drivers/net/sfc/sfc_ethdev.c                     |  2 --
 drivers/net/softnic/rte_eth_softnic.c            |  1 -
 drivers/net/tap/rte_eth_tap.c                    |  2 +-
 drivers/net/vhost/rte_eth_vhost.c                |  3 +--
 drivers/net/virtio/virtio_ethdev.c               |  1 -
 drivers/net/virtio/virtio_user_ethdev.c          |  1 -
 drivers/net/vmxnet3/vmxnet3_ethdev.c             |  1 -
 lib/librte_eal/common/eal_common_pci.c           | 14 +++++++++----
 lib/librte_ether/rte_ethdev.c                    | 26 ++++++++----------------
 lib/librte_ether/rte_ethdev.h                    |  2 --
 32 files changed, 46 insertions(+), 73 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach
  2017-10-24 10:35 ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
@ 2017-10-24 10:35   ` Gaetan Rivet
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 2/6] ethdev: remove detachable device flag Gaetan Rivet
                       ` (4 more replies)
  2017-10-24 12:35   ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Thomas Monjalon
  2017-10-24 23:56   ` Ferruh Yigit
  2 siblings, 5 replies; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24 10:35 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet

This flag is deprecated and should not be used to check for the device
ability to be detached.

The rte_dev library call will fail with the relevant error code if
detaching this port is not possible.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_ether/rte_ethdev.c | 26 +++++++++-----------------
 1 file changed, 9 insertions(+), 17 deletions(-)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 0b1e928..d9a71e2 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -356,21 +356,6 @@ rte_eth_dev_get_port_by_name(const char *name, uint16_t *port_id)
 	return -ENODEV;
 }
 
-static int
-rte_eth_dev_is_detachable(uint16_t port_id)
-{
-	uint32_t dev_flags;
-
-	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
-
-	dev_flags = rte_eth_devices[port_id].data->dev_flags;
-	if ((dev_flags & RTE_ETH_DEV_DETACHABLE) &&
-		(!(dev_flags & RTE_ETH_DEV_BONDED_SLAVE)))
-		return 0;
-	else
-		return 1;
-}
-
 /* attach the new device, then store port_id of the device */
 int
 rte_eth_dev_attach(const char *devargs, uint16_t *port_id)
@@ -421,16 +406,23 @@ rte_eth_dev_attach(const char *devargs, uint16_t *port_id)
 int
 rte_eth_dev_detach(uint16_t port_id, char *name)
 {
+	uint32_t dev_flags;
 	int ret = -1;
 
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -EINVAL);
+
 	if (name == NULL) {
 		ret = -EINVAL;
 		goto err;
 	}
 
-	/* FIXME: move this to eal, once device flags are relocated there */
-	if (rte_eth_dev_is_detachable(port_id))
+	dev_flags = rte_eth_devices[port_id].data->dev_flags;
+	if (dev_flags & RTE_ETH_DEV_BONDED_SLAVE) {
+		RTE_LOG(ERR, EAL, "Port %" PRIu16 " is bonded, cannot detach\n",
+			port_id);
+		ret = -ENOTSUP;
 		goto err;
+	}
 
 	snprintf(name, sizeof(rte_eth_devices[port_id].data->name),
 		 "%s", rte_eth_devices[port_id].data->name);
-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v2 2/6] ethdev: remove detachable device flag
  2017-10-24 10:35   ` [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach Gaetan Rivet
@ 2017-10-24 10:35     ` Gaetan Rivet
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 3/6] pci: propagate PMD removal error value for unplug Gaetan Rivet
                       ` (3 subsequent siblings)
  4 siblings, 0 replies; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24 10:35 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet

This flag is not necessary at the ether layer anymore.
Buses are able to advertize their hotplug support. The ether layer can
rely upon this capability instead of a special flag.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/af_packet/rte_eth_af_packet.c |  1 -
 drivers/net/ark/ark_ethdev.c              |  1 -
 drivers/net/avp/avp_ethdev.c              |  2 --
 drivers/net/bnxt/bnxt_ethdev.c            |  1 -
 drivers/net/bonding/rte_eth_bond_pmd.c    |  3 +--
 drivers/net/e1000/em_ethdev.c             |  1 -
 drivers/net/e1000/igb_ethdev.c            |  2 --
 drivers/net/fm10k/fm10k_ethdev.c          |  1 -
 drivers/net/i40e/i40e_ethdev.c            |  1 -
 drivers/net/i40e/i40e_ethdev_vf.c         |  1 -
 drivers/net/ixgbe/ixgbe_ethdev.c          |  2 --
 drivers/net/kni/rte_eth_kni.c             |  2 --
 drivers/net/liquidio/lio_ethdev.c         |  1 -
 drivers/net/mlx4/mlx4.c                   |  1 -
 drivers/net/mlx5/mlx5.c                   |  1 -
 drivers/net/nfp/nfp_net.c                 | 19 ++++++++++++++++---
 drivers/net/null/rte_eth_null.c           |  2 --
 drivers/net/pcap/rte_eth_pcap.c           |  1 -
 drivers/net/ring/rte_eth_ring.c           |  1 -
 drivers/net/sfc/sfc_ethdev.c              |  2 --
 drivers/net/softnic/rte_eth_softnic.c     |  1 -
 drivers/net/tap/rte_eth_tap.c             |  2 +-
 drivers/net/vhost/rte_eth_vhost.c         |  3 +--
 drivers/net/virtio/virtio_ethdev.c        |  1 -
 drivers/net/virtio/virtio_user_ethdev.c   |  1 -
 drivers/net/vmxnet3/vmxnet3_ethdev.c      |  1 -
 lib/librte_ether/rte_ethdev.h             |  2 --
 27 files changed, 19 insertions(+), 38 deletions(-)

diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 46b8250..c6b86a3 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -814,7 +814,6 @@ rte_pmd_init_internals(struct rte_vdev_device *dev,
 
 	(*eth_dev)->data = data;
 	(*eth_dev)->dev_ops = &ops;
-	(*eth_dev)->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 
 	return 0;
 
diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
index dae1f3d..1760628 100644
--- a/drivers/net/ark/ark_ethdev.c
+++ b/drivers/net/ark/ark_ethdev.c
@@ -342,7 +342,6 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
 	/* We are a single function multi-port device. */
 	ret = ark_config_device(dev);
 	dev->dev_ops = &ark_eth_dev_ops;
-	dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	dev->data->mac_addrs = rte_zmalloc("ark", ETHER_ADDR_LEN, 0);
 	if (!dev->data->mac_addrs) {
diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c
index b97a90c..d729b26 100644
--- a/drivers/net/avp/avp_ethdev.c
+++ b/drivers/net/avp/avp_ethdev.c
@@ -1004,8 +1004,6 @@ eth_avp_dev_init(struct rte_eth_dev *eth_dev)
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
 
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
-
 	/* Check current migration status */
 	if (avp_dev_migration_pending(eth_dev)) {
 		PMD_DRV_LOG(ERR, "VM live migration operation in progress\n");
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index d3da301..29252d8 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -2780,7 +2780,6 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 		RTE_LOG(INFO, PMD, "%s\n", bnxt_version);
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	bp = eth_dev->data->dev_private;
 
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 3fbc1b1..cbc7ddd 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -2761,8 +2761,7 @@ bond_alloc(struct rte_vdev_device *dev, uint8_t mode)
 	}
 
 	eth_dev->dev_ops = &default_dev_ops;
-	eth_dev->data->dev_flags = RTE_ETH_DEV_INTR_LSC |
-		RTE_ETH_DEV_DETACHABLE;
+	eth_dev->data->dev_flags = RTE_ETH_DEV_INTR_LSC;
 
 	rte_spinlock_init(&internals->lock);
 
diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c
index 6ebfa6d..a599260 100644
--- a/drivers/net/e1000/em_ethdev.c
+++ b/drivers/net/e1000/em_ethdev.c
@@ -341,7 +341,6 @@ eth_em_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->hw_addr = (void *)pci_dev->mem_resource[0].addr;
 	hw->device_id = pci_dev->id.device_id;
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 003bdf0..2fd679b 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -818,7 +818,6 @@ eth_igb_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->hw_addr= (void *)pci_dev->mem_resource[0].addr;
 
@@ -1053,7 +1052,6 @@ eth_igbvf_dev_init(struct rte_eth_dev *eth_dev)
 
 	pci_dev = RTE_ETH_DEV_TO_PCI(eth_dev);
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c
index 586f482..d760600 100644
--- a/drivers/net/fm10k/fm10k_ethdev.c
+++ b/drivers/net/fm10k/fm10k_ethdev.c
@@ -2909,7 +2909,6 @@ eth_fm10k_dev_init(struct rte_eth_dev *dev)
 	}
 
 	rte_eth_copy_pci_info(dev, pdev);
-	dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	macvlan = FM10K_DEV_PRIVATE_TO_MACVLAN(dev->data->dev_private);
 	memset(macvlan, 0, sizeof(*macvlan));
diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index f40c463..d360a32 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -1100,7 +1100,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev)
 	intr_handle = &pci_dev->intr_handle;
 
 	rte_eth_copy_pci_info(dev, pci_dev);
-	dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	pf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	pf->adapter->eth_dev = dev;
diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c
index 9f14875..bc8bbca 100644
--- a/drivers/net/i40e/i40e_ethdev_vf.c
+++ b/drivers/net/i40e/i40e_ethdev_vf.c
@@ -1461,7 +1461,6 @@ i40evf_dev_init(struct rte_eth_dev *eth_dev)
 	i40e_set_default_ptype_table(eth_dev);
 	i40e_set_default_pctype_table(eth_dev);
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->vendor_id = pci_dev->id.vendor_id;
 	hw->device_id = pci_dev->id.device_id;
diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c
index 14b9c53..ad18b6f 100644
--- a/drivers/net/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/ixgbe/ixgbe_ethdev.c
@@ -1168,7 +1168,6 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	/* Vendor and Device ID need to be set before init of shared code */
 	hw->device_id = pci_dev->id.device_id;
@@ -1627,7 +1626,6 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev)
 	}
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index d290c79..d68ff7a 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -397,8 +397,6 @@ eth_kni_create(struct rte_vdev_device *vdev,
 	eth_dev->data = data;
 	eth_dev->dev_ops = &eth_kni_ops;
 
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
-
 	internals->no_request_thread = args->no_request_thread;
 
 	return eth_dev;
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index 239f6af..924eb26 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -2079,7 +2079,6 @@ lio_eth_dev_init(struct rte_eth_dev *eth_dev)
 		return 0;
 
 	rte_eth_copy_pci_info(eth_dev, pdev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	if (pdev->mem_resource[0].addr) {
 		lio_dev->hw_addr = pdev->mem_resource[0].addr;
diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c
index a297b9a..59286af 100644
--- a/drivers/net/mlx4/mlx4.c
+++ b/drivers/net/mlx4/mlx4.c
@@ -642,7 +642,6 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		eth_dev->intr_handle = &priv->intr_handle;
 		priv->dev = eth_dev;
 		eth_dev->dev_ops = &mlx4_dev_ops;
-		eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 		/* Bring Ethernet device up. */
 		DEBUG("forcing Ethernet interface up");
 		mlx4_dev_set_link_up(priv->dev);
diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 29221dc..9abe333 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -917,7 +917,6 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)
 		eth_dev->data->mac_addrs = priv->mac;
 		eth_dev->device = &pci_dev->device;
 		rte_eth_copy_pci_info(eth_dev, pci_dev);
-		eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 		eth_dev->device->driver = &mlx5_driver.driver;
 		priv->dev = eth_dev;
 		eth_dev->dev_ops = &mlx5_dev_ops;
diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 0917b9c..b2ad20e 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -2668,9 +2668,6 @@ nfp_net_init(struct rte_eth_dev *eth_dev)
 		return 0;
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	/* hotplug is not possible with multiport PF */
-	if (!hw->pf_multiport_enabled)
-		eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	hw->device_id = pci_dev->id.device_id;
 	hw->vendor_id = pci_dev->id.vendor_id;
@@ -3016,6 +3013,22 @@ static int eth_nfp_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 static int eth_nfp_pci_remove(struct rte_pci_device *pci_dev)
 {
+	struct rte_eth_dev *eth_dev;
+	struct nfp_net_hw *hw, *hwport0;
+	int port = 0;
+
+	eth_dev = rte_eth_dev_allocated(pci_dev->device.name);
+	if ((pci_dev->id.device_id == PCI_DEVICE_ID_NFP4000_PF_NIC) ||
+	    (pci_dev->id.device_id == PCI_DEVICE_ID_NFP6000_PF_NIC)) {
+		port = get_pf_port_number(eth_dev->data->name);
+		hwport0 = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+		hw = &hwport0[port];
+	} else {
+		hw = NFP_NET_DEV_PRIVATE_TO_HW(eth_dev->data->dev_private);
+	}
+	/* hotplug is not possible with multiport PF */
+	if (!hw->pf_multiport_enabled)
+		return -ENOTSUP;
 	return rte_eth_dev_pci_generic_remove(pci_dev, NULL);
 }
 
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index 47c7b14..3433c9c 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -542,8 +542,6 @@ eth_dev_null_create(struct rte_vdev_device *dev,
 	eth_dev->data = data;
 	eth_dev->dev_ops = &ops;
 
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
-
 	/* finally assign rx and tx ops */
 	if (packet_copy) {
 		eth_dev->rx_pkt_burst = eth_null_copy_rx;
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 1b8a74e..3205df8 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -840,7 +840,6 @@ pmd_init_internals(struct rte_vdev_device *vdev,
 	 */
 	(*eth_dev)->data = data;
 	(*eth_dev)->dev_ops = &ops;
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 
 	return 0;
 }
diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c
index 61473ca..d82d207 100644
--- a/drivers/net/ring/rte_eth_ring.c
+++ b/drivers/net/ring/rte_eth_ring.c
@@ -358,7 +358,6 @@ do_eth_dev_ring_create(const char *name,
 
 	eth_dev->data = data;
 	eth_dev->dev_ops = &ops;
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	data->kdrv = RTE_KDRV_NONE;
 	data->numa_node = numa_node;
 
diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c
index bd09191..cd82b0d 100644
--- a/drivers/net/sfc/sfc_ethdev.c
+++ b/drivers/net/sfc/sfc_ethdev.c
@@ -1791,8 +1791,6 @@ sfc_eth_dev_init(struct rte_eth_dev *dev)
 	/* Copy PCI device info to the dev->data */
 	rte_eth_copy_pci_info(dev, pci_dev);
 
-	dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
-
 	rc = sfc_kvargs_parse(sa);
 	if (rc != 0)
 		goto fail_kvargs_parse;
diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c
index 34dceae..abb617a 100644
--- a/drivers/net/softnic/rte_eth_softnic.c
+++ b/drivers/net/softnic/rte_eth_softnic.c
@@ -557,7 +557,6 @@ pmd_ethdev_register(struct rte_vdev_device *vdev,
 	soft_dev->data->promiscuous = 1;
 	soft_dev->data->kdrv = RTE_KDRV_NONE;
 	soft_dev->data->numa_node = numa_node;
-	soft_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 
 	return 0;
 }
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 61c6774..64dd3b0 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1268,7 +1268,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, char *tap_name,
 	/* Setup some default values */
 	rte_memcpy(data, dev->data, sizeof(*data));
 	data->dev_private = pmd;
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE | RTE_ETH_DEV_INTR_LSC;
+	data->dev_flags = RTE_ETH_DEV_INTR_LSC;
 	data->numa_node = numa_node;
 
 	data->dev_link = pmd_link;
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 3534649..f98c980 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1086,8 +1086,7 @@ eth_dev_vhost_create(struct rte_vdev_device *dev, char *iface_name,
 	internal->max_queues = queues;
 	data->dev_link = pmd_link;
 	data->mac_addrs = eth_addr;
-	data->dev_flags =
-		RTE_ETH_DEV_DETACHABLE | RTE_ETH_DEV_INTR_LSC;
+	data->dev_flags = RTE_ETH_DEV_INTR_LSC;
 
 	eth_dev->dev_ops = &ops;
 
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 0ec54a9..f3d36a0 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1384,7 +1384,6 @@ virtio_init_device(struct rte_eth_dev *eth_dev, uint64_t req_features)
 		rte_eth_copy_pci_info(eth_dev, pci_dev);
 	}
 
-	eth_dev->data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	/* If host does not support both status and MSI-X then disable LSC */
 	if (vtpci_with_feature(hw, VIRTIO_NET_F_STATUS) && hw->use_msix)
 		eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_LSC;
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index 57c964d..595585a 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -372,7 +372,6 @@ virtio_user_eth_dev_alloc(struct rte_vdev_device *vdev)
 	hw->use_simple_rx = 0;
 	hw->use_simple_tx = 0;
 	hw->virtio_user_dev = dev;
-	data->dev_flags = RTE_ETH_DEV_DETACHABLE;
 	return eth_dev;
 }
 
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index 58bc4f2..6f5cadf 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -309,7 +309,6 @@ eth_vmxnet3_dev_init(struct rte_eth_dev *eth_dev)
 		return 0;
 
 	rte_eth_copy_pci_info(eth_dev, pci_dev);
-	eth_dev->data->dev_flags |= RTE_ETH_DEV_DETACHABLE;
 
 	/* Vendor and Device ID need to be set before init of shared code */
 	hw->device_id = pci_dev->id.device_id;
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index aaf02b3..34cdf56 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -1798,8 +1798,6 @@ struct rte_eth_dev_data {
 	/**< VLAN filter configuration. */
 };
 
-/** Device supports hotplug detach */
-#define RTE_ETH_DEV_DETACHABLE   0x0001
 /** Device supports link state interrupt */
 #define RTE_ETH_DEV_INTR_LSC     0x0002
 /** Device is a bonded slave */
-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v2 3/6] pci: propagate PMD removal error value for unplug
  2017-10-24 10:35   ` [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach Gaetan Rivet
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 2/6] ethdev: remove detachable device flag Gaetan Rivet
@ 2017-10-24 10:35     ` Gaetan Rivet
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 4/6] doc: follow detachable flag disappearance Gaetan Rivet
                       ` (2 subsequent siblings)
  4 siblings, 0 replies; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24 10:35 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet

If a PCI device detach removal fails, returns the actual removal
operator error value.

Use this value within pci->unplug, as it may help applications solve an
issue with the feature or more accurately warn their users.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 lib/librte_eal/common/eal_common_pci.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c
index 0f0e4b9..fb92ee7 100644
--- a/lib/librte_eal/common/eal_common_pci.c
+++ b/lib/librte_eal/common/eal_common_pci.c
@@ -263,6 +263,7 @@ rte_pci_detach_dev(struct rte_pci_device *dev)
 {
 	struct rte_pci_addr *loc;
 	struct rte_pci_driver *dr;
+	int ret = 0;
 
 	if (dev == NULL)
 		return -EINVAL;
@@ -277,8 +278,11 @@ rte_pci_detach_dev(struct rte_pci_device *dev)
 	RTE_LOG(DEBUG, EAL, "  remove driver: %x:%x %s\n", dev->id.vendor_id,
 			dev->id.device_id, dr->driver.name);
 
-	if (dr->remove && (dr->remove(dev) < 0))
-		return -1;	/* negative value is an error */
+	if (dr->remove) {
+		ret = dr->remove(dev);
+		if (ret < 0)
+			return ret;
+	}
 
 	/* clear driver structure */
 	dev->driver = NULL;
@@ -551,8 +555,10 @@ pci_unplug(struct rte_device *dev)
 
 	pdev = RTE_DEV_TO_PCI(dev);
 	ret = rte_pci_detach_dev(pdev);
-	rte_pci_remove_device(pdev);
-	free(pdev);
+	if (ret == 0) {
+		rte_pci_remove_device(pdev);
+		free(pdev);
+	}
 	return ret;
 }
 
-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v2 4/6] doc: follow detachable flag disappearance
  2017-10-24 10:35   ` [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach Gaetan Rivet
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 2/6] ethdev: remove detachable device flag Gaetan Rivet
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 3/6] pci: propagate PMD removal error value for unplug Gaetan Rivet
@ 2017-10-24 10:35     ` Gaetan Rivet
  2017-10-25  8:57       ` Mcnamara, John
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 5/6] doc: update detachable flag deprecation notice Gaetan Rivet
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for detachable flag Gaetan Rivet
  4 siblings, 1 reply; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24 10:35 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet

Update documentation to new API.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 doc/guides/prog_guide/port_hotplug_framework.rst | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/doc/guides/prog_guide/port_hotplug_framework.rst b/doc/guides/prog_guide/port_hotplug_framework.rst
index ee76577..fb0efc1 100644
--- a/doc/guides/prog_guide/port_hotplug_framework.rst
+++ b/doc/guides/prog_guide/port_hotplug_framework.rst
@@ -101,10 +101,6 @@ Limitations
 
 *       The framework can only be enabled with Linux. BSD is not supported.
 
-*       To detach a port, the port should be backed by a device that igb_uio
-        or VFIO manages.
-
 *       Not all PMDs support detaching feature.
-        To know whether a PMD can support detaching, search for the
-        "RTE_ETH_DEV_DETACHABLE" flag in rte_eth_dev::data::dev_flags. If the flag is
-        defined in the PMD, detaching is supported.
+        The underlying bus must support hot-unplug. If not supported,
+        the function ``rte_eth_dev_detach()`` will return negative ENOTSUP.
-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v2 5/6] doc: update detachable flag deprecation notice
  2017-10-24 10:35   ` [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach Gaetan Rivet
                       ` (2 preceding siblings ...)
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 4/6] doc: follow detachable flag disappearance Gaetan Rivet
@ 2017-10-24 10:35     ` Gaetan Rivet
  2017-10-25  9:03       ` Mcnamara, John
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for detachable flag Gaetan Rivet
  4 siblings, 1 reply; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24 10:35 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet

Remove the deprecation notice as the flag has been removed.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 doc/guides/rel_notes/deprecation.rst | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 52058f5..354cc1c 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -56,14 +56,6 @@ Deprecation Notices
   Target release for removal of the legacy API will be defined once most
   PMDs have switched to rte_flow.
 
-* ethdev: The device flag advertizing hotplug capability
-  ``RTE_ETH_DEV_DETACHABLE`` is not needed anymore and will be removed in
-  v17.11.
-  This capability is verified upon calling the relevant hotplug functions in EAL
-  by checking that the ``unplug`` ops is set in the bus. This verification is
-  done by the EAL and not by the ``ethdev`` layer anymore. Users relying on this
-  flag being present only have to remove their checks to follow the change.
-
 * ethdev: new parameters - ``rte_security_capabilities`` and
   ``rte_security_ops`` will be added to ``rte_eth_dev_info`` and
   ``rte_eth_dev`` respectively  to support security operations like
-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for detachable flag
  2017-10-24 10:35   ` [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach Gaetan Rivet
                       ` (3 preceding siblings ...)
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 5/6] doc: update detachable flag deprecation notice Gaetan Rivet
@ 2017-10-24 10:35     ` Gaetan Rivet
  2017-10-25  8:58       ` Mcnamara, John
  2017-10-25  9:01       ` Mcnamara, John
  4 siblings, 2 replies; 27+ messages in thread
From: Gaetan Rivet @ 2017-10-24 10:35 UTC (permalink / raw)
  To: dev; +Cc: Gaetan Rivet

Add the ether library evolution to the release notes

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 doc/guides/rel_notes/release_17_11.rst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 8db35f5..80522fd 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -246,6 +246,12 @@ API Changes
   The size of internal device name is increased to 64 characters
   to allow for storing longer bus specific name.
 
+* **Ethdev flag RTE_ETH_DEV_DETACHABLE was removed**
+
+  This flag is not necessary anymore, with the new hotplug implementation.
+  It is now removed from the ether library. Its semantic is expressed at the bus
+  and PMD level.
+
 * **Service cores API updated for usability**
 
   The service cores API has been changed, removing pointers from the API
-- 
2.1.4

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE
  2017-10-24 10:35 ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
  2017-10-24 10:35   ` [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach Gaetan Rivet
@ 2017-10-24 12:35   ` Thomas Monjalon
  2017-10-25 17:37     ` Ferruh Yigit
  2017-10-24 23:56   ` Ferruh Yigit
  2 siblings, 1 reply; 27+ messages in thread
From: Thomas Monjalon @ 2017-10-24 12:35 UTC (permalink / raw)
  To: Gaetan Rivet, Ferruh Yigit; +Cc: dev, Alejandro Lucero

24/10/2017 12:35, Gaetan Rivet:
> Gaetan Rivet (6):
>   ethdev: do not rely on detachable flag in detach
>   ethdev: remove detachable device flag
>   pci: propagate PMD removal error value for unplug
>   doc: follow detachable flag disappearance
>   doc: update detachable flag deprecation notice
>   doc: note ether API change for detachable flag

All the doc patches can be squashed in the patch 2.

Acked-by: Thomas Monjalon <thomas@monjalon.net>

Please Ferruh, make it part of RC2 in next-net when
the nfp part is confirmed.

Thanks

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE
  2017-10-24 10:35 ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
  2017-10-24 10:35   ` [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach Gaetan Rivet
  2017-10-24 12:35   ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Thomas Monjalon
@ 2017-10-24 23:56   ` Ferruh Yigit
  2017-10-25 16:11     ` Ferruh Yigit
  2 siblings, 1 reply; 27+ messages in thread
From: Ferruh Yigit @ 2017-10-24 23:56 UTC (permalink / raw)
  To: Gaetan Rivet, dev
  Cc: Ajit Khaparde, Alejandro Lucero, Beilei Xing, Bruce Richardson,
	Cristian Dumitrescu, Declan Doherty, Jing Chen, John Miller,
	John W. Linville, Konstantin Ananyev, Matt Peters,
	Nelio Laranjeiro, Pascal Mazon, Shrikrishna Khare,
	Srisivasubramanian Srinivasan, Tetsuya Mukawa, Wenzhuo Lu,
	Yongseok Koh

On 10/24/2017 3:35 AM, Gaetan Rivet wrote:
> This flag was deprecated in the previous release, and this is its removal.

This change was in wait list, but it would be much more better if not received
just before rc2, but in early stages in the release, at worst before rc1.

Although patch looks good to me, getting ethdev layer update in rc2 is creating
some stress.

> We are going from an explicit support of device detach, to an implicit one,
> with specific checks in place for PMDs not supporting the feature.

Removing this flag implies all ethdev devices are detachable, right.
That is why you need to update error value handling in pci hotplug code, and
return error in nfp remove path, since there is no way to say not detachable.

> 
> Attempting to Cc all relevant maintainers:
> 
> Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Cc: Alejandro Lucero <alejandro.lucero@netronome.com>
> Cc: Beilei Xing <beilei.xing@intel.com>
> Cc: Bruce Richardson <bruce.richardson@intel.com>
> Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
> Cc: Declan Doherty <declan.doherty@intel.com>
> Cc: Ferruh Yigit <ferruh.yigit@intel.com>
> Cc: Jing Chen <jing.d.chen@intel.com>
> Cc: John Miller <john.miller@atomicrules.com>
> Cc: John W. Linville <linville@tuxdriver.com>
> Cc: Konstantin Ananyev <konstantin.ananyev@intel.com>
> Cc: Matt Peters <matt.peters@windriver.com>
> Cc: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> Cc: Pascal Mazon <pascal.mazon@6wind.com>
> Cc: Shrikrishna Khare <skhare@vmware.com>
> Cc: Srisivasubramanian Srinivasan <ssrinivasan@cavium.com>
> Cc: Tetsuya Mukawa <mtetsuyah@gmail.com>
> Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
> Cc: Yongseok Koh <yskoh@mellanox.com>
> 
> Sorry for any undue ML traffic going your way if you are not interested
> in this series.
> 
> I'd like to highlight Alejandro Lucero for the NFP PMD, as the patch is
> somewhat more involved for this PMD and I don't have the hardware available
> to validate the change.

Let's give one more day to Alejandro to comment on NFP update.

And others to comment on overall, if there is no objection include this into rc2.

> 
> v2:
> 
>   + Split ether patch:
>     First remove the use of the flag, then remove the flag
> 
>   + Restore RTE_ETH_DEV_BONDED_SLAVE check,
>     previously hastily removed along the DETACHABLE one.
> 
>   + Added release note, removed deprecation notice
> 
> Gaetan Rivet (6):
>   ethdev: do not rely on detachable flag in detach
>   ethdev: remove detachable device flag
>   pci: propagate PMD removal error value for unplug
>   doc: follow detachable flag disappearance
>   doc: update detachable flag deprecation notice
>   doc: note ether API change for detachable flag

<...>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag disappearance
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag disappearance Gaetan Rivet
@ 2017-10-25  8:55   ` Mcnamara, John
  2017-10-25  8:56   ` Mcnamara, John
  1 sibling, 0 replies; 27+ messages in thread
From: Mcnamara, John @ 2017-10-25  8:55 UTC (permalink / raw)
  To: Gaetan Rivet, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gaetan Rivet
> Sent: Tuesday, October 24, 2017 9:59 AM
> To: dev@dpdk.org
> Cc: Gaetan Rivet <gaetan.rivet@6wind.com>
> Subject: [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag
> disappearance
> 
> Update documentation to new API.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag disappearance
  2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag disappearance Gaetan Rivet
  2017-10-25  8:55   ` Mcnamara, John
@ 2017-10-25  8:56   ` Mcnamara, John
  1 sibling, 0 replies; 27+ messages in thread
From: Mcnamara, John @ 2017-10-25  8:56 UTC (permalink / raw)
  To: Gaetan Rivet, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gaetan Rivet
> Sent: Tuesday, October 24, 2017 9:59 AM
> To: dev@dpdk.org
> Cc: Gaetan Rivet <gaetan.rivet@6wind.com>
> Subject: [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag
> disappearance
> 
> Update documentation to new API.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>


Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 4/6] doc: follow detachable flag disappearance
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 4/6] doc: follow detachable flag disappearance Gaetan Rivet
@ 2017-10-25  8:57       ` Mcnamara, John
  0 siblings, 0 replies; 27+ messages in thread
From: Mcnamara, John @ 2017-10-25  8:57 UTC (permalink / raw)
  To: Gaetan Rivet, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gaetan Rivet
> Sent: Tuesday, October 24, 2017 11:36 AM
> To: dev@dpdk.org
> Cc: Gaetan Rivet <gaetan.rivet@6wind.com>
> Subject: [dpdk-dev] [PATCH v2 4/6] doc: follow detachable flag
> disappearance
> 
> Update documentation to new API.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for detachable flag
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for detachable flag Gaetan Rivet
@ 2017-10-25  8:58       ` Mcnamara, John
  2017-10-25  9:01       ` Mcnamara, John
  1 sibling, 0 replies; 27+ messages in thread
From: Mcnamara, John @ 2017-10-25  8:58 UTC (permalink / raw)
  To: Gaetan Rivet, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gaetan Rivet
> Sent: Tuesday, October 24, 2017 11:36 AM
> To: dev@dpdk.org
> Cc: Gaetan Rivet <gaetan.rivet@6wind.com>
> Subject: [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for
> detachable flag
> 
> Add the ether library evolution to the release notes
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for detachable flag
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for detachable flag Gaetan Rivet
  2017-10-25  8:58       ` Mcnamara, John
@ 2017-10-25  9:01       ` Mcnamara, John
  1 sibling, 0 replies; 27+ messages in thread
From: Mcnamara, John @ 2017-10-25  9:01 UTC (permalink / raw)
  To: Gaetan Rivet, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gaetan Rivet
> Sent: Tuesday, October 24, 2017 11:36 AM
> To: dev@dpdk.org
> Cc: Gaetan Rivet <gaetan.rivet@6wind.com>
> Subject: [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for
> detachable flag
> 
> Add the ether library evolution to the release notes
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 5/6] doc: update detachable flag deprecation notice
  2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 5/6] doc: update detachable flag deprecation notice Gaetan Rivet
@ 2017-10-25  9:03       ` Mcnamara, John
  0 siblings, 0 replies; 27+ messages in thread
From: Mcnamara, John @ 2017-10-25  9:03 UTC (permalink / raw)
  To: Gaetan Rivet, dev



> -----Original Message-----
> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Gaetan Rivet
> Sent: Tuesday, October 24, 2017 11:36 AM
> To: dev@dpdk.org
> Cc: Gaetan Rivet <gaetan.rivet@6wind.com>
> Subject: [dpdk-dev] [PATCH v2 5/6] doc: update detachable flag deprecation
> notice
> 
> Remove the deprecation notice as the flag has been removed.
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>

Acked-by: John McNamara <john.mcnamara@intel.com>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE
  2017-10-24 23:56   ` Ferruh Yigit
@ 2017-10-25 16:11     ` Ferruh Yigit
  0 siblings, 0 replies; 27+ messages in thread
From: Ferruh Yigit @ 2017-10-25 16:11 UTC (permalink / raw)
  To: Gaetan Rivet, dev
  Cc: Ajit Khaparde, Alejandro Lucero, Beilei Xing, Bruce Richardson,
	Cristian Dumitrescu, Declan Doherty, Jing Chen, John Miller,
	John W. Linville, Konstantin Ananyev, Matt Peters,
	Nelio Laranjeiro, Pascal Mazon, Shrikrishna Khare,
	Srisivasubramanian Srinivasan, Tetsuya Mukawa, Wenzhuo Lu,
	Yongseok Koh

On 10/24/2017 4:56 PM, Ferruh Yigit wrote:
> On 10/24/2017 3:35 AM, Gaetan Rivet wrote:
>> This flag was deprecated in the previous release, and this is its removal.
> 
> This change was in wait list, but it would be much more better if not received
> just before rc2, but in early stages in the release, at worst before rc1.
> 
> Although patch looks good to me, getting ethdev layer update in rc2 is creating
> some stress.
> 
>> We are going from an explicit support of device detach, to an implicit one,
>> with specific checks in place for PMDs not supporting the feature.
> 
> Removing this flag implies all ethdev devices are detachable, right.
> That is why you need to update error value handling in pci hotplug code, and
> return error in nfp remove path, since there is no way to say not detachable.
> 
>>
>> Attempting to Cc all relevant maintainers:
>>
>> Cc: Ajit Khaparde <ajit.khaparde@broadcom.com>
>> Cc: Alejandro Lucero <alejandro.lucero@netronome.com>
>> Cc: Beilei Xing <beilei.xing@intel.com>
>> Cc: Bruce Richardson <bruce.richardson@intel.com>
>> Cc: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
>> Cc: Declan Doherty <declan.doherty@intel.com>
>> Cc: Ferruh Yigit <ferruh.yigit@intel.com>
>> Cc: Jing Chen <jing.d.chen@intel.com>
>> Cc: John Miller <john.miller@atomicrules.com>
>> Cc: John W. Linville <linville@tuxdriver.com>
>> Cc: Konstantin Ananyev <konstantin.ananyev@intel.com>
>> Cc: Matt Peters <matt.peters@windriver.com>
>> Cc: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
>> Cc: Pascal Mazon <pascal.mazon@6wind.com>
>> Cc: Shrikrishna Khare <skhare@vmware.com>
>> Cc: Srisivasubramanian Srinivasan <ssrinivasan@cavium.com>
>> Cc: Tetsuya Mukawa <mtetsuyah@gmail.com>
>> Cc: Wenzhuo Lu <wenzhuo.lu@intel.com>
>> Cc: Yongseok Koh <yskoh@mellanox.com>
>>
>> Sorry for any undue ML traffic going your way if you are not interested
>> in this series.
>>
>> I'd like to highlight Alejandro Lucero for the NFP PMD, as the patch is
>> somewhat more involved for this PMD and I don't have the hardware available
>> to validate the change.
> 
> Let's give one more day to Alejandro to comment on NFP update.
> 
> And others to comment on overall, if there is no objection include this into rc2.

btw, not directly related to this patch, but related to the hotplug, testpmd
crashes after detaching a port and start forwarding, anyone have bandwidth to
look at this?

> 
>>
>> v2:
>>
>>   + Split ether patch:
>>     First remove the use of the flag, then remove the flag
>>
>>   + Restore RTE_ETH_DEV_BONDED_SLAVE check,
>>     previously hastily removed along the DETACHABLE one.
>>
>>   + Added release note, removed deprecation notice
>>
>> Gaetan Rivet (6):
>>   ethdev: do not rely on detachable flag in detach
>>   ethdev: remove detachable device flag
>>   pci: propagate PMD removal error value for unplug
>>   doc: follow detachable flag disappearance
>>   doc: update detachable flag deprecation notice
>>   doc: note ether API change for detachable flag
> 
> <...>
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE
  2017-10-24 12:35   ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Thomas Monjalon
@ 2017-10-25 17:37     ` Ferruh Yigit
  2017-10-30  9:45       ` Alejandro Lucero
  0 siblings, 1 reply; 27+ messages in thread
From: Ferruh Yigit @ 2017-10-25 17:37 UTC (permalink / raw)
  To: Thomas Monjalon, Gaetan Rivet; +Cc: dev, Alejandro Lucero

On 10/24/2017 5:35 AM, Thomas Monjalon wrote:
> 24/10/2017 12:35, Gaetan Rivet:
>> Gaetan Rivet (6):
>>   ethdev: do not rely on detachable flag in detach
>>   ethdev: remove detachable device flag
>>   pci: propagate PMD removal error value for unplug
>>   doc: follow detachable flag disappearance
>>   doc: update detachable flag deprecation notice
>>   doc: note ether API change for detachable flag

> Acked-by: Thomas Monjalon <thomas@monjalon.net>

Series applied to dpdk-next-net/master, thanks.

(doc patches squashed into patch 2/6)

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE
  2017-10-25 17:37     ` Ferruh Yigit
@ 2017-10-30  9:45       ` Alejandro Lucero
  2017-10-31 11:09         ` Alejandro Lucero
  0 siblings, 1 reply; 27+ messages in thread
From: Alejandro Lucero @ 2017-10-30  9:45 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Thomas Monjalon, Gaetan Rivet, dev

Hi guys,

i have been on PTO since the 19th of October.

I will test this patch asap, but I'm aware this has already been accepted.

On Wed, Oct 25, 2017 at 6:37 PM, Ferruh Yigit <ferruh.yigit@intel.com>
wrote:

> On 10/24/2017 5:35 AM, Thomas Monjalon wrote:
> > 24/10/2017 12:35, Gaetan Rivet:
> >> Gaetan Rivet (6):
> >>   ethdev: do not rely on detachable flag in detach
> >>   ethdev: remove detachable device flag
> >>   pci: propagate PMD removal error value for unplug
> >>   doc: follow detachable flag disappearance
> >>   doc: update detachable flag deprecation notice
> >>   doc: note ether API change for detachable flag
>
> > Acked-by: Thomas Monjalon <thomas@monjalon.net>
>
> Series applied to dpdk-next-net/master, thanks.
>
> (doc patches squashed into patch 2/6)
>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE
  2017-10-30  9:45       ` Alejandro Lucero
@ 2017-10-31 11:09         ` Alejandro Lucero
  2017-10-31 17:24           ` Ferruh Yigit
  0 siblings, 1 reply; 27+ messages in thread
From: Alejandro Lucero @ 2017-10-31 11:09 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Thomas Monjalon, Gaetan Rivet, dev

I'm afraid the patch introduced a problem for the NFP PMD.

I have submitted a patch fixing it: "net/nfp: avoid unplug if multiport"

Thanks

On Mon, Oct 30, 2017 at 9:45 AM, Alejandro Lucero <
alejandro.lucero@netronome.com> wrote:

> Hi guys,
>
> i have been on PTO since the 19th of October.
>
> I will test this patch asap, but I'm aware this has already been accepted.
>
> On Wed, Oct 25, 2017 at 6:37 PM, Ferruh Yigit <ferruh.yigit@intel.com>
> wrote:
>
>> On 10/24/2017 5:35 AM, Thomas Monjalon wrote:
>> > 24/10/2017 12:35, Gaetan Rivet:
>> >> Gaetan Rivet (6):
>> >>   ethdev: do not rely on detachable flag in detach
>> >>   ethdev: remove detachable device flag
>> >>   pci: propagate PMD removal error value for unplug
>> >>   doc: follow detachable flag disappearance
>> >>   doc: update detachable flag deprecation notice
>> >>   doc: note ether API change for detachable flag
>>
>> > Acked-by: Thomas Monjalon <thomas@monjalon.net>
>>
>> Series applied to dpdk-next-net/master, thanks.
>>
>> (doc patches squashed into patch 2/6)
>>
>
>

^ permalink raw reply	[flat|nested] 27+ messages in thread

* Re: [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE
  2017-10-31 11:09         ` Alejandro Lucero
@ 2017-10-31 17:24           ` Ferruh Yigit
  0 siblings, 0 replies; 27+ messages in thread
From: Ferruh Yigit @ 2017-10-31 17:24 UTC (permalink / raw)
  To: Alejandro Lucero; +Cc: Thomas Monjalon, Gaetan Rivet, dev

On 10/31/2017 4:09 AM, Alejandro Lucero wrote:
> I'm afraid the patch introduced a problem for the NFP PMD. 
> 
> I have submitted a patch fixing it: "net/nfp: avoid unplug if multiport"

Hi Alejandro,

Sorry for this short notice, and thank you for the fix.

> 
> Thanks
> 
> On Mon, Oct 30, 2017 at 9:45 AM, Alejandro Lucero
> <alejandro.lucero@netronome.com <mailto:alejandro.lucero@netronome.com>> wrote:
> 
>     Hi guys,
> 
>     i have been on PTO since the 19th of October.
> 
>     I will test this patch asap, but I'm aware this has already been accepted.
> 
>     On Wed, Oct 25, 2017 at 6:37 PM, Ferruh Yigit <ferruh.yigit@intel.com
>     <mailto:ferruh.yigit@intel.com>> wrote:
> 
>         On 10/24/2017 5:35 AM, Thomas Monjalon wrote:
>         > 24/10/2017 12:35, Gaetan Rivet:
>         >> Gaetan Rivet (6):
>         >>   ethdev: do not rely on detachable flag in detach
>         >>   ethdev: remove detachable device flag
>         >>   pci: propagate PMD removal error value for unplug
>         >>   doc: follow detachable flag disappearance
>         >>   doc: update detachable flag deprecation notice
>         >>   doc: note ether API change for detachable flag
> 
>         > Acked-by: Thomas Monjalon <thomas@monjalon.net
>         <mailto:thomas@monjalon.net>>
> 
>         Series applied to dpdk-next-net/master, thanks.
> 
>         (doc patches squashed into patch 2/6)
> 
> 
> 

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2017-10-31 17:24 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-24  8:59 [dpdk-dev] [PATCH v1 0/3] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 1/3] ethdev: remove detachable device flag Gaetan Rivet
2017-10-24  9:13   ` Andrew Rybchenko
2017-10-24  9:23   ` Thomas Monjalon
2017-10-24  9:27     ` Gaëtan Rivet
2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 2/3] doc: follow detachable flag disappearance Gaetan Rivet
2017-10-25  8:55   ` Mcnamara, John
2017-10-25  8:56   ` Mcnamara, John
2017-10-24  8:59 ` [dpdk-dev] [PATCH v1 3/3] pci: propagate PMD removal error value for unplug Gaetan Rivet
2017-10-24 10:35 ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Gaetan Rivet
2017-10-24 10:35   ` [dpdk-dev] [PATCH v2 1/6] ethdev: do not rely on detachable flag in detach Gaetan Rivet
2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 2/6] ethdev: remove detachable device flag Gaetan Rivet
2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 3/6] pci: propagate PMD removal error value for unplug Gaetan Rivet
2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 4/6] doc: follow detachable flag disappearance Gaetan Rivet
2017-10-25  8:57       ` Mcnamara, John
2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 5/6] doc: update detachable flag deprecation notice Gaetan Rivet
2017-10-25  9:03       ` Mcnamara, John
2017-10-24 10:35     ` [dpdk-dev] [PATCH v2 6/6] doc: note ether API change for detachable flag Gaetan Rivet
2017-10-25  8:58       ` Mcnamara, John
2017-10-25  9:01       ` Mcnamara, John
2017-10-24 12:35   ` [dpdk-dev] [PATCH v2 0/6] Remove RTE_ETH_DEV_DETACHABLE Thomas Monjalon
2017-10-25 17:37     ` Ferruh Yigit
2017-10-30  9:45       ` Alejandro Lucero
2017-10-31 11:09         ` Alejandro Lucero
2017-10-31 17:24           ` Ferruh Yigit
2017-10-24 23:56   ` Ferruh Yigit
2017-10-25 16:11     ` Ferruh Yigit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).