ethdev: release port
This patch adds rte_eth_dev_release_port(). The function is used for changing an attached status of the device that has specified name. Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
This commit is contained in:
parent
c282abd2a6
commit
36ec8585b2
@ -255,6 +255,17 @@ rte_eth_dev_allocate(const char *name)
|
|||||||
return eth_dev;
|
return eth_dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
|
||||||
|
{
|
||||||
|
if (eth_dev == NULL)
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
|
eth_dev->attached = 0;
|
||||||
|
nb_ports--;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
rte_eth_dev_init(struct rte_pci_driver *pci_drv,
|
rte_eth_dev_init(struct rte_pci_driver *pci_drv,
|
||||||
struct rte_pci_device *pci_dev)
|
struct rte_pci_device *pci_dev)
|
||||||
|
@ -1539,6 +1539,18 @@ extern uint8_t rte_eth_dev_count(void);
|
|||||||
*/
|
*/
|
||||||
struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
|
struct rte_eth_dev *rte_eth_dev_allocate(const char *name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function for internal use by dummy drivers primarily, e.g. ring-based
|
||||||
|
* driver.
|
||||||
|
* Release the specified ethdev port.
|
||||||
|
*
|
||||||
|
* @param eth_dev
|
||||||
|
* The *eth_dev* pointer is the address of the *rte_eth_dev* structure.
|
||||||
|
* @return
|
||||||
|
* - 0 on success, negative on error
|
||||||
|
*/
|
||||||
|
int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
|
||||||
|
|
||||||
struct eth_driver;
|
struct eth_driver;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
Loading…
x
Reference in New Issue
Block a user