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

Function rte_eth_dev_owner_delete

dpdk/lib/ethdev/rte_ethdev.c:560–595  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560int
561rte_eth_dev_owner_delete(const uint64_t owner_id)
562{
563 uint16_t port_id;
564 int ret = 0;
565
566 rte_spinlock_lock(rte_mcfg_ethdev_get_lock());
567
568 if (eth_dev_shared_data_prepare() == NULL) {
569 ret = -ENOMEM;
570 } else if (eth_is_valid_owner_id(owner_id)) {
571 for (port_id = 0; port_id < RTE_MAX_ETHPORTS; port_id++) {
572 struct rte_eth_dev_data *data =
573 rte_eth_devices[port_id].data;
574 if (data != NULL && data->owner.id == owner_id)
575 memset(&data->owner, 0,
576 sizeof(struct rte_eth_dev_owner));
577 }
578 RTE_ETHDEV_LOG(NOTICE,
579 "All port owners owned by %016"PRIx64" identifier have removed\n",
580 owner_id);
581 eth_dev_shared_data->allocated_owners--;
582 eth_dev_shared_data_release();
583 } else {
584 RTE_ETHDEV_LOG(ERR,
585 "Invalid owner ID=%016"PRIx64"\n",
586 owner_id);
587 ret = -EINVAL;
588 }
589
590 rte_spinlock_unlock(rte_mcfg_ethdev_get_lock());
591
592 rte_ethdev_trace_owner_delete(owner_id, ret);
593
594 return ret;
595}
596
597int
598rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner)

Callers 1

eth_hn_dev_uninitFunction · 0.85

Calls 7

rte_mcfg_ethdev_get_lockFunction · 0.85
eth_is_valid_owner_idFunction · 0.85
memsetFunction · 0.85
rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected