ethdev: remove ethdev PCI probe/remove
This removes the now unused rte_eth_dev_pci_probe() and rte_eth_dev_pci_remove() functions. Signed-off-by: Jan Blunck <jblunck@infradead.org> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
fdf91e0f2f
commit
26e30bfce2
@ -284,103 +284,6 @@ rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
|
||||||
rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
|
|
||||||
struct rte_pci_device *pci_dev)
|
|
||||||
{
|
|
||||||
struct eth_driver *eth_drv;
|
|
||||||
struct rte_eth_dev *eth_dev;
|
|
||||||
char ethdev_name[RTE_ETH_NAME_MAX_LEN];
|
|
||||||
|
|
||||||
int diag;
|
|
||||||
|
|
||||||
eth_drv = (struct eth_driver *)pci_drv;
|
|
||||||
|
|
||||||
rte_eal_pci_device_name(&pci_dev->addr, ethdev_name,
|
|
||||||
sizeof(ethdev_name));
|
|
||||||
|
|
||||||
if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
|
|
||||||
eth_dev = rte_eth_dev_allocate(ethdev_name);
|
|
||||||
if (eth_dev == NULL)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
eth_dev->data->dev_private = rte_zmalloc("ethdev private structure",
|
|
||||||
eth_drv->dev_private_size,
|
|
||||||
RTE_CACHE_LINE_SIZE);
|
|
||||||
if (eth_dev->data->dev_private == NULL)
|
|
||||||
rte_panic("Cannot allocate memzone for private port data\n");
|
|
||||||
} else {
|
|
||||||
eth_dev = rte_eth_dev_attach_secondary(ethdev_name);
|
|
||||||
if (eth_dev == NULL) {
|
|
||||||
/*
|
|
||||||
* if we failed to attach a device, it means the
|
|
||||||
* device is skipped in primary process, due to
|
|
||||||
* some errors. If so, we return a positive value,
|
|
||||||
* to let EAL skip it for the secondary process
|
|
||||||
* as well.
|
|
||||||
*/
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
eth_dev->device = &pci_dev->device;
|
|
||||||
eth_dev->intr_handle = &pci_dev->intr_handle;
|
|
||||||
eth_dev->driver = eth_drv;
|
|
||||||
|
|
||||||
/* Invoke PMD device initialization function */
|
|
||||||
diag = (*eth_drv->eth_dev_init)(eth_dev);
|
|
||||||
if (diag == 0)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
RTE_PMD_DEBUG_TRACE("driver %s: eth_dev_init(vendor_id=0x%x device_id=0x%x) failed\n",
|
|
||||||
pci_drv->driver.name,
|
|
||||||
(unsigned) pci_dev->id.vendor_id,
|
|
||||||
(unsigned) pci_dev->id.device_id);
|
|
||||||
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
|
|
||||||
rte_free(eth_dev->data->dev_private);
|
|
||||||
rte_eth_dev_release_port(eth_dev);
|
|
||||||
return diag;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev)
|
|
||||||
{
|
|
||||||
const struct eth_driver *eth_drv;
|
|
||||||
struct rte_eth_dev *eth_dev;
|
|
||||||
char ethdev_name[RTE_ETH_NAME_MAX_LEN];
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
if (pci_dev == NULL)
|
|
||||||
return -EINVAL;
|
|
||||||
|
|
||||||
rte_eal_pci_device_name(&pci_dev->addr, ethdev_name,
|
|
||||||
sizeof(ethdev_name));
|
|
||||||
|
|
||||||
eth_dev = rte_eth_dev_allocated(ethdev_name);
|
|
||||||
if (eth_dev == NULL)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
eth_drv = (const struct eth_driver *)pci_dev->driver;
|
|
||||||
|
|
||||||
/* Invoke PMD device uninit function */
|
|
||||||
if (*eth_drv->eth_dev_uninit) {
|
|
||||||
ret = (*eth_drv->eth_dev_uninit)(eth_dev);
|
|
||||||
if (ret)
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* free ether device */
|
|
||||||
rte_eth_dev_release_port(eth_dev);
|
|
||||||
|
|
||||||
if (rte_eal_process_type() == RTE_PROC_PRIMARY)
|
|
||||||
rte_free(eth_dev->data->dev_private);
|
|
||||||
|
|
||||||
eth_dev->device = NULL;
|
|
||||||
eth_dev->driver = NULL;
|
|
||||||
eth_dev->data = NULL;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
rte_eth_dev_is_valid_port(uint8_t port_id)
|
rte_eth_dev_is_valid_port(uint8_t port_id)
|
||||||
{
|
{
|
||||||
|
@ -4608,21 +4608,6 @@ rte_eth_dev_get_port_by_name(const char *name, uint8_t *port_id);
|
|||||||
int
|
int
|
||||||
rte_eth_dev_get_name_by_port(uint8_t port_id, char *name);
|
rte_eth_dev_get_name_by_port(uint8_t port_id, char *name);
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
* Wrapper for use by pci drivers as a .probe function to attach to a ethdev
|
|
||||||
* interface.
|
|
||||||
*/
|
|
||||||
int rte_eth_dev_pci_probe(struct rte_pci_driver *pci_drv,
|
|
||||||
struct rte_pci_device *pci_dev);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
* Wrapper for use by pci drivers as a .remove function to detach a ethdev
|
|
||||||
* interface.
|
|
||||||
*/
|
|
||||||
int rte_eth_dev_pci_remove(struct rte_pci_device *pci_dev);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -108,6 +108,11 @@ rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)
|
|||||||
|
|
||||||
typedef int (*eth_dev_pci_callback_t)(struct rte_eth_dev *eth_dev);
|
typedef int (*eth_dev_pci_callback_t)(struct rte_eth_dev *eth_dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
* Wrapper for use by pci drivers in a .probe function to attach to a ethdev
|
||||||
|
* interface.
|
||||||
|
*/
|
||||||
static inline int
|
static inline int
|
||||||
rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
|
rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
|
||||||
size_t private_data_size, eth_dev_pci_callback_t dev_init)
|
size_t private_data_size, eth_dev_pci_callback_t dev_init)
|
||||||
@ -127,6 +132,11 @@ rte_eth_dev_pci_generic_probe(struct rte_pci_device *pci_dev,
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
* Wrapper for use by pci drivers in a .remove function to detach a ethdev
|
||||||
|
* interface.
|
||||||
|
*/
|
||||||
static inline int
|
static inline int
|
||||||
rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
|
rte_eth_dev_pci_generic_remove(struct rte_pci_device *pci_dev,
|
||||||
eth_dev_pci_callback_t dev_uninit)
|
eth_dev_pci_callback_t dev_uninit)
|
||||||
|
@ -134,14 +134,6 @@ DPDK_16.07 {
|
|||||||
|
|
||||||
} DPDK_16.04;
|
} DPDK_16.04;
|
||||||
|
|
||||||
DPDK_16.11 {
|
|
||||||
global:
|
|
||||||
|
|
||||||
rte_eth_dev_pci_probe;
|
|
||||||
rte_eth_dev_pci_remove;
|
|
||||||
|
|
||||||
} DPDK_16.07;
|
|
||||||
|
|
||||||
DPDK_17.02 {
|
DPDK_17.02 {
|
||||||
global:
|
global:
|
||||||
|
|
||||||
@ -153,7 +145,7 @@ DPDK_17.02 {
|
|||||||
rte_flow_query;
|
rte_flow_query;
|
||||||
rte_flow_validate;
|
rte_flow_validate;
|
||||||
|
|
||||||
} DPDK_16.11;
|
} DPDK_16.07;
|
||||||
|
|
||||||
DPDK_17.05 {
|
DPDK_17.05 {
|
||||||
global:
|
global:
|
||||||
|
Loading…
Reference in New Issue
Block a user