| 442 | } |
| 443 | |
| 444 | int |
| 445 | rte_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 | |
| 471 | static int |
| 472 | eth_dev_owner_set(const uint16_t port_id, const uint64_t old_owner_id, |
no test coverage detected