From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 96BAB44C3 for ; Tue, 19 Mar 2019 17:33:27 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2019 09:33:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,498,1544515200"; d="scan'208";a="153144563" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.35]) by fmsmga002.fm.intel.com with SMTP; 19 Mar 2019 09:33:24 -0700 Received: by (sSMTP sendmail emulation); Tue, 19 Mar 2019 16:33:23 +0000 Date: Tue, 19 Mar 2019 16:33:23 +0000 From: Bruce Richardson To: Stephen Hemminger Cc: Xiaolong Ye , dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn Message-ID: <20190319163323.GA66276@bricha3-MOBL.ger.corp.intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190319071256.26302-1-xiaolong.ye@intel.com> <20190319071256.26302-2-xiaolong.ye@intel.com> <20190319091627.570eb225@shemminger-XPS-13-9360> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190319091627.570eb225@shemminger-XPS-13-9360> User-Agent: Mutt/1.11.2 (2019-01-07) Subject: Re: [dpdk-dev] [PATCH v2 1/6] net/af_xdp: introduce AF XDP PMD driver 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, 19 Mar 2019 16:33:28 -0000 On Tue, Mar 19, 2019 at 09:16:27AM -0700, Stephen Hemminger wrote: > On Tue, 19 Mar 2019 15:12:51 +0800 > Xiaolong Ye wrote: > > > Add a new PMD driver for AF_XDP which is a proposed faster version of > > AF_PACKET interface in Linux. More info about AF_XDP, please refer to [1] > > [2]. > > > > This is the vanilla version PMD which just uses a raw buffer registered as > > the umem. > > > > [1] https://fosdem.org/2018/schedule/event/af_xdp/ > > [2] https://lwn.net/Articles/745934/ > > > > Signed-off-by: Xiaolong Ye > > --- > > MAINTAINERS | 6 + > > config/common_base | 5 + > > config/common_linux | 1 + > > doc/guides/nics/af_xdp.rst | 45 + > > doc/guides/nics/features/af_xdp.ini | 11 + > > doc/guides/nics/index.rst | 1 + > > doc/guides/rel_notes/release_19_05.rst | 7 + > > drivers/net/Makefile | 1 + > > drivers/net/af_xdp/Makefile | 33 + > > drivers/net/af_xdp/meson.build | 21 + > > drivers/net/af_xdp/rte_eth_af_xdp.c | 930 ++++++++++++++++++ > > drivers/net/af_xdp/rte_pmd_af_xdp_version.map | 3 + > > drivers/net/meson.build | 1 + > > mk/rte.app.mk | 1 + > > 14 files changed, 1066 insertions(+) > > create mode 100644 doc/guides/nics/af_xdp.rst > > create mode 100644 doc/guides/nics/features/af_xdp.ini > > create mode 100644 drivers/net/af_xdp/Makefile > > create mode 100644 drivers/net/af_xdp/meson.build > > create mode 100644 drivers/net/af_xdp/rte_eth_af_xdp.c > > create mode 100644 drivers/net/af_xdp/rte_pmd_af_xdp_version.map > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index 452b8eb82..1cc54b439 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -468,6 +468,12 @@ M: John W. Linville > > F: drivers/net/af_packet/ > > F: doc/guides/nics/features/afpacket.ini > > > > +Linux AF_XDP > > +M: Xiaolong Ye > > +M: Qi Zhang > > +F: drivers/net/af_xdp/ > > +F: doc/guides/nics/features/af_xdp.rst > > + > > Amazon ENA > > M: Marcin Wojtas > > M: Michal Krawczyk > > diff --git a/config/common_base b/config/common_base > > index 0b09a9348..4044de205 100644 > > --- a/config/common_base > > +++ b/config/common_base > > @@ -416,6 +416,11 @@ CONFIG_RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE=n > > # > > CONFIG_RTE_LIBRTE_PMD_AF_PACKET=n > > > > +# > > +# Compile software PMD backed by AF_XDP sockets (Linux only) > > +# > > +CONFIG_RTE_LIBRTE_PMD_AF_XDP=n > > + > > # > > # Compile link bonding PMD library > > # > > diff --git a/config/common_linux b/config/common_linux > > index 75334273d..0b1249da0 100644 > > --- a/config/common_linux > > +++ b/config/common_linux > > @@ -19,6 +19,7 @@ CONFIG_RTE_LIBRTE_VHOST_POSTCOPY=n > > CONFIG_RTE_LIBRTE_PMD_VHOST=y > > CONFIG_RTE_LIBRTE_IFC_PMD=y > > CONFIG_RTE_LIBRTE_PMD_AF_PACKET=y > > +CONFIG_RTE_LIBRTE_PMD_AF_XDP=y > > CONFIG_RTE_LIBRTE_PMD_SOFTNIC=y > > CONFIG_RTE_LIBRTE_PMD_TAP=y > > CONFIG_RTE_LIBRTE_AVP_PMD=y > > diff --git a/doc/guides/nics/af_xdp.rst b/doc/guides/nics/af_xdp.rst > > new file mode 100644 > > index 000000000..dd5654dd1 > > --- /dev/null > > +++ b/doc/guides/nics/af_xdp.rst > > @@ -0,0 +1,45 @@ > > +.. SPDX-License-Identifier: BSD-3-Clause > > + Copyright(c) 2018 Intel Corporation. > > + > > +AF_XDP Poll Mode Driver > > +========================== > > + > > +AF_XDP is an address family that is optimized for high performance > > +packet processing. AF_XDP sockets enable the possibility for XDP program to > > +redirect packets to a memory buffer in userspace. > > + > > +For the full details behind AF_XDP socket, you can refer to > > +`AF_XDP documentation in the Kernel > > +`_. > > + > > +This Linux-specific PMD driver creates the AF_XDP socket and binds it to a > > +specific netdev queue, it allows a DPDK application to send and receive raw > > +packets through the socket which would bypass the kernel network stack. > > +Current implementation only supports single queue, multi-queues feature will > > +be added later. > > + > > +Options > > +------- > > + > > +The following options can be provided to set up an af_xdp port in DPDK. > > + > > +* ``iface`` - name of the Kernel interface to attach to (required); > > +* ``queue`` - netdev queue id (optional, default 0); > > + > > +Prerequisites > > +------------- > > + > > +This is a Linux-specific PMD, thus the following prerequisites apply: > > + > > +* A Linux Kernel (version > 4.18) with XDP sockets configuration enabled; > > +* libbpf (within kernel version > 5.1) with latest af_xdp support installed > > +* A Kernel bound interface to attach to. > > + > > +Set up an af_xdp interface > > +----------------------------- > > + > > +The following example will set up an af_xdp interface in DPDK: > > + > > +.. code-block:: console > > + > > + --vdev eth_af_xdp,iface=ens786f1,queue=0 > > diff --git a/doc/guides/nics/features/af_xdp.ini b/doc/guides/nics/features/af_xdp.ini > > new file mode 100644 > > index 000000000..7b8fcce00 > > --- /dev/null > > +++ b/doc/guides/nics/features/af_xdp.ini > > @@ -0,0 +1,11 @@ > > +; > > +; Supported features of the 'af_xdp' network poll mode driver. > > +; > > +; Refer to default.ini for the full list of available PMD features. > > +; > > +[Features] > > +Link status = Y > > +MTU update = Y > > +Promiscuous mode = Y > > +Stats per queue = Y > > +x86-64 = Y > > \ No newline at end of file > > > This is bad. Configure your editor to always put newline at end of file. > In .emacs > > (setq require-final-newline t) > Or use Vim which needs no extra configuration to do this. :-) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id E6A1DA00E6 for ; Tue, 19 Mar 2019 17:33:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B07D6493D; Tue, 19 Mar 2019 17:33:28 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 96BAB44C3 for ; Tue, 19 Mar 2019 17:33:27 +0100 (CET) X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 19 Mar 2019 09:33:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,498,1544515200"; d="scan'208";a="153144563" Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.35]) by fmsmga002.fm.intel.com with SMTP; 19 Mar 2019 09:33:24 -0700 Received: by (sSMTP sendmail emulation); Tue, 19 Mar 2019 16:33:23 +0000 Date: Tue, 19 Mar 2019 16:33:23 +0000 From: Bruce Richardson To: Stephen Hemminger Cc: Xiaolong Ye , dev@dpdk.org, Qi Zhang , Karlsson Magnus , Topel Bjorn Message-ID: <20190319163323.GA66276@bricha3-MOBL.ger.corp.intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> <20190319071256.26302-1-xiaolong.ye@intel.com> <20190319071256.26302-2-xiaolong.ye@intel.com> <20190319091627.570eb225@shemminger-XPS-13-9360> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline In-Reply-To: <20190319091627.570eb225@shemminger-XPS-13-9360> User-Agent: Mutt/1.11.2 (2019-01-07) Subject: Re: [dpdk-dev] [PATCH v2 1/6] net/af_xdp: introduce AF XDP PMD driver 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190319163323.o-qGa1KNT9GDC1GV2eLMdkdBFsKrOLwMdLIF8ffVC7k@z> On Tue, Mar 19, 2019 at 09:16:27AM -0700, Stephen Hemminger wrote: > On Tue, 19 Mar 2019 15:12:51 +0800 > Xiaolong Ye wrote: > > > Add a new PMD driver for AF_XDP which is a proposed faster version of > > AF_PACKET interface in Linux. More info about AF_XDP, please refer to [1] > > [2]. > > > > This is the vanilla version PMD which just uses a raw buffer registered as > > the umem. > > > > [1] https://fosdem.org/2018/schedule/event/af_xdp/ > > [2] https://lwn.net/Articles/745934/ > > > > Signed-off-by: Xiaolong Ye > > --- > > MAINTAINERS | 6 + > > config/common_base | 5 + > > config/common_linux | 1 + > > doc/guides/nics/af_xdp.rst | 45 + > > doc/guides/nics/features/af_xdp.ini | 11 + > > doc/guides/nics/index.rst | 1 + > > doc/guides/rel_notes/release_19_05.rst | 7 + > > drivers/net/Makefile | 1 + > > drivers/net/af_xdp/Makefile | 33 + > > drivers/net/af_xdp/meson.build | 21 + > > drivers/net/af_xdp/rte_eth_af_xdp.c | 930 ++++++++++++++++++ > > drivers/net/af_xdp/rte_pmd_af_xdp_version.map | 3 + > > drivers/net/meson.build | 1 + > > mk/rte.app.mk | 1 + > > 14 files changed, 1066 insertions(+) > > create mode 100644 doc/guides/nics/af_xdp.rst > > create mode 100644 doc/guides/nics/features/af_xdp.ini > > create mode 100644 drivers/net/af_xdp/Makefile > > create mode 100644 drivers/net/af_xdp/meson.build > > create mode 100644 drivers/net/af_xdp/rte_eth_af_xdp.c > > create mode 100644 drivers/net/af_xdp/rte_pmd_af_xdp_version.map > > > > diff --git a/MAINTAINERS b/MAINTAINERS > > index 452b8eb82..1cc54b439 100644 > > --- a/MAINTAINERS > > +++ b/MAINTAINERS > > @@ -468,6 +468,12 @@ M: John W. Linville > > F: drivers/net/af_packet/ > > F: doc/guides/nics/features/afpacket.ini > > > > +Linux AF_XDP > > +M: Xiaolong Ye > > +M: Qi Zhang > > +F: drivers/net/af_xdp/ > > +F: doc/guides/nics/features/af_xdp.rst > > + > > Amazon ENA > > M: Marcin Wojtas > > M: Michal Krawczyk > > diff --git a/config/common_base b/config/common_base > > index 0b09a9348..4044de205 100644 > > --- a/config/common_base > > +++ b/config/common_base > > @@ -416,6 +416,11 @@ CONFIG_RTE_LIBRTE_VMXNET3_DEBUG_TX_FREE=n > > # > > CONFIG_RTE_LIBRTE_PMD_AF_PACKET=n > > > > +# > > +# Compile software PMD backed by AF_XDP sockets (Linux only) > > +# > > +CONFIG_RTE_LIBRTE_PMD_AF_XDP=n > > + > > # > > # Compile link bonding PMD library > > # > > diff --git a/config/common_linux b/config/common_linux > > index 75334273d..0b1249da0 100644 > > --- a/config/common_linux > > +++ b/config/common_linux > > @@ -19,6 +19,7 @@ CONFIG_RTE_LIBRTE_VHOST_POSTCOPY=n > > CONFIG_RTE_LIBRTE_PMD_VHOST=y > > CONFIG_RTE_LIBRTE_IFC_PMD=y > > CONFIG_RTE_LIBRTE_PMD_AF_PACKET=y > > +CONFIG_RTE_LIBRTE_PMD_AF_XDP=y > > CONFIG_RTE_LIBRTE_PMD_SOFTNIC=y > > CONFIG_RTE_LIBRTE_PMD_TAP=y > > CONFIG_RTE_LIBRTE_AVP_PMD=y > > diff --git a/doc/guides/nics/af_xdp.rst b/doc/guides/nics/af_xdp.rst > > new file mode 100644 > > index 000000000..dd5654dd1 > > --- /dev/null > > +++ b/doc/guides/nics/af_xdp.rst > > @@ -0,0 +1,45 @@ > > +.. SPDX-License-Identifier: BSD-3-Clause > > + Copyright(c) 2018 Intel Corporation. > > + > > +AF_XDP Poll Mode Driver > > +========================== > > + > > +AF_XDP is an address family that is optimized for high performance > > +packet processing. AF_XDP sockets enable the possibility for XDP program to > > +redirect packets to a memory buffer in userspace. > > + > > +For the full details behind AF_XDP socket, you can refer to > > +`AF_XDP documentation in the Kernel > > +`_. > > + > > +This Linux-specific PMD driver creates the AF_XDP socket and binds it to a > > +specific netdev queue, it allows a DPDK application to send and receive raw > > +packets through the socket which would bypass the kernel network stack. > > +Current implementation only supports single queue, multi-queues feature will > > +be added later. > > + > > +Options > > +------- > > + > > +The following options can be provided to set up an af_xdp port in DPDK. > > + > > +* ``iface`` - name of the Kernel interface to attach to (required); > > +* ``queue`` - netdev queue id (optional, default 0); > > + > > +Prerequisites > > +------------- > > + > > +This is a Linux-specific PMD, thus the following prerequisites apply: > > + > > +* A Linux Kernel (version > 4.18) with XDP sockets configuration enabled; > > +* libbpf (within kernel version > 5.1) with latest af_xdp support installed > > +* A Kernel bound interface to attach to. > > + > > +Set up an af_xdp interface > > +----------------------------- > > + > > +The following example will set up an af_xdp interface in DPDK: > > + > > +.. code-block:: console > > + > > + --vdev eth_af_xdp,iface=ens786f1,queue=0 > > diff --git a/doc/guides/nics/features/af_xdp.ini b/doc/guides/nics/features/af_xdp.ini > > new file mode 100644 > > index 000000000..7b8fcce00 > > --- /dev/null > > +++ b/doc/guides/nics/features/af_xdp.ini > > @@ -0,0 +1,11 @@ > > +; > > +; Supported features of the 'af_xdp' network poll mode driver. > > +; > > +; Refer to default.ini for the full list of available PMD features. > > +; > > +[Features] > > +Link status = Y > > +MTU update = Y > > +Promiscuous mode = Y > > +Stats per queue = Y > > +x86-64 = Y > > \ No newline at end of file > > > This is bad. Configure your editor to always put newline at end of file. > In .emacs > > (setq require-final-newline t) > Or use Vim which needs no extra configuration to do this. :-)