From patchwork Mon Dec 25 14:31:02 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Matteo Croce
X-Patchwork-Id: 852820
Return-Path:
X-Original-To: incoming@patchwork.ozlabs.org
Delivered-To: patchwork-incoming@bilbo.ozlabs.org
Authentication-Results: ozlabs.org;
spf=pass (mailfrom) smtp.mailfrom=openvswitch.org
(client-ip=140.211.169.12; helo=mail.linuxfoundation.org;
envelope-from=ovs-dev-bounces@openvswitch.org;
receiver=)
Received: from mail.linuxfoundation.org (mail.linuxfoundation.org
[140.211.169.12])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256
bits)) (No client certificate requested)
by ozlabs.org (Postfix) with ESMTPS id 3z51kl3bZ2z9ryr
for ;
Tue, 26 Dec 2017 01:31:11 +1100 (AEDT)
Received: from mail.linux-foundation.org (localhost [127.0.0.1])
by mail.linuxfoundation.org (Postfix) with ESMTP id 4EFC589E;
Mon, 25 Dec 2017 14:31:08 +0000 (UTC)
X-Original-To: dev@openvswitch.org
Delivered-To: ovs-dev@mail.linuxfoundation.org
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
[172.17.192.35])
by mail.linuxfoundation.org (Postfix) with ESMTPS id 69D914A5
for ; Mon, 25 Dec 2017 14:31:06 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-wm0-f41.google.com (mail-wm0-f41.google.com
[74.125.82.41])
by smtp1.linuxfoundation.org (Postfix) with ESMTPS id C3E06D9
for ; Mon, 25 Dec 2017 14:31:05 +0000 (UTC)
Received: by mail-wm0-f41.google.com with SMTP id 9so32004964wme.4
for ; Mon, 25 Dec 2017 06:31:05 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20161025;
h=x-gm-message-state:from:to:subject:date:message-id;
bh=a6FtHFetl3YXbfOd+e4VSu6uAI6QhfneKU5fciiCjhA=;
b=tuP8kIAPE8mLSubQQtWdadvFwajkQUtJyKfs7Eq96DDxBcJOjjfbTHMaDAfvBIslSG
UVNrcqNMJRt72kWV55UgspZL79UxXcrDh+ELpQFnj4RyNoGubKYGqARj9mBm1X4HNcgz
E4qUXirNYs0jitunZ13wNe8bd7C0Pov2/NLOW6R9sUIpzZlvUtyHa4sjvhSCeKY7y3eB
dML8SHWaFjDF84r0ZfKY9UfXHwMp/BqbeGti10YTcUdn7+hwQ+/XDLr6uwFdTUpfEQry
2eEpeexHnVIupT0BTmkF6v1Rgmgj9MlgA0/FXH6j5avxp5bnkr/sU/yaT66ssAnuHMvI
k8Dw==
X-Gm-Message-State: AKGB3mKCRz2FZaWoJpDxEKuyDx2e96FQ/W68BZqATjW6kYDHC/lY0SJY
dVN3egJLjhkCVC/w9BkuB8HzjPNPAJU=
X-Google-Smtp-Source:
ACJfBov/leMHrYV/EMrtbY4KywUqHH7I8xM+UbOAoqmkBIa62l+b3n3TZhlsys9lWhJ2NRdstfEk/Q==
X-Received: by 10.28.249.1 with SMTP id x1mr20812549wmh.138.1514212264118;
Mon, 25 Dec 2017 06:31:04 -0800 (PST)
Received: from mcroce.redhat.com
(host12-202-dynamic.60-82-r.retail.telecomitalia.it. [82.60.202.12])
by smtp.gmail.com with ESMTPSA id
f42sm20049778wrf.46.2017.12.25.06.31.03 for
(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
Mon, 25 Dec 2017 06:31:03 -0800 (PST)
From: Matteo Croce
To: dev@openvswitch.org
Date: Mon, 25 Dec 2017 15:31:02 +0100
Message-Id: <20171225143102.24335-1-mcroce@redhat.com>
X-Mailer: git-send-email 2.14.3
X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE
autolearn=ham version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
smtp1.linux-foundation.org
Subject: [ovs-dev] [PATCH v3] ovs-vsctl: show DPDK version
X-BeenThere: ovs-dev@openvswitch.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
MIME-Version: 1.0
Sender: ovs-dev-bounces@openvswitch.org
Errors-To: ovs-dev-bounces@openvswitch.org
Show DPDK version if Open vSwitch is compiled with DPDK support.
Add a `dpdk_version` column in the datamodel, change ovs-ctl and ovs-dev.py
to populate the field with the right value.
Signed-off-by: Matteo Croce
---
utilities/ovs-ctl.in | 9 ++++++++-
utilities/ovs-dev.py | 7 +++++++
vswitchd/ovs-vswitchd.c | 7 +++++++
vswitchd/vswitch.ovsschema | 7 +++++--
vswitchd/vswitch.xml | 4 ++++
5 files changed, 31 insertions(+), 3 deletions(-)
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index f1b01d1d3..1e334de2b 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -76,9 +76,16 @@ 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"
+ DPDK_VERSION=`ovs-vswitchd --version |awk '/^DPDK/{print$2}'`
+ if [ -n "$DPDK_VERSION" ]; then
+ set "$@" dpdk-version="$DPDK_VERSION"
+ else
+ ovs_vsctl clear Open_vSwitch . dpdk_version
+ fi
+
case $SYSTEM_ID in
random)
id_file=$etcdir/system-id.conf
diff --git a/utilities/ovs-dev.py b/utilities/ovs-dev.py
index 9ce0f04c7..70170e21d 100755
--- a/utilities/ovs-dev.py
+++ b/utilities/ovs-dev.py
@@ -284,9 +284,16 @@ def run():
"other_config:dpdk-init=true" % root_uuid)
_sh("ovs-vsctl --no-wait set Open_vSwitch %s other_config:"
"dpdk-extra=\"%s\"" % (root_uuid, ' '.join(options.dpdk)))
+ dpdk_version = _sh("ovs-vswitchd --version", capture=True)
+ dpdk_version = [s for s in dpdk_version if "DPDK" in s]
+ if dpdk_version:
+ dpdk_version = dpdk_version[0].decode().strip().split()[1]
+ _sh("ovs-vsctl --no-wait set Open_vSwitch %s dpdk_version=%s"
+ % (root_uuid, dpdk_version))
else:
_sh("ovs-vsctl --no-wait set Open_vSwitch %s "
"other_config:dpdk-init=false" % root_uuid)
+ _sh("ovs-vsctl --no-wait clear Open_vSwitch %s dpdk_version" % root_uuid)
if options.gdb:
cmd = ["gdb", "--args"] + cmd
diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c
index d5e07c037..e033a7d1f 100644
--- a/vswitchd/ovs-vswitchd.c
+++ b/vswitchd/ovs-vswitchd.c
@@ -25,6 +25,10 @@
#include
#endif
+#ifdef DPDK_NETDEV
+#include
+#endif
+
#include "bridge.h"
#include "command-line.h"
#include "compiler.h"
@@ -187,6 +191,9 @@ parse_options(int argc, char *argv[], char **unixctl_pathp)
case 'V':
ovs_print_version(0, 0);
+#ifdef DPDK_NETDEV
+ puts(rte_version());
+#endif
exit(EXIT_SUCCESS);
case OPT_MLOCKALL:
diff --git a/vswitchd/vswitch.ovsschema b/vswitchd/vswitch.ovsschema
index 90e50b626..7015a2687 100644
--- a/vswitchd/vswitch.ovsschema
+++ b/vswitchd/vswitch.ovsschema
@@ -1,6 +1,6 @@
{"name": "Open_vSwitch",
- "version": "7.15.1",
- "cksum": "3682332033 23608",
+ "version": "7.16.0",
+ "cksum": "654116098 23718",
"tables": {
"Open_vSwitch": {
"columns": {
@@ -36,6 +36,9 @@
"db_version": {
"type": {"key": {"type": "string"},
"min": 0, "max": 1}},
+ "dpdk_version": {
+ "type": {"key": {"type": "string"},
+ "min": 0, "max": 1}},
"system_type": {
"type": {"key": {"type": "string"},
"min": 0, "max": 1}},
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index 37d04b7cf..74890f72b 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -611,6 +611,10 @@
+
+ DPDK version number, e.g. 17.11
.
+
+
An identifier for the type of system on top of which Open vSwitch