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

Function rte_eth_dev_owner_new

dpdk/lib/ethdev/rte_ethdev.c:444–469  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

442}
443
444int
445rte_eth_dev_owner_new(uint64_t *owner_id)
446{
447 int ret;
448
449 if (owner_id == NULL) {
450 RTE_ETHDEV_LOG(ERR, "Cannot get new owner ID to NULL\n");
451 return -EINVAL;
452 }
453
454 rte_spinlock_lock(rte_mcfg_ethdev_get_lock());
455
456 if (eth_dev_shared_data_prepare() != NULL) {
457 *owner_id = eth_dev_shared_data->next_owner_id++;
458 eth_dev_shared_data->allocated_owners++;
459 ret = 0;
460 } else {
461 ret = -ENOMEM;
462 }
463
464 rte_spinlock_unlock(rte_mcfg_ethdev_get_lock());
465
466 rte_ethdev_trace_owner_new(*owner_id, ret);
467
468 return ret;
469}
470
471static int
472eth_dev_owner_set(const uint16_t port_id, const uint64_t old_owner_id,

Callers 2

fs_eth_dev_createFunction · 0.85
eth_hn_dev_initFunction · 0.85

Calls 4

rte_mcfg_ethdev_get_lockFunction · 0.85
rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected