DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Cc: Ferruh Yigit <ferruh.yigit@intel.com>,
	Stephen Hemminger <stephen@networkplumber.org>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>
Subject: [dpdk-dev] [PATCH v10 00/20] Userspace Network Control Interface (UNCI)
Date: Tue,  4 Jul 2017 17:13:17 +0100	[thread overview]
Message-ID: <20170704161337.45926-1-ferruh.yigit@intel.com> (raw)
In-Reply-To: <20170630165140.59594-1-ferruh.yigit@intel.com>

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<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

---

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 <stephen@networkplumber.org>
Cc: Bruce Richardson <bruce.richardson@intel.com>
Cc: Anatoly Burakov <anatoly.burakov@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 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

  parent reply	other threads:[~2017-07-04 16:13 UTC|newest]

Thread overview: 91+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-26 16:52 [dpdk-dev] [RFC] Kernel Control Path (KCP) Ferruh Yigit
2017-05-28 16:55 ` Wiles, Keith
2017-05-29  9:26   ` Bruce Richardson
2017-05-29 17:29     ` Wiles, Keith
2017-06-16 15:54   ` Ferruh Yigit
2017-06-20 12:33     ` Ferruh Yigit
2017-05-30 10:55 ` Thomas Monjalon
2017-06-13 17:21   ` Ferruh Yigit
2017-06-13 18:00     ` Jay Rolette
2017-06-13 18:04       ` Dumitrescu, Cristian
2017-06-13 18:18         ` Wiles, Keith
2017-06-15 12:07           ` Alex Rosenbaum
2017-06-16 15:27             ` Ferruh Yigit
2017-06-16 16:48               ` Stephen Hemminger
2017-06-13 18:17       ` Wiles, Keith
2017-06-21 11:06 ` [dpdk-dev] [PATCH v8 0/4] Userspace Network Control Interface (UNCI) Ferruh Yigit
2017-06-21 11:06   ` [dpdk-dev] [PATCH v8 1/4] ethtool: move from sample folder to lib folder Ferruh Yigit
2017-06-26 11:02     ` Bruce Richardson
2017-06-21 11:06   ` [dpdk-dev] [PATCH v8 2/4] unci: add kernel control path kernel module Ferruh Yigit
2017-06-21 15:23     ` Stephen Hemminger
2017-06-30 17:02       ` Ferruh Yigit
2017-06-21 11:06   ` [dpdk-dev] [PATCH v8 3/4] rte_ctrl_if: add control interface library Ferruh Yigit
2017-06-26 11:09     ` Bruce Richardson
2017-06-26 11:30     ` Bruce Richardson
2017-06-21 11:06   ` [dpdk-dev] [PATCH v8 4/4] ethdev: add control interface support Ferruh Yigit
2017-06-21 15:24     ` Stephen Hemminger
2017-06-30 17:06       ` Ferruh Yigit
2017-06-26 11:39   ` [dpdk-dev] [PATCH v8 0/4] Userspace Network Control Interface (UNCI) Bruce Richardson
2017-06-29 16:13     ` Ferruh Yigit
2017-06-30 16:56       ` Ferruh Yigit
2017-06-30 16:51   ` [dpdk-dev] [PATCH v9 00/20] " Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 01/20] ethtool: add library skeleton Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 02/20] ethtool: move from sample folder into lib folder Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 03/20] ethtool: remove PMD specific API call Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 04/20] ethtool: update header doxygen syntax Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 05/20] ethtool: enable library Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 06/20] doc: add ethtool library documentation Ferruh Yigit
2017-07-02 20:18       ` Mcnamara, John
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 07/20] doc: update ethtool sample app doc Ferruh Yigit
2017-07-02 20:17       ` Mcnamara, John
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 08/20] unci: add module skeleton Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 09/20] unci: add rtnl newlink Ferruh Yigit
2017-06-30 17:27       ` Stephen Hemminger
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 10/20] unci: init netlink Ferruh Yigit
2017-06-30 17:28       ` Stephen Hemminger
2017-06-30 17:29       ` Stephen Hemminger
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 11/20] unci: add netlink exec Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 12/20] unci: add netdevice ops Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 13/20] unci: add ethtool support Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 14/20] ctrl_if: add library skeleton Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 15/20] ctrl_if: add create destroy interface APIs Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 16/20] ctrl_if: initialize netlink interface Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 17/20] ctrl_if: process control messages Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 18/20] ctrl_if: process ethtool messages Ferruh Yigit
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 19/20] doc: add control interface library documentation Ferruh Yigit
2017-07-02 20:16       ` Mcnamara, John
2017-06-30 16:51     ` [dpdk-dev] [PATCH v9 20/20] ethdev: add control interface support Ferruh Yigit
2017-07-04 16:13     ` Ferruh Yigit [this message]
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 01/20] ethtool: add library skeleton Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 02/20] ethtool: move from sample folder into lib folder Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 03/20] ethtool: remove PMD specific API call Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 04/20] ethtool: update header doxygen syntax Ferruh Yigit
2017-07-06  9:18         ` Burakov, Anatoly
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 05/20] ethtool: enable library Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 06/20] doc: add ethtool library documentation Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 07/20] doc: update ethtool sample app doc Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 08/20] unci: add module skeleton Ferruh Yigit
2017-07-06  9:25         ` Burakov, Anatoly
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 09/20] unci: add rtnl newlink Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 10/20] unci: init netlink Ferruh Yigit
2017-07-06  9:32         ` Burakov, Anatoly
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 11/20] unci: add netlink exec Ferruh Yigit
2017-07-05 19:07         ` Stephen Hemminger
2017-07-06 10:45           ` Ferruh Yigit
2017-07-07  0:25             ` Stephen Hemminger
2017-07-05 19:15         ` Stephen Hemminger
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 12/20] unci: add netdevice ops Ferruh Yigit
2017-07-05 19:12         ` Stephen Hemminger
2017-07-05 19:12         ` Stephen Hemminger
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 13/20] unci: add ethtool support Ferruh Yigit
2017-07-05 19:07         ` Stephen Hemminger
2017-07-05 19:08         ` Stephen Hemminger
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 14/20] ctrl_if: add library skeleton Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 15/20] ctrl_if: add create destroy interface APIs Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 16/20] ctrl_if: initialize generic netlink interface Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 17/20] ctrl_if: process control messages Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 18/20] ctrl_if: process ethtool messages Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 19/20] doc: add control interface library documentation Ferruh Yigit
2017-07-04 16:13       ` [dpdk-dev] [PATCH v10 20/20] ethdev: add control interface support Ferruh Yigit
2017-07-08  6:28         ` Yuanhan Liu
2017-07-20 14:55           ` Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170704161337.45926-1-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).