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

Function rte_eth_dev_owner_get

dpdk/lib/ethdev/rte_ethdev.c:597–633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

595}
596
597int
598rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)
599{
600 struct rte_eth_dev *ethdev;
601 int ret;
602
603 if (port_id >= RTE_MAX_ETHPORTS)
604 return -ENODEV;
605
606 ethdev = &rte_eth_devices[port_id];
607 if (!eth_dev_is_allocated(ethdev)) {
608 RTE_ETHDEV_LOG(ERR, "Port ID %"PRIu16" is not allocated\n",
609 port_id);
610 return -ENODEV;
611 }
612
613 if (owner == NULL) {
614 RTE_ETHDEV_LOG(ERR, "Cannot get ethdev port %u owner to NULL\n",
615 port_id);
616 return -EINVAL;
617 }
618
619 rte_spinlock_lock(rte_mcfg_ethdev_get_lock());
620
621 if (eth_dev_shared_data_prepare() != NULL) {
622 rte_memcpy(owner, &ethdev->data->owner, sizeof(*owner));
623 ret = 0;
624 } else {
625 ret = -ENOMEM;
626 }
627
628 rte_spinlock_unlock(rte_mcfg_ethdev_get_lock());
629
630 rte_ethdev_trace_owner_get(port_id, owner, ret);
631
632 return ret;
633}
634
635int
636rte_eth_dev_socket_id(uint16_t port_id)

Callers 3

fs_bus_initFunction · 0.85
hn_vf_attachFunction · 0.85
show_portFunction · 0.85

Calls 6

eth_dev_is_allocatedFunction · 0.85
rte_mcfg_ethdev_get_lockFunction · 0.85
rte_spinlock_lockFunction · 0.50
rte_memcpyFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected