From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id AC3452B99 for ; Thu, 4 Apr 2019 10:56:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2019 01:56:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,306,1549958400"; d="scan'208";a="147960247" Received: from yexl-server.sh.intel.com ([10.67.110.206]) by orsmga002.jf.intel.com with ESMTP; 04 Apr 2019 01:56:28 -0700 From: Xiaolong Ye To: dev@dpdk.org, Stephen Hemminger , Ferruh Yigit , Luca Boccassi Cc: Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Bruce Richardson , Ananyev Konstantin , David Marchand , Andrew Rybchenko , Olivier Matz , Xiaolong Ye Date: Thu, 4 Apr 2019 16:51:12 +0800 Message-Id: <20190404085113.16732-1-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190301080947.91086-1-xiaolong.ye@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH v11 0/1] Introduce AF_XDP PMD 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: Thu, 04 Apr 2019 08:56:32 -0000 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 v5.1-rc1. - Now i40e and ixgbe drivers have supported zero copy mode. Change logs =========== v11: - fix the meson build issue v10: - refine the Makefile, remove RTE_KERNELDIR related CFLAGS - add a new internal file af_xdp_deps.h to handle the dependency for asm/barrier.h - fix a typo observed by Stephen - rename xsk.h to bpf/xsk.h as xsk.h is assumed to be installed in /usr/local/include/bpf - add libbpf build steps in af_xdp.rst v9: - adjust header files order according to Stephen's suggestion v8: - address Ferruh's comments on V7 - replace posix_memalign with rte_memzone_reserve_aligned to get better performance - keep the first patch only as Oliver suggested as zero copy part implementation is still in suspense, we may provide the related patch later. v7: - mention mtu limitation in af_xdp.rst - fix the vdev name in af_xdp.rst V6: - remove the newline in AF_XDP_LOG definition to avoid double new lines issue. - rename MEMPOOL_F_PAGE_ALIGN to MEMPOOL_CHUNK_F_PAGE_ALIGN. V5: - disable AF_XDP pmd by default due to it requires kernel more recent than minimum kernel version supported by DPDK - address other review comments of Maxime V4: - change vdev name to net_af_xdp - adopt dynamic log type for all logging - Fix other style issues raised by Stephen V3: - Fix all style issues pointed by Stephen, Mattias, David. - Drop the testpmd change as we'll adopt Jerin's suggestion to add a new mempool driver to handle the application use of AF_XDP's zero copy feature. V2: - Fix a NULL pointer reference crash issue - Fix txonly stop sending traffic in zc mode - Refactor rte_mbuf.c to avoid ABI breakage. - Fix multiple style issues pointed by Ferruh, David, Stephen, Luca. 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 kernel >= v5.1-rc1, 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 & install libbpf in tools/lib/bpf cd tools/lib/bpf make install_lib make install_headers 3. ethtool -L enp59s0f0 combined 1 4. extra step to build dpdk explicitly enable AF_XDP pmd by adding below line to config/common_linux CONFIG_RTE_LIBRTE_PMD_AF_XDP=y 5. start testpmd ./build/app/testpmd -c 0xc -n 4 --vdev net_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. Xiaolong Ye (1): net/af_xdp: introduce AF XDP PMD driver MAINTAINERS | 7 + config/common_base | 5 + doc/guides/nics/af_xdp.rst | 50 + 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 | 28 + drivers/net/af_xdp/af_xdp_deps.h | 15 + drivers/net/af_xdp/meson.build | 19 + drivers/net/af_xdp/rte_eth_af_xdp.c | 955 ++++++++++++++++++ drivers/net/af_xdp/rte_pmd_af_xdp_version.map | 3 + drivers/net/meson.build | 1 + mk/rte.app.mk | 1 + 14 files changed, 1104 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/af_xdp_deps.h 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 -- 2.17.1 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 B0739A0679 for ; Thu, 4 Apr 2019 10:56:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8DBE55F20; Thu, 4 Apr 2019 10:56:33 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id AC3452B99 for ; Thu, 4 Apr 2019 10:56:31 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2019 01:56:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,306,1549958400"; d="scan'208";a="147960247" Received: from yexl-server.sh.intel.com ([10.67.110.206]) by orsmga002.jf.intel.com with ESMTP; 04 Apr 2019 01:56:28 -0700 From: Xiaolong Ye To: dev@dpdk.org, Stephen Hemminger , Ferruh Yigit , Luca Boccassi Cc: Qi Zhang , Karlsson Magnus , Topel Bjorn , Maxime Coquelin , Bruce Richardson , Ananyev Konstantin , David Marchand , Andrew Rybchenko , Olivier Matz , Xiaolong Ye Date: Thu, 4 Apr 2019 16:51:12 +0800 Message-Id: <20190404085113.16732-1-xiaolong.ye@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190301080947.91086-1-xiaolong.ye@intel.com> References: <20190301080947.91086-1-xiaolong.ye@intel.com> Subject: [dpdk-dev] [PATCH v11 0/1] Introduce AF_XDP PMD 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" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190404085112.X0abVdFOCK9qAjpl_u_2H70wF3f4h6H3Ocdx-pUKp_I@z> 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 v5.1-rc1. - Now i40e and ixgbe drivers have supported zero copy mode. Change logs =========== v11: - fix the meson build issue v10: - refine the Makefile, remove RTE_KERNELDIR related CFLAGS - add a new internal file af_xdp_deps.h to handle the dependency for asm/barrier.h - fix a typo observed by Stephen - rename xsk.h to bpf/xsk.h as xsk.h is assumed to be installed in /usr/local/include/bpf - add libbpf build steps in af_xdp.rst v9: - adjust header files order according to Stephen's suggestion v8: - address Ferruh's comments on V7 - replace posix_memalign with rte_memzone_reserve_aligned to get better performance - keep the first patch only as Oliver suggested as zero copy part implementation is still in suspense, we may provide the related patch later. v7: - mention mtu limitation in af_xdp.rst - fix the vdev name in af_xdp.rst V6: - remove the newline in AF_XDP_LOG definition to avoid double new lines issue. - rename MEMPOOL_F_PAGE_ALIGN to MEMPOOL_CHUNK_F_PAGE_ALIGN. V5: - disable AF_XDP pmd by default due to it requires kernel more recent than minimum kernel version supported by DPDK - address other review comments of Maxime V4: - change vdev name to net_af_xdp - adopt dynamic log type for all logging - Fix other style issues raised by Stephen V3: - Fix all style issues pointed by Stephen, Mattias, David. - Drop the testpmd change as we'll adopt Jerin's suggestion to add a new mempool driver to handle the application use of AF_XDP's zero copy feature. V2: - Fix a NULL pointer reference crash issue - Fix txonly stop sending traffic in zc mode - Refactor rte_mbuf.c to avoid ABI breakage. - Fix multiple style issues pointed by Ferruh, David, Stephen, Luca. 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 kernel >= v5.1-rc1, 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 & install libbpf in tools/lib/bpf cd tools/lib/bpf make install_lib make install_headers 3. ethtool -L enp59s0f0 combined 1 4. extra step to build dpdk explicitly enable AF_XDP pmd by adding below line to config/common_linux CONFIG_RTE_LIBRTE_PMD_AF_XDP=y 5. start testpmd ./build/app/testpmd -c 0xc -n 4 --vdev net_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. Xiaolong Ye (1): net/af_xdp: introduce AF XDP PMD driver MAINTAINERS | 7 + config/common_base | 5 + doc/guides/nics/af_xdp.rst | 50 + 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 | 28 + drivers/net/af_xdp/af_xdp_deps.h | 15 + drivers/net/af_xdp/meson.build | 19 + drivers/net/af_xdp/rte_eth_af_xdp.c | 955 ++++++++++++++++++ drivers/net/af_xdp/rte_pmd_af_xdp_version.map | 3 + drivers/net/meson.build | 1 + mk/rte.app.mk | 1 + 14 files changed, 1104 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/af_xdp_deps.h 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 -- 2.17.1