MCPcopy Create free account
hub / github.com/F-Stack/f-stack / rte_eth_vdev_allocate

Function rte_eth_vdev_allocate

dpdk/lib/ethdev/ethdev_vdev.h:32–57  ·  view source on GitHub ↗

* @internal * Allocates a new ethdev slot for an Ethernet device and returns the pointer * to that slot for the driver to use. * * @param dev * Pointer to virtual device * * @param private_data_size * Size of private data structure * * @return * A pointer to a rte_eth_dev or NULL if allocation failed. */

Source from the content-addressed store, hash-verified

30 * A pointer to a rte_eth_dev or NULL if allocation failed.
31 */
32static inline struct rte_eth_dev *
33rte_eth_vdev_allocate(struct rte_vdev_device *dev, size_t private_data_size)
34{
35 struct rte_eth_dev *eth_dev;
36 const char *name = rte_vdev_device_name(dev);
37
38 eth_dev = rte_eth_dev_allocate(name);
39 if (!eth_dev)
40 return NULL;
41
42 if (private_data_size) {
43 eth_dev->data->dev_private = rte_zmalloc_socket(name,
44 private_data_size, RTE_CACHE_LINE_SIZE,
45 dev->device.numa_node);
46 if (!eth_dev->data->dev_private) {
47 rte_eth_dev_release_port(eth_dev);
48 return NULL;
49 }
50 }
51
52 eth_dev->device = &dev->device;
53 eth_dev->intr_handle = NULL;
54
55 eth_dev->data->numa_node = dev->device.numa_node;
56 return eth_dev;
57}
58
59#ifdef __cplusplus
60}

Callers 12

memif_createFunction · 0.85
eth_dev_null_createFunction · 0.85
pfe_eth_initFunction · 0.85
pmd_enetfec_probeFunction · 0.85
init_internalsFunction · 0.85
rte_pmd_init_internalsFunction · 0.85
pmd_init_internalsFunction · 0.85
bond_allocFunction · 0.85
fs_eth_dev_createFunction · 0.85
eth_dev_vhost_createFunction · 0.85
eth_dev_tap_createFunction · 0.85

Calls 4

rte_vdev_device_nameFunction · 0.85
rte_eth_dev_allocateFunction · 0.85
rte_zmalloc_socketFunction · 0.85
rte_eth_dev_release_portFunction · 0.85

Tested by

no test coverage detected