[dpdk-dev] [PATCH v9 00/20] Userspace Network Control Interface (UNCI)
Ferruh Yigit
ferruh.yigit at intel.com
Fri Jun 30 18:51:20 CEST 2017
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.
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<UP,BROADCAST,RUNNING,MULTICAST> 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<UP,BROADCAST,RUNNING,MULTICAST> 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<UP,BROADCAST,RUNNING,MULTICAST> 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<UP,BROADCAST,RUNNING,MULTICAST> 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
---
v9:
* patchset split into more patches
* renamed some structs / variables
---
Cc: Stephen Hemminger <stephen at networkplumber.org>
Cc: Bruce Richardson <bruce.richardson at intel.com>
Cc: Anatoly Burakov <anatoly.burakov at intel.com>
---
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 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 | 347 ++++++++++++++++++
lib/librte_ctrl_if/rte_ctrl_if.h | 91 +++++
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 | 292 +++++++++++++++
lib/librte_ctrl_if/rte_nl.h | 48 +++
lib/librte_eal/common/include/rte_log.h | 2 +
lib/librte_eal/linuxapp/Makefile | 4 +-
lib/librte_eal/linuxapp/eal/Makefile | 1 +
.../eal/include/exec-env/rte_unci_common.h | 109 ++++++
lib/librte_eal/linuxapp/unci/Makefile | 54 +++
lib/librte_eal/linuxapp/unci/unci_dev.h | 50 +++
lib/librte_eal/linuxapp/unci/unci_ethtool.c | 293 ++++++++++++++++
lib/librte_eal/linuxapp/unci/unci_net.c | 217 ++++++++++++
lib/librte_eal/linuxapp/unci/unci_nl.c | 219 ++++++++++++
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 +
39 files changed, 2507 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/rte_unci_common.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
More information about the dev
mailing list