mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
netdev: Add function for getting the numa node id of netdev.
This commit adds a new API to the 'struct netdev_class' which allows user to query the numa node id the 'netdev' is on. Currently, only netdev-dpdk module implements this function. Signed-off-by: Alex Wang <alexw@nicira.com> Acked-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
@@ -581,6 +581,14 @@ netdev_dpdk_get_config(const struct netdev *netdev_, struct smap *args)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
netdev_dpdk_get_numa_id(const struct netdev *netdev_)
|
||||
{
|
||||
struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_);
|
||||
|
||||
return netdev->socket_id;
|
||||
}
|
||||
|
||||
static struct netdev_rxq *
|
||||
netdev_dpdk_rxq_alloc(void)
|
||||
{
|
||||
@@ -1345,6 +1353,7 @@ unlock_dpdk:
|
||||
netdev_dpdk_get_config, \
|
||||
NULL, /* netdev_dpdk_set_config */ \
|
||||
NULL, /* get_tunnel_config */ \
|
||||
netdev_dpdk_get_numa_id, /* get_numa_id */ \
|
||||
\
|
||||
netdev_dpdk_send, /* send */ \
|
||||
NULL, /* send_wait */ \
|
||||
|
Reference in New Issue
Block a user