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

Function rte_vhost_get_numa_node

dpdk/lib/vhost/vhost.c:881–905  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

879}
880
881int
882rte_vhost_get_numa_node(int vid)
883{
884#ifdef RTE_LIBRTE_VHOST_NUMA
885 struct virtio_net *dev = get_device(vid);
886 int numa_node;
887 int ret;
888
889 if (dev == NULL || numa_available() != 0)
890 return -1;
891
892 ret = get_mempolicy(&numa_node, NULL, 0, dev,
893 MPOL_F_NODE | MPOL_F_ADDR);
894 if (ret < 0) {
895 VHOST_LOG_CONFIG(dev->ifname, ERR, "failed to query numa node: %s\n",
896 rte_strerror(errno));
897 return -1;
898 }
899
900 return numa_node;
901#else
902 RTE_SET_USED(vid);
903 return -1;
904#endif
905}
906
907uint16_t
908rte_vhost_get_vring_num(int vid)

Callers 1

new_deviceFunction · 0.85

Calls 2

get_deviceFunction · 0.85
rte_strerrorFunction · 0.85

Tested by

no test coverage detected