| 633 | } |
| 634 | |
| 635 | int |
| 636 | rte_eth_dev_socket_id(uint16_t port_id) |
| 637 | { |
| 638 | int socket_id = SOCKET_ID_ANY; |
| 639 | struct rte_eth_dev *ethdev; |
| 640 | |
| 641 | if (port_id >= RTE_MAX_ETHPORTS) { |
| 642 | rte_errno = EINVAL; |
| 643 | return socket_id; |
| 644 | } |
| 645 | |
| 646 | ethdev = &rte_eth_devices[port_id]; |
| 647 | if (!eth_dev_is_allocated(ethdev)) { |
| 648 | rte_errno = EINVAL; |
| 649 | } else { |
| 650 | socket_id = rte_eth_devices[port_id].data->numa_node; |
| 651 | if (socket_id == SOCKET_ID_ANY) |
| 652 | rte_errno = 0; |
| 653 | } |
| 654 | |
| 655 | rte_ethdev_trace_socket_id(port_id, socket_id); |
| 656 | |
| 657 | return socket_id; |
| 658 | } |
| 659 | |
| 660 | void * |
| 661 | rte_eth_dev_get_sec_ctx(uint16_t port_id) |