Message ID | 20190301080947.91086-1-xiaolong.ye@intel.com (mailing list archive) |
---|---|
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 800A62C0C; Fri, 1 Mar 2019 09:12:44 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id B75672B87 for <dev@dpdk.org>; Fri, 1 Mar 2019 09:12:42 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 01 Mar 2019 00:12:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,426,1544515200"; d="scan'208";a="147594722" Received: from yexl-server.sh.intel.com ([10.67.110.206]) by fmsmga002.fm.intel.com with ESMTP; 01 Mar 2019 00:12:38 -0800 From: Xiaolong Ye <xiaolong.ye@intel.com> To: dev@dpdk.org Cc: Qi Zhang <qi.z.zhang@intel.com>, Xiaolong Ye <xiaolong.ye@intel.com> Date: Fri, 1 Mar 2019 16:09:41 +0800 Message-Id: <20190301080947.91086-1-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH v1 0/6] Introduce AF_XDP PMD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions <dev.dpdk.org> List-Unsubscribe: <https://mails.dpdk.org/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://mails.dpdk.org/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <https://mails.dpdk.org/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Series |
Introduce AF_XDP PMD
|
|
Message
Xiaolong Ye
March 1, 2019, 8:09 a.m. UTC
Overview ======== This patchset adds a new PMD driver for AF_XDP which is a proposed faster version of AF_PACKET interface in Linux, see below links [1] [2] for details of AF_XDP introduction: AF_XDP roadmap ============== - AF_XDP is included in upstream kernel since 4.18, and AF_XDP support in libbpf has been merged in bpf-next/master. [3] - Now i40e and ixgbe drivers have supported zero copy mode. Change logs =========== changes vs RFC sent by Qi last Aug: - Re-work base on AF_XDP's interface changes since the new libbpf has provided higher-level APIs that hide many of the details of the AP_XDP uapi. After the rework, it helps to reduce 300+ lines of code. - multi-queues is not supported due to current libbpf doesn't support multi-sockets on a single umem. - No extra steps to load xdp program manually, since the current behavior of libbpf would load a default xdp program when user calls xsk_socket__create. userspace application only needs to handle the cleanup. How to try ========== 1. take the latest bpf-next/master, build kernel and replace your host kernel with it. make sure you turn on XDP sockets when compiling Networking support --> Networking options --> [ * ] XDP sockets 2. build libbpf in tools/lib/bpf, and copy the libbpf.a and libbpf.so to /usr/lib64 cd tools/lib/bpf make 3. extra steps to build dpdk Add below lines to drivers/net/af_xdp/Makefile CFLAGS += -I/<your linux src root>/tools/include CFLAGS += -I/<your linux src root>/tools/lib/bpf add below line to config/common_linuxapp to enble the config for af_xdp pmd CONFIG_RTE_LIBRTE_PMD_AF_XDP=y 4. start testpmd ./build/app/testpmd -c 0xc -n 4 --vdev eth_af_xdp,iface=enp59s0f0,queue=0 -- -i --rxq=1 --txq=1 in this case, default xdp program will be loaded and linked to queue 0 of enp59s0f0, network traffics travel to queue 0 will be redirected to af_xdp socket. [1] https://lwn.net/Articles/750845/ [2] https://fosdem.org/2018/schedule/event/af_xdp/ [3] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=143bdc2e27b44d2559596424bfb017d578be33eb Xiaolong Ye (6): net/af_xdp: introduce AF_XDP PMD driver lib/mbuf: enable parse flags when create mempool lib/mempool: allow page size aligned mempool net/af_xdp: use mbuf mempool for buffer management net/af_xdp: enable zero copy app/testpmd: add mempool flags parameter MAINTAINERS | 6 + app/test-pmd/parameters.c | 12 + app/test-pmd/testpmd.c | 17 +- app/test-pmd/testpmd.h | 1 + config/common_base | 5 + doc/guides/nics/af_xdp.rst | 43 + doc/guides/rel_notes/release_18_11.rst | 7 + drivers/net/Makefile | 1 + drivers/net/af_xdp/Makefile | 31 + drivers/net/af_xdp/meson.build | 7 + drivers/net/af_xdp/rte_eth_af_xdp.c | 988 ++++++++++++++++++ drivers/net/af_xdp/rte_pmd_af_xdp_version.map | 4 + lib/librte_mbuf/rte_mbuf.c | 15 +- lib/librte_mbuf/rte_mbuf.h | 8 +- lib/librte_mempool/rte_mempool.c | 3 + lib/librte_mempool/rte_mempool.h | 1 + mk/rte.app.mk | 1 + 17 files changed, 1139 insertions(+), 11 deletions(-) create mode 100644 doc/guides/nics/af_xdp.rst 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
Comments
On 3/1/2019 8:09 AM, Xiaolong Ye wrote: > Overview > ======== > > This patchset adds a new PMD driver for AF_XDP which is a proposed > faster version of AF_PACKET interface in Linux, see below links [1] [2] for > details of AF_XDP introduction: > > AF_XDP roadmap > ============== > - AF_XDP is included in upstream kernel since 4.18, and AF_XDP support > in libbpf has been merged in bpf-next/master. [3] And it seems it has been merged into main repo [1], I assume it will be part of 5.1, which I guess will be released mid May. And we have release on 10 May. Taking into account that libbpf APIs used extensively, does it mean we can't release af_xdp on 19.05? [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=1cad078842396f0047a796694b6130fc096d97e2 <...>
11/03/2019 17:43, Ferruh Yigit: > On 3/1/2019 8:09 AM, Xiaolong Ye wrote: > > Overview > > ======== > > > > This patchset adds a new PMD driver for AF_XDP which is a proposed > > faster version of AF_PACKET interface in Linux, see below links [1] [2] for > > details of AF_XDP introduction: > > > > AF_XDP roadmap > > ============== > > - AF_XDP is included in upstream kernel since 4.18, and AF_XDP support > > in libbpf has been merged in bpf-next/master. [3] > > And it seems it has been merged into main repo [1], I assume it will be part of > 5.1, which I guess will be released mid May. > > And we have release on 10 May. Taking into account that libbpf APIs used > extensively, does it mean we can't release af_xdp on 19.05? > > [1] > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=1cad078842396f0047a796694b6130fc096d97e2 I think the requirement is to have all dependencies upstream, so we avoid releasing a feature not working when dependency is ready. If all is ready in Linux mainline branch, I guess we are fine, are we?
+ Magnus & Bjorn who can give more accurate comment about kernel upstream status. > -----Original Message----- > From: Thomas Monjalon [mailto:thomas@monjalon.net] > Sent: Tuesday, March 12, 2019 1:20 AM > To: Yigit, Ferruh <ferruh.yigit@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com> > Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Richardson, Bruce > <bruce.richardson@intel.com> > Subject: Re: [dpdk-dev] [PATCH v1 0/6] Introduce AF_XDP PMD > > 11/03/2019 17:43, Ferruh Yigit: > > On 3/1/2019 8:09 AM, Xiaolong Ye wrote: > > > Overview > > > ======== > > > > > > This patchset adds a new PMD driver for AF_XDP which is a proposed > > > faster version of AF_PACKET interface in Linux, see below links [1] > > > [2] for details of AF_XDP introduction: > > > > > > AF_XDP roadmap > > > ============== > > > - AF_XDP is included in upstream kernel since 4.18, and AF_XDP support > > > in libbpf has been merged in bpf-next/master. [3] > > > > And it seems it has been merged into main repo [1], I assume it will > > be part of 5.1, which I guess will be released mid May. > > > > And we have release on 10 May. Taking into account that libbpf APIs > > used extensively, does it mean we can't release af_xdp on 19.05? > > > > [1] > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/com > > mit?id=1cad078842396f0047a796694b6130fc096d97e2 > > I think the requirement is to have all dependencies upstream, so we avoid > releasing a feature not working when dependency is ready. > > If all is ready in Linux mainline branch, I guess we are fine, are we? >
> -----Original Message----- > From: Zhang, Qi Z > Sent: Tuesday, March 12, 2019 2:52 AM > To: Thomas Monjalon <thomas@monjalon.net>; Yigit, Ferruh > <ferruh.yigit@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com> > Cc: dev@dpdk.org; Richardson, Bruce <bruce.richardson@intel.com>; > Karlsson, Magnus <magnus.karlsson@intel.com>; Topel, Bjorn > <bjorn.topel@intel.com> > Subject: RE: [dpdk-dev] [PATCH v1 0/6] Introduce AF_XDP PMD > > + Magnus & Bjorn who can give more accurate comment about kernel > upstream status. > > > > -----Original Message----- > > From: Thomas Monjalon [mailto:thomas@monjalon.net] > > Sent: Tuesday, March 12, 2019 1:20 AM > > To: Yigit, Ferruh <ferruh.yigit@intel.com>; Ye, Xiaolong > > <xiaolong.ye@intel.com> > > Cc: dev@dpdk.org; Zhang, Qi Z <qi.z.zhang@intel.com>; Richardson, > > Bruce <bruce.richardson@intel.com> > > Subject: Re: [dpdk-dev] [PATCH v1 0/6] Introduce AF_XDP PMD > > > > 11/03/2019 17:43, Ferruh Yigit: > > > On 3/1/2019 8:09 AM, Xiaolong Ye wrote: > > > > Overview > > > > ======== > > > > > > > > This patchset adds a new PMD driver for AF_XDP which is a proposed > > > > faster version of AF_PACKET interface in Linux, see below links > > > > [1] [2] for details of AF_XDP introduction: > > > > > > > > AF_XDP roadmap > > > > ============== > > > > - AF_XDP is included in upstream kernel since 4.18, and AF_XDP support > > > > in libbpf has been merged in bpf-next/master. [3] > > > > > > And it seems it has been merged into main repo [1], I assume it will > > > be part of 5.1, which I guess will be released mid May. > > > > > > And we have release on 10 May. Taking into account that libbpf APIs > > > used extensively, does it mean we can't release af_xdp on 19.05? > > > > > > [1] > > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/c > > > om > > > mit?id=1cad078842396f0047a796694b6130fc096d97e2 > > > > I think the requirement is to have all dependencies upstream, so we > > avoid releasing a feature not working when dependency is ready. > > > > If all is ready in Linux mainline branch, I guess we are fine, are we? Libbpf is in linux-next which means it will be in the 5.1 release. This release will likely be in the end of April if we count the normal 8 week cadence of releases. 8 weeks means April 28, 9 weeks = May 5. 10 weeks = May 12. So unless we go all the way to 10 weeks, this feature should be in a stable release before DPDK 19.05. /Magnus