From patchwork Sun Dec 24 13:58:37 2017
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Matteo Croce
X-Patchwork-Id: 852735
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 3z4P3r0yXcz9s7n
for ;
Mon, 25 Dec 2017 00:58:47 +1100 (AEDT)
Received: from mail.linux-foundation.org (localhost [127.0.0.1])
by mail.linuxfoundation.org (Postfix) with ESMTP id 77E92891;
Sun, 24 Dec 2017 13:58:43 +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 5CC87710
for ; Sun, 24 Dec 2017 13:58:42 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com
[209.85.128.194])
by smtp1.linuxfoundation.org (Postfix) with ESMTPS id BDE89403
for ; Sun, 24 Dec 2017 13:58:41 +0000 (UTC)
Received: by mail-wr0-f194.google.com with SMTP id f8so20734907wre.4
for ; Sun, 24 Dec 2017 05:58:41 -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=0oIPj1lYJszr9k7ns/wl4aTCl/BzL2xzqaqRc5hABfQ=;
b=XoytxllWm/IVwaJIirHaY0ojZ3ZcEO5WK9e35B4n5A9KJN/xztogiNJaXx1zIhrcE6
l2vYN4jTz2WXwandYpZElOsLfJUcqRtTrnKZXCMqaAcM/P773wQaScmXKNjkSGJj5dVQ
H1IFft0J1eA9et38gjQ7U1MnkkNOsYz2neuz7D5jstmH18Zpy8O0bp/ZA9ag6l6+lKi1
goCNFCwAPV3K9dqujDl4SrSbi91zXAWN7xbZRFviv07coLscEaL2qRsGX3PV6nyPmsS2
uqBXbQ9B24YFAB8zRk15ddGsu9JjMPw6BslVuSWkLDpnIkQw9z8qYTV0tromuatn1hGi
ZHDg==
X-Gm-Message-State: AKGB3mIvSULDqb/OCR181B/KXPdbaaZPFvQzuG0KhOzwGjVPpPZbNtFR
/boxlBrCOj0D8LyYd9AyBr5+XYab3eY=
X-Google-Smtp-Source:
ACJfBouYsqRFga5RehBV6V6DN2YyENfk8J3BYEVpayz9nLLD6vvRD21ynp008JHOghrgNg2eqxz7FQ==
X-Received: by 10.223.196.147 with SMTP id m19mr20234779wrf.7.1514123920028;
Sun, 24 Dec 2017 05:58:40 -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
z20sm3304832wrz.66.2017.12.24.05.58.38 for
(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
Sun, 24 Dec 2017 05:58:39 -0800 (PST)
From: Matteo Croce
To: dev@openvswitch.org
Date: Sun, 24 Dec 2017 14:58:37 +0100
Message-Id: <20171224135837.6111-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 v2] 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
---
v2: edit ovs-ctl as well
utilities/ovs-ctl.in | 7 +++++++
utilities/ovs-dev.py | 15 ++++++++++++---
utilities/ovs-vsctl.c | 7 +++++++
vswitchd/vswitch.ovsschema | 7 +++++--
vswitchd/vswitch.xml | 4 ++++
5 files changed, 35 insertions(+), 5 deletions(-)
diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in
index f1b01d1d3..3ce8e1849 100755
--- a/utilities/ovs-ctl.in
+++ b/utilities/ovs-ctl.in
@@ -79,6 +79,13 @@ set_system_ids () {
OVS_VERSION=`ovs-vswitchd --version | sed 's/.*) //;1q'`
set "$@" ovs-version="$OVS_VERSION"
+ DPDK_VERSION=`ovs-vsctl --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..1bc0ba8c7 100755
--- a/utilities/ovs-dev.py
+++ b/utilities/ovs-dev.py
@@ -270,11 +270,20 @@ def run():
" %s/ovsclient-cert.pem %s/vswitchd.cacert"
% (pki_dir, pki_dir, pki_dir))
version = _sh("ovs-vsctl --no-wait --version", capture=True)
- version = version[0].decode().strip().split()[3]
root_uuid = _sh("ovs-vsctl --no-wait --bare list Open_vSwitch",
capture=True)[0].decode().strip()
- _sh("ovs-vsctl --no-wait set Open_vSwitch %s ovs_version=%s"
- % (root_uuid, version))
+
+ ovs_version = [s for s in version if "Open vSwitch" in s]
+ if ovs_version:
+ ovs_version = ovs_version[0].decode().strip().split()[3]
+ _sh("ovs-vsctl --no-wait set Open_vSwitch %s ovs_version=%s"
+ % (root_uuid, ovs_version))
+
+ dpdk_version = [s for s in 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))
build = BUILD_CLANG if options.clang else BUILD_GCC
cmd = [build + "/vswitchd/ovs-vswitchd"]
diff --git a/utilities/ovs-vsctl.c b/utilities/ovs-vsctl.c
index 7b909431d..f830120ad 100644
--- a/utilities/ovs-vsctl.c
+++ b/utilities/ovs-vsctl.c
@@ -27,6 +27,10 @@
#include
#include
+#ifdef DPDK_NETDEV
+#include
+#endif
+
#include "db-ctl-base.h"
#include "command-line.h"
@@ -304,6 +308,9 @@ parse_options(int argc, char *argv[], struct shash *local_options)
case 'V':
ovs_print_version(0, 0);
printf("DB Schema %s\n", ovsrec_get_db_version());
+#ifdef DPDK_NETDEV
+ printf("%s\n", rte_version());
+#endif
exit(EXIT_SUCCESS);
case 't':
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