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

Function get_socketid_by_vid

dpdk/examples/vhost/main.c:1640–1654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1638}
1639
1640static inline int
1641get_socketid_by_vid(int vid)
1642{
1643 int i;
1644 char ifname[PATH_MAX];
1645 rte_vhost_get_ifname(vid, ifname, sizeof(ifname));
1646
1647 for (i = 0; i < nb_sockets; i++) {
1648 char *file = socket_files + i * PATH_MAX;
1649 if (strcmp(file, ifname) == 0)
1650 return i;
1651 }
1652
1653 return -1;
1654}
1655
1656static int
1657init_vhost_queue_ops(int vid)

Callers 1

new_deviceFunction · 0.85

Calls 2

rte_vhost_get_ifnameFunction · 0.85
strcmpFunction · 0.85

Tested by

no test coverage detected