summaryrefslogtreecommitdiffstats
path: root/vnet
diff options
context:
space:
mode:
Diffstat (limited to 'vnet')
-rw-r--r--vnet/vnet/devices/dpdk/device.c54
-rw-r--r--vnet/vnet/devices/dpdk/dpdk.h8
2 files changed, 62 insertions, 0 deletions
diff --git a/vnet/vnet/devices/dpdk/device.c b/vnet/vnet/devices/dpdk/device.c
index 9b742f0eef0..011ec75e18b 100644
--- a/vnet/vnet/devices/dpdk/device.c
+++ b/vnet/vnet/devices/dpdk/device.c
@@ -1259,3 +1259,57 @@ dpdk_get_hw_interface_stats (u32 hw_if_index, struct rte_eth_stats* dest)
clib_memcpy(dest, &xd->stats, sizeof(xd->stats));
return (0);
}
+
+/*
+ * Return the number of dpdk mbufs
+ */
+u32 dpdk_num_mbufs (void)
+{
+ dpdk_main_t * dm = &dpdk_main;
+
+ return dm->num_mbufs;
+}
+
+/*
+ * Return the io_thread_release
+ */
+int dpdk_io_thread_release (void)
+{
+ dpdk_main_t * dm = &dpdk_main;
+
+ return dm->io_thread_release;
+}
+
+/*
+ * Return the pmd type for a given hardware interface
+ */
+dpdk_pmd_t dpdk_get_pmd_type (vnet_hw_interface_t *hi)
+{
+ dpdk_main_t * dm = &dpdk_main;
+ dpdk_device_t * xd;
+
+ assert (hi);
+
+ xd = vec_elt_at_index (dm->devices, hi->dev_instance);
+
+ assert (xd);
+
+ return xd->pmd;
+}
+
+/*
+ * Return the cpu socket for a given hardware interface
+ */
+i8 dpdk_get_cpu_socket (vnet_hw_interface_t *hi)
+{
+ dpdk_main_t * dm = &dpdk_main;
+ dpdk_device_t * xd;
+
+ assert (hi);
+
+ xd = vec_elt_at_index(dm->devices, hi->dev_instance);
+
+ assert (xd);
+
+ return xd->cpu_socket;
+}
diff --git a/vnet/vnet/devices/dpdk/dpdk.h b/vnet/vnet/devices/dpdk/dpdk.h
index af12d5292fd..3761a7f71a2 100644
--- a/vnet/vnet/devices/dpdk/dpdk.h
+++ b/vnet/vnet/devices/dpdk/dpdk.h
@@ -565,6 +565,14 @@ int dpdk_vhost_user_dump_ifs (vnet_main_t * vnm, vlib_main_t * vm,
u32 dpdk_get_admin_up_down_in_progress (void);
+u32 dpdk_num_mbufs (void);
+
+int dpdk_io_thread_release (void);
+
+dpdk_pmd_t dpdk_get_pmd_type (vnet_hw_interface_t *hi);
+
+i8 dpdk_get_cpu_socket (vnet_hw_interface_t *hi);
+
uword
dpdk_input_rss (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * f);