]> git.proxmox.com Git - ovs.git/commitdiff
vswitchd: show DPDK version
authorMatteo Croce <mcroce@redhat.com>
Mon, 15 Jan 2018 18:21:12 +0000 (19:21 +0100)
committerIan Stokes <ian.stokes@intel.com>
Fri, 26 Jan 2018 20:40:52 +0000 (20:40 +0000)
Show DPDK version if Open vSwitch is compiled with DPDK support.
Version can be retrieved with `ovs-vswitchd --version` or from OVS logs.
Small change in ovs-ctl to avoid breakage on output change.

Signed-off-by: Matteo Croce <mcroce@redhat.com>
Acked-by: Kevin Traynor <ktraynor@redhat.com>
Signed-off-by: Ian Stokes <ian.stokes@intel.com>
lib/dpdk-stub.c
lib/dpdk.c
lib/dpdk.h
utilities/ovs-ctl.in
vswitchd/ovs-vswitchd.c

index 36021807c3912b08486f4aa68198840ebc3add97..041cd0cbbff96a0f9f714d0d3a487b8b51ba018c 100644 (file)
@@ -54,3 +54,8 @@ dpdk_vhost_iommu_enabled(void)
 {
     return false;
 }
+
+void
+print_dpdk_version(void)
+{
+}
index 6710d10fcb4a2d9b85bb2c9a1c4c1cbb9d32a583..3f5a55fc14b411c2f4e0ee9fd316260ac6e1135a 100644 (file)
@@ -24,6 +24,7 @@
 
 #include <rte_log.h>
 #include <rte_memzone.h>
+#include <rte_version.h>
 #ifdef DPDK_PDUMP
 #include <rte_mempool.h>
 #include <rte_pdump.h>
@@ -471,6 +472,7 @@ dpdk_init(const struct smap *ovs_other_config)
         static struct ovsthread_once once_enable = OVSTHREAD_ONCE_INITIALIZER;
 
         if (ovsthread_once_start(&once_enable)) {
+            VLOG_INFO("Using %s", rte_version());
             VLOG_INFO("DPDK Enabled - initializing...");
             dpdk_init__(ovs_other_config);
             enabled = true;
@@ -501,3 +503,9 @@ dpdk_set_lcore_id(unsigned cpu)
     ovs_assert(cpu != NON_PMD_CORE_ID);
     RTE_PER_LCORE(_lcore_id) = cpu;
 }
+
+void
+print_dpdk_version(void)
+{
+    puts(rte_version());
+}
index dc58d968afdf94254fcd502979ead5f5fead0581..b04153591548187bf66631ddaa3f9da586da49bb 100644 (file)
@@ -38,5 +38,6 @@ void dpdk_init(const struct smap *ovs_other_config);
 void dpdk_set_lcore_id(unsigned cpu);
 const char *dpdk_get_vhost_sock_dir(void);
 bool dpdk_vhost_iommu_enabled(void);
+void print_dpdk_version(void);
 
 #endif /* dpdk.h */
index 1df56c4a530f377435d9f5f4138bcc61ae9fb3ee..ef06dd967e1e2aad6ef90622f07a8a571aeab7a1 100755 (executable)
@@ -72,7 +72,7 @@ set_hostname () {
 set_system_ids () {
     set ovs_vsctl set Open_vSwitch .
 
-    OVS_VERSION=`ovs-vswitchd --version | sed 's/.*) //;1q'`
+    OVS_VERSION=`ovs-vswitchd --version | awk '/Open vSwitch/{print $NF}'`
     set "$@" ovs-version="$OVS_VERSION"
 
     case $SYSTEM_ID in
index d5e07c0376cdbecae48bc8565f91684b71a54b10..a5e8f4d399adeb6faecddf69d343d0af0c6bd505 100644 (file)
@@ -187,6 +187,7 @@ parse_options(int argc, char *argv[], char **unixctl_pathp)
 
         case 'V':
             ovs_print_version(0, 0);
+            print_dpdk_version();
             exit(EXIT_SUCCESS);
 
         case OPT_MLOCKALL: