From patchwork Tue Nov 14 10:59:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Weglicki, MichalX" X-Patchwork-Id: 837802 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 3yblL42hPFz9s3w for ; Tue, 14 Nov 2017 22:15:40 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 6D880BDB; Tue, 14 Nov 2017 11:15:38 +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 4535CBDA for ; Tue, 14 Nov 2017 11:15:37 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 44F31E6 for ; Tue, 14 Nov 2017 11:15:36 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Nov 2017 03:15:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,393,1505804400"; d="scan'208";a="149340946" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga004.jf.intel.com with ESMTP; 14 Nov 2017 03:15:34 -0800 Received: from silpixa00389819.ir.intel.com (silpixa00389819.ir.intel.com [10.237.219.152]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id vAEBFX7G005277; Tue, 14 Nov 2017 11:15:33 GMT From: Michal Weglicki To: dev@openvswitch.org Date: Tue, 14 Nov 2017 10:59:44 +0000 Message-Id: <1510657185-5791-1-git-send-email-michalx.weglicki@intel.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD autolearn=disabled version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH v6 1/2] netdev-dpdk: extend netdev_dpdk_get_status to include if_type and if_descr 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 This commit extends netdev_dpdk_get_status API to include additional driver-related information: if_type and if_descr. v2->v3: Code rebase. v3->v4: Minor comments applied. v5->v6: Adds DPDK port specific description in documentation. Co-authored-by: Michal Weglicki Signed-off-by: Michal Weglicki Signed-off-by: Przemyslaw Szczerbik --- lib/netdev-dpdk.c | 9 ++++++++ vswitchd/vswitch.xml | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c index 76e79be..3560bdd 100644 --- a/lib/netdev-dpdk.c +++ b/lib/netdev-dpdk.c @@ -36,6 +36,7 @@ #include #include #include +#include #include "dirs.h" #include "dp-packet.h" @@ -2509,6 +2510,14 @@ netdev_dpdk_get_status(const struct netdev *netdev, struct smap *args) smap_add_format(args, "max_vfs", "%u", dev_info.max_vfs); smap_add_format(args, "max_vmdq_pools", "%u", dev_info.max_vmdq_pools); + /* Querying the DPDK library for iftype may be done in future, pending + * support; cf. RFC 3635 Section 3.2.4. */ + enum { IF_TYPE_ETHERNETCSMACD = 6 }; + + smap_add_format(args, "if_type", "%"PRIu32, IF_TYPE_ETHERNETCSMACD); + smap_add_format(args, "if_descr", "%s %s", rte_version(), + dev_info.driver_name); + if (dev_info.pci_dev) { smap_add_format(args, "pci-vendor_id", "0x%u", dev_info.pci_dev->id.vendor_id); diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml index c145e1a..72cf353 100644 --- a/vswitchd/vswitch.xml +++ b/vswitchd/vswitch.xml @@ -2815,6 +2815,70 @@ ovs-vsctl add-port br0 p0 -- set Interface p0 type=patch options:peer=p1 \ Whether carrier is detected on . + + +

+ DPDK specific interface status options. +

+ + + DPDK port ID. + + + + NUMA socket ID to which an Ethernet device is connected. + + + + Minimum size of RX buffer. + + + + Maximum configurable length of RX pkt. + + + + Maximum number of RX queues. + + + + Maximum number of TX queues. + + + + Maximum number of MAC addresses. + + + + Maximum number of hash MAC addresses for MTA and UTA. + + + + Maximum number of hash MAC addresses for MTA and UTA. + Maximum number of VFs. + + + + Maximum number of VMDq pools. + + + + Interface type ID according to IANA ifTYPE MIB definitions. + + + + Interface description string. + + + + Vendor ID of PCI device. + + + + Device ID of PCI device. + + +