ethdev: remove assumption that port will not be detached
authorTetsuya Mukawa <mukawa@igel.co.jp>
Wed, 25 Feb 2015 19:32:18 +0000 (04:32 +0900)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 25 Feb 2015 23:08:25 +0000 (00:08 +0100)
commitc282abd2a6cddc37443164eb0a3f34746527bacd
tree06ad40e9812235aec4267fbb57d0d1ec13964cc8
parent0fe11ec592b2bff1efa6653a9a5b073e4c7a73fd
ethdev: remove assumption that port will not be detached

To remove assumption, do like followings.

This patch adds "RTE_PCI_DRV_DETACHABLE" to drv_flags of rte_pci_driver
structure. The flags indicate the driver can detach devices at runtime.
Also, remove assumption that port will not be detached.

To remove the assumption.
- Add 'attached' member to rte_eth_dev structure.
  This member is used for indicating the port is attached, or not.
  DEV_ATTACHED indicates a port is attached.
  DEV_DETACHED indicates a port is detached.
- Add rte_eth_dev_allocate_new_port().
  This function is used for allocating new port.

Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
lib/librte_eal/common/include/rte_pci.h
lib/librte_ether/rte_ethdev.c
lib/librte_ether/rte_ethdev.h