Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/105062/?format=api
http://patchwork.dpdk.org/api/patches/105062/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20211210105853.38161-1-ciara.loftus@intel.com/", "project": { "id": 1, "url": "http://patchwork.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<20211210105853.38161-1-ciara.loftus@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211210105853.38161-1-ciara.loftus@intel.com", "date": "2021-12-10T10:58:53", "name": "[RFC] net/af_xdp: use libxdp if available", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "bf4dabb90d117f2e74281cf77a61399e59ab2391", "submitter": { "id": 144, "url": "http://patchwork.dpdk.org/api/people/144/?format=api", "name": "Loftus, Ciara", "email": "ciara.loftus@intel.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20211210105853.38161-1-ciara.loftus@intel.com/mbox/", "series": [ { "id": 20909, "url": "http://patchwork.dpdk.org/api/series/20909/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20909", "date": "2021-12-10T10:58:53", "name": "[RFC] net/af_xdp: use libxdp if available", "version": 1, "mbox": "http://patchwork.dpdk.org/series/20909/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/105062/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/105062/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 130EAA0093;\n\tFri, 10 Dec 2021 11:59:38 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 956404014F;\n\tFri, 10 Dec 2021 11:59:37 +0100 (CET)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by mails.dpdk.org (Postfix) with ESMTP id C0ABE40041\n for <dev@dpdk.org>; Fri, 10 Dec 2021 11:59:35 +0100 (CET)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Dec 2021 02:59:34 -0800", "from silpixa00401086.ir.intel.com (HELO localhost.localdomain)\n ([10.55.129.110])\n by orsmga008.jf.intel.com with ESMTP; 10 Dec 2021 02:59:33 -0800" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=simple/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1639133976; x=1670669976;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=K3XJfyOJpZEs2fsITEAeqnt2O16bOCsodGElPmeHUJA=;\n b=hR3+VKOSG8YfX6neFgNWCiPa5bU+5LjzmSNBkqjCGMHboQ+IIoSls4xi\n yie5bBdymjMv72G6u9s8awqPMdlbScc36OnGE4hw6OvfJ0RjMXRNV68tk\n 2lMMsWunip7LiZVLArCjuyFHBsgNfM8pT1c3PFQue+1ufm/IFKIJ/Rja1\n P7tdNig7gvDG4FviwwB7NDqrnVDQyUkZtfvgE6q5yrZrDoqhj5TNvikLy\n Fzj4jRWCpsrWsrkqKT033bc9lnxDE2hFSoEem73eNMbrjI1KIyy5bGSK1\n ExnT4DQH1F+TmWxhXY86k7gfiG+jVzZy0tWDh5b0CppWlc66Y7Pm0JMOE A==;", "X-IronPort-AV": [ "E=McAfee;i=\"6200,9189,10193\"; a=\"235839349\"", "E=Sophos;i=\"5.88,195,1635231600\"; d=\"scan'208\";a=\"235839349\"", "E=Sophos;i=\"5.88,195,1635231600\"; d=\"scan'208\";a=\"516717681\"" ], "X-ExtLoop1": "1", "From": "Ciara Loftus <ciara.loftus@intel.com>", "To": "dev@dpdk.org", "Cc": "Ciara Loftus <ciara.loftus@intel.com>", "Subject": "[RFC PATCH] net/af_xdp: use libxdp if available", "Date": "Fri, 10 Dec 2021 10:58:53 +0000", "Message-Id": "<20211210105853.38161-1-ciara.loftus@intel.com>", "X-Mailer": "git-send-email 2.17.1", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "8bit", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <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>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org" }, "content": "AF_XDP support is deprecated in libbpf since v0.7.0 [1]. The\nlibxdp library now provides the functionality which once was in\nlibbpf and which the AF_XDP PMD relies on. This commit updates the\nAF_XDP meson build to use the libxdp library if available. If it\nis not available, only versions of libbpf prior to v0.7.0 are\nallowed, as they still contain the required AF_XDP functionality.\n\nlibbpf still remains a dependency even if libxdp is present, as we\nuse libbpf APIs for program loading.\n\n[1] https://github.com/libbpf/libbpf/commit/277846bc6c15\n\nSigned-off-by: Ciara Loftus <ciara.loftus@intel.com>\n---\n doc/guides/nics/af_xdp.rst | 4 +--\n doc/guides/rel_notes/release_22_03.rst | 4 +++\n drivers/net/af_xdp/compat.h | 4 +++\n drivers/net/af_xdp/meson.build | 45 +++++++++++++++++++++-----\n drivers/net/af_xdp/rte_eth_af_xdp.c | 1 -\n 5 files changed, 46 insertions(+), 12 deletions(-)", "diff": "diff --git a/doc/guides/nics/af_xdp.rst b/doc/guides/nics/af_xdp.rst\nindex c9d0e1ad6c..966f713c11 100644\n--- a/doc/guides/nics/af_xdp.rst\n+++ b/doc/guides/nics/af_xdp.rst\n@@ -43,9 +43,7 @@ Prerequisites\n This is a Linux-specific PMD, thus the following prerequisites apply:\n \n * A Linux Kernel (version > v4.18) with XDP sockets configuration enabled;\n-* libbpf (within kernel version > v5.1-rc4) with latest af_xdp support installed,\n- User can install libbpf via `make install_lib` && `make install_headers` in\n- <kernel src tree>/tools/lib/bpf;\n+* Both libxdp and libbpf libraries installed, or, libbpf <=v0.6.0\n * A Kernel bound interface to attach to;\n * For need_wakeup feature, it requires kernel version later than v5.3-rc1;\n * For PMD zero copy, it requires kernel version later than v5.4-rc1;\ndiff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst\nindex 6d99d1eaa9..acf0f66fa8 100644\n--- a/doc/guides/rel_notes/release_22_03.rst\n+++ b/doc/guides/rel_notes/release_22_03.rst\n@@ -55,6 +55,10 @@ New Features\n Also, make sure to start the actual text at the margin.\n =======================================================\n \n+* **Update AF_XDP PMD**\n+\n+ * Added libxdp support.\n+\n \n Removed Items\n -------------\ndiff --git a/drivers/net/af_xdp/compat.h b/drivers/net/af_xdp/compat.h\nindex 3880dc7dd7..245df1b109 100644\n--- a/drivers/net/af_xdp/compat.h\n+++ b/drivers/net/af_xdp/compat.h\n@@ -2,7 +2,11 @@\n * Copyright(c) 2020 Intel Corporation.\n */\n \n+#ifdef RTE_LIBRTE_AF_XDP_PMD_LIBXDP\n+#include <xdp/xsk.h>\n+#else\n #include <bpf/xsk.h>\n+#endif\n #include <linux/version.h>\n #include <poll.h>\n \ndiff --git a/drivers/net/af_xdp/meson.build b/drivers/net/af_xdp/meson.build\nindex 3ed2b29784..dc4f53352e 100644\n--- a/drivers/net/af_xdp/meson.build\n+++ b/drivers/net/af_xdp/meson.build\n@@ -9,19 +9,48 @@ endif\n \n sources = files('rte_eth_af_xdp.c')\n \n+xdp_dep = dependency('libxdp', required: false, method: 'pkg-config')\n+if not xdp_dep.found()\n+ xdp_dep = cc.find_library('xdp', required: false)\n+endif\n+\n bpf_dep = dependency('libbpf', required: false, method: 'pkg-config')\n if not bpf_dep.found()\n bpf_dep = cc.find_library('bpf', required: false)\n endif\n \n-if bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('linux/if_xdp.h')\n- ext_deps += bpf_dep\n- bpf_ver_dep = dependency('libbpf', version : '>=0.2.0',\n- required: false, method: 'pkg-config')\n- if bpf_ver_dep.found()\n- dpdk_conf.set('RTE_LIBRTE_AF_XDP_PMD_SHARED_UMEM', 1)\n+if cc.has_header('linux/if_xdp.h')\n+ if xdp_dep.found() and cc.has_header('xdp/xsk.h')\n+ if bpf_dep.found() and cc.has_header('bpf/bpf.h')\n+ dpdk_conf.set('RTE_LIBRTE_AF_XDP_PMD_LIBXDP', 1)\n+ dpdk_conf.set('RTE_LIBRTE_AF_XDP_PMD_SHARED_UMEM', 1)\n+ ext_deps += xdp_dep\n+ ext_deps += bpf_dep\n+ else\n+ build = false\n+ reason = 'missing dependency, libbpf'\n+ endif\n+ elif bpf_dep.found() and cc.has_header('bpf/xsk.h') and cc.has_header('bpf/bpf.h')\n+ # libxdp not found. Rely solely on libbpf for xsk functionality\n+ # which is only available in versions <= v0.6.0.\n+ bpf_ver_dep = dependency('libbpf', version : '<=0.6.0',\n+ required: false, method: 'pkg-config')\n+ if bpf_ver_dep.found()\n+ ext_deps += bpf_dep\n+ bpf_shumem_ver_dep = dependency('libbpf', version : '>=0.2.0',\n+ required: false, method: 'pkg-config')\n+ if bpf_shumem_ver_dep.found()\n+ dpdk_conf.set('RTE_LIBRTE_AF_XDP_PMD_SHARED_UMEM', 1)\n+ endif\n+ else\n+ build = false\n+ reason = 'missing dependency, \"libxdp\" or \"libbpf <= v0.6.0\"'\n+ endif\n+ else\n+ build = false\n+ reason = 'missing dependency, \"libxdp\" and \"libbpf\"'\n endif\n else\n build = false\n- reason = 'missing dependency, \"libbpf\"'\n-endif\n+ reason = 'missing header, \"linux/if_xdp.h\"'\n+endif\n\\ No newline at end of file\ndiff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c\nindex 96c2c9d939..5d89bebb01 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -16,7 +16,6 @@\n #include <linux/sockios.h>\n #include \"af_xdp_deps.h\"\n #include <bpf/bpf.h>\n-#include <bpf/xsk.h>\n \n #include <rte_ethdev.h>\n #include <ethdev_driver.h>\n", "prefixes": [ "RFC" ] }{ "id": 105062, "url": "