aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Foggoa (tfoggoa) <tfoggoa@cisco.com>2016-03-17 16:54:30 -0400
committerDave Barach <openvpp@barachs.net>2016-04-25 13:25:22 +0000
commita30d40d33c308c254414835e116db1d72c204b50 (patch)
treedb2c53231f957d70258101f942ccbd93ecf3e960
parent2acdb58d92291297b3f30a797a7054f0136f50ef (diff)
Add APIs to access dpdk information
- Add an API to get the number of DPDK mbufs - Add an API to detemrine if the io thread has been released - Add an API to get the DPKD pmd type - Add an API to get the cpu socket of a device Change-Id: I926401891fb6053c676125c9d0621cc9ed1f80bb Signed-off-by: Todd Foggoa (tfoggoa) <tfoggoa@cisco.com>
-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);