From patchwork Mon Jan 15 18:21:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matteo Croce X-Patchwork-Id: 861024 X-Patchwork-Delegate: ian.stokes@intel.com 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 3zL1rd5Zzfz9sRm for ; Tue, 16 Jan 2018 05:21:20 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id B78F2F1A; Mon, 15 Jan 2018 18:21:17 +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 0A20EEDD for ; Mon, 15 Jan 2018 18:21:16 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com [74.125.82.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 74EFE5BB for ; Mon, 15 Jan 2018 18:21:15 +0000 (UTC) Received: by mail-wm0-f68.google.com with SMTP id 143so3545852wma.5 for ; Mon, 15 Jan 2018 10:21:15 -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:in-reply-to :references; bh=erWUcF8OiDaw+NycvNzKtHp2n2CcFK85LMDc4wE5Hao=; b=ht9WgGJN3BPVILrDvWgsz/gdiY8vGsnyDcJPHE1wtve7OV59/Vg+A/pLiuwrFdVU0A WbZis+EaZctDnZiHUadqp0mIT9r0H6sESn1A7QF/8dnEnVngvCXR6kgjLG2pj5t3mvuP 16T1PXikcGhVBV5jBlD7sI1x2a1LBkRgoQkS4zrHkBlVvQd2sspyUSve7UXWiub6h3gz bNbgtwsw/aZ8V5QPcIESoFdB0Nv0iIORJytYF0Tjk2n5vuBvZoBpRGMT4LR96TMuYPD0 kFcaJQ3Q8w56JFHGk5Z8/3AMh14MZxlefnap93ncZOjO959eESaq9IvBypYxfuH3qSJQ M5Nw== X-Gm-Message-State: AKwxytfBDfEiA7uJLE1I41Vc1TM+fhBy6dEZNlHK1t/hdzWVUlGt/47U hp96+G3s2sr8ztv+jRkuYvQY5t9EuSw= X-Google-Smtp-Source: ACJfBou4S1MKtwj7quJxr8tTl9OhLvrotQBMkbbcO+L86CFFJ3YBkqtrqkwzBLL2T9xLrf8WgCfWLw== X-Received: by 10.28.234.142 with SMTP id g14mr10455225wmi.31.1516040473873; Mon, 15 Jan 2018 10:21:13 -0800 (PST) Received: from mcroce.mxp.redhat.com (nat-pool-mxp-t.redhat.com. [149.6.153.186]) by smtp.gmail.com with ESMTPSA id w195sm576396wmw.46.2018.01.15.10.21.13 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 15 Jan 2018 10:21:13 -0800 (PST) From: Matteo Croce To: dev@openvswitch.org Date: Mon, 15 Jan 2018 19:21:12 +0100 Message-Id: <20180115182112.29725-1-mcroce@redhat.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180115173503.19268-1-mcroce@redhat.com> References: <20180115173503.19268-1-mcroce@redhat.com> 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 v4] vswitchd: 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. Version can be retrieved with `ovs-switchd --version` or from OVS logs. Small change in ovs-ctl to avoid breakage on output change. Signed-off-by: Matteo Croce Acked-by: Kevin Traynor --- v3: print version in OVS logs too don't save the version in the DB use dpdk-stub.c instead of #ifdef v4: fix only patch subject, I left ovs-vsctl from the older v1/v2, sorry lib/dpdk-stub.c | 5 +++++ lib/dpdk.c | 8 ++++++++ lib/dpdk.h | 1 + utilities/ovs-ctl.in | 2 +- vswitchd/ovs-vswitchd.c | 1 + 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lib/dpdk-stub.c b/lib/dpdk-stub.c index 36021807c..041cd0cbb 100644 --- a/lib/dpdk-stub.c +++ b/lib/dpdk-stub.c @@ -54,3 +54,8 @@ dpdk_vhost_iommu_enabled(void) { return false; } + +void +print_dpdk_version(void) +{ +} diff --git a/lib/dpdk.c b/lib/dpdk.c index 6710d10fc..3f5a55fc1 100644 --- a/lib/dpdk.c +++ b/lib/dpdk.c @@ -24,6 +24,7 @@ #include #include +#include #ifdef DPDK_PDUMP #include #include @@ -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()); +} diff --git a/lib/dpdk.h b/lib/dpdk.h index dc58d968a..b04153591 100644 --- a/lib/dpdk.h +++ b/lib/dpdk.h @@ -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 */ diff --git a/utilities/ovs-ctl.in b/utilities/ovs-ctl.in index 1df56c4a5..ef06dd967 100755 --- a/utilities/ovs-ctl.in +++ b/utilities/ovs-ctl.in @@ -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 diff --git a/vswitchd/ovs-vswitchd.c b/vswitchd/ovs-vswitchd.c index d5e07c037..a5e8f4d39 100644 --- a/vswitchd/ovs-vswitchd.c +++ b/vswitchd/ovs-vswitchd.c @@ -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: