From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 556AD271 for ; Tue, 4 Jul 2017 18:13:42 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jul 2017 09:13:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,309,1496127600"; d="scan'208";a="122666244" Received: from silpixa00372839.ir.intel.com (HELO silpixa00372839.ger.corp.intel.com) ([10.237.222.154]) by fmsmga006.fm.intel.com with ESMTP; 04 Jul 2017 09:13:40 -0700 From: Ferruh Yigit To: dev@dpdk.org Cc: Ferruh Yigit , Stephen Hemminger , Bruce Richardson , Anatoly Burakov Date: Tue, 4 Jul 2017 17:13:17 +0100 Message-Id: <20170704161337.45926-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170630165140.59594-1-ferruh.yigit@intel.com> References: <20170630165140.59594-1-ferruh.yigit@intel.com> Subject: [dpdk-dev] [PATCH v10 00/20] Userspace Network Control Interface (UNCI) X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 Jul 2017 16:13:44 -0000 Userspace Network Control Interface (UNCI), (formerly KCP). When a NIC bound to the DPDK, it can't be controlled by Linux tools. This patch creates a virtual network interface for each DPDK port, initial target is to get some data from those interfaces, in next step target is to control DPDK ports using virtual interfaces. KNI control path already provides this capability and this work is based on KNI, but current KNI only supports some devices and requires application changes. UNCI is improved KNI control related part. Control messages to the virtual interface moved to the underlying PMD and response moved back to Linux: +-------+ | dpdk0 | +---^---+ | | netlink v +-------------------+ | control interface | +--------------+ | +------------+ | | | ethtool lib| | | +------------+ +----+ +-------------------+ | ethdev | +-------------------+ | +---------+ | Any PMD | +---------+ First patch in the set is moving DPDK ethtool library from sample application folder to the lib. This library provides ethtool commands on top of ethdev library. Second patch introduces a control library, which gets some commands via netlink and converts these into ethtool or ethdev APIs. A background thread created to listen commands. Third patch implements a kernel module, similar to KNI, which is a simple virtual network driver with netlink communication capability. This driver pass through all control commands to userspace via netlink. Forth patch adds control interface create and destroy APIs for ethdev. This will create Linux interfaces automatically if rte_unci kernel module is inserted. Will work as it is if module is not inserted. The intension is to upstream the Linux kernel module, please provide comments to make it ready for upstream. Note: To remove interfaces: ip l del dpdk0 type unci Samples: Run testpmd with no extra arguments: "testpmd -- -i" If the rte_unci module inserted two new interfaces will show up: $ ifconfig dpdk0 && ifconfig dpdk1 dpdk0: flags=4163 mtu 1500 ether 90:e2:ba:0e:49:b8 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 dpdk1: flags=4163 mtu 1500 ether 00:1b:21:76:fa:20 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 The MAC address information already get from actual HW. (Interfaces are shown down by default) When data transfer start in testpmd, stats updated accordingly: $ ifconfig dpdk0 && ifconfig dpdk1 dpdk0: flags=4163 mtu 1500 ether 90:e2:ba:0e:49:b8 txqueuelen 1000 (Ethernet) RX packets 9662125409 bytes 553368167417 (515.3 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 9605125821 bytes 518893560100 (483.2 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 dpdk1: flags=4163 mtu 1500 ether 00:1b:21:76:fa:20 txqueuelen 1000 (Ethernet) RX packets 9605137856 bytes 552991297017 (515.0 GiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 9662138670 bytes 518732030928 (483.1 GiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 Or able to get same data via ethtool: $ ethtool -i dpdk0 driver: net_ixgbe version: DPDK 17.08.0-rc0 firmware-version: 0x61bf0001 expansion-rom-version: bus-info: 0000:08:00.0 supports-statistics: no supports-test: no supports-eeprom-access: yes supports-register-dump: yes supports-priv-flags: no $ ethtool -g dpdk0 Ring parameters for dpdk0: Pre-set maximums: RX: 4096 RX Mini: 0 RX Jumbo: 0 TX: 4096 Current hardware settings: RX: 128 RX Mini: 0 RX Jumbo: 0 TX: 512 --- v10: * switch to generic netlink * update variable types for the ones accessed from userspace v9: * patchset split into more patches * renamed some structs / variables --- Cc: Stephen Hemminger Cc: Bruce Richardson Cc: Anatoly Burakov --- Ferruh Yigit (20): ethtool: add library skeleton ethtool: move from sample folder into lib folder ethtool: remove PMD specific API call ethtool: update header doxygen syntax ethtool: enable library doc: add ethtool library documentation doc: update ethtool sample app doc unci: add module skeleton unci: add rtnl newlink unci: init netlink unci: add netlink exec unci: add netdevice ops unci: add ethtool support ctrl_if: add library skeleton ctrl_if: add create destroy interface APIs ctrl_if: initialize generic netlink interface ctrl_if: process control messages ctrl_if: process ethtool messages doc: add control interface library documentation ethdev: add control interface support MAINTAINERS | 8 + config/common_base | 15 + config/common_linuxapp | 3 + doc/api/doxy-api-index.md | 4 +- doc/api/doxy-api.conf | 2 + doc/guides/prog_guide/ctrl_if_lib.rst | 50 +++ doc/guides/prog_guide/ethtool_lib.rst | 62 ++++ doc/guides/prog_guide/index.rst | 2 + doc/guides/rel_notes/release_17_08.rst | 15 + doc/guides/sample_app_ug/ethtool.rst | 36 +- drivers/net/Makefile | 4 + examples/ethtool/Makefile | 24 +- examples/ethtool/{ethtool-app => }/ethapp.c | 0 examples/ethtool/{ethtool-app => }/ethapp.h | 0 examples/ethtool/{ethtool-app => }/main.c | 0 lib/Makefile | 4 + lib/librte_ctrl_if/Makefile | 56 +++ lib/librte_ctrl_if/rte_ctrl_if.c | 346 ++++++++++++++++++ lib/librte_ctrl_if/rte_ctrl_if.h | 93 +++++ lib/librte_ctrl_if/rte_ctrl_if_version.map | 8 + lib/librte_ctrl_if/rte_ctrl_process.c | 390 +++++++++++++++++++++ lib/librte_ctrl_if/rte_ctrl_process.h | 54 +++ lib/librte_ctrl_if/rte_nl.c | 387 ++++++++++++++++++++ lib/librte_ctrl_if/rte_nl.h | 48 +++ lib/librte_eal/common/eal_common_log.c | 2 + lib/librte_eal/common/include/rte_log.h | 2 + lib/librte_eal/linuxapp/Makefile | 4 +- lib/librte_eal/linuxapp/eal/Makefile | 1 + .../linuxapp/eal/include/exec-env/unci.h | 129 +++++++ lib/librte_eal/linuxapp/unci/Makefile | 54 +++ lib/librte_eal/linuxapp/unci/unci_dev.h | 51 +++ lib/librte_eal/linuxapp/unci/unci_ethtool.c | 293 ++++++++++++++++ lib/librte_eal/linuxapp/unci/unci_net.c | 234 +++++++++++++ lib/librte_eal/linuxapp/unci/unci_nl.c | 252 +++++++++++++ lib/librte_ether/rte_ethdev_pci.h | 15 +- .../ethtool/lib => lib/librte_ethtool}/Makefile | 35 +- .../lib => lib/librte_ethtool}/rte_ethtool.c | 23 +- .../lib => lib/librte_ethtool}/rte_ethtool.h | 57 +-- lib/librte_ethtool/rte_ethtool_version.map | 28 ++ mk/rte.app.mk | 2 + 40 files changed, 2676 insertions(+), 117 deletions(-) create mode 100644 doc/guides/prog_guide/ctrl_if_lib.rst create mode 100644 doc/guides/prog_guide/ethtool_lib.rst rename examples/ethtool/{ethtool-app => }/ethapp.c (100%) rename examples/ethtool/{ethtool-app => }/ethapp.h (100%) rename examples/ethtool/{ethtool-app => }/main.c (100%) create mode 100644 lib/librte_ctrl_if/Makefile create mode 100644 lib/librte_ctrl_if/rte_ctrl_if.c create mode 100644 lib/librte_ctrl_if/rte_ctrl_if.h create mode 100644 lib/librte_ctrl_if/rte_ctrl_if_version.map create mode 100644 lib/librte_ctrl_if/rte_ctrl_process.c create mode 100644 lib/librte_ctrl_if/rte_ctrl_process.h create mode 100644 lib/librte_ctrl_if/rte_nl.c create mode 100644 lib/librte_ctrl_if/rte_nl.h create mode 100644 lib/librte_eal/linuxapp/eal/include/exec-env/unci.h create mode 100644 lib/librte_eal/linuxapp/unci/Makefile create mode 100644 lib/librte_eal/linuxapp/unci/unci_dev.h create mode 100644 lib/librte_eal/linuxapp/unci/unci_ethtool.c create mode 100644 lib/librte_eal/linuxapp/unci/unci_net.c create mode 100644 lib/librte_eal/linuxapp/unci/unci_nl.c rename {examples/ethtool/lib => lib/librte_ethtool}/Makefile (76%) rename {examples/ethtool/lib => lib/librte_ethtool}/rte_ethtool.c (95%) rename {examples/ethtool/lib => lib/librte_ethtool}/rte_ethtool.h (91%) create mode 100644 lib/librte_ethtool/rte_ethtool_version.map -- 2.13.0