Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/137488/?format=api
http://patches.dpdk.org/api/patches/137488/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240229130212.343036-2-mtahhan@redhat.com/", "project": { "id": 1, "url": "http://patches.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": "<20240229130212.343036-2-mtahhan@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20240229130212.343036-2-mtahhan@redhat.com", "date": "2024-02-29T13:01:22", "name": "[v10,1/3] docs: AF_XDP Device Plugin", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "6f2e7934ad751cfa054f7b2ab8415fab8c90b322", "submitter": { "id": 3236, "url": "http://patches.dpdk.org/api/people/3236/?format=api", "name": "Maryam Tahhan", "email": "mtahhan@redhat.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240229130212.343036-2-mtahhan@redhat.com/mbox/", "series": [ { "id": 31295, "url": "http://patches.dpdk.org/api/series/31295/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31295", "date": "2024-02-29T13:01:21", "name": "net/af_xdp: fix multi interface support for K8s", "version": 10, "mbox": "http://patches.dpdk.org/series/31295/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/137488/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/137488/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 90C4843C39;\n\tThu, 29 Feb 2024 14:02:29 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E75BF42D2A;\n\tThu, 29 Feb 2024 14:02:22 +0100 (CET)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id 1B8CD410D3\n for <dev@dpdk.org>; Thu, 29 Feb 2024 14:02:21 +0100 (CET)", "from mail-qk1-f197.google.com (mail-qk1-f197.google.com\n [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-317-Mkbcix9bM3iECq4oZvuAQQ-1; Thu, 29 Feb 2024 08:02:19 -0500", "by mail-qk1-f197.google.com with SMTP id\n af79cd13be357-787b03ea2b4so96927685a.0\n for <dev@dpdk.org>; Thu, 29 Feb 2024 05:02:19 -0800 (PST)", "from nfvsdn-06.redhat.com (nat-pool-232-132.redhat.com.\n [66.187.232.132]) by smtp.gmail.com with ESMTPSA id\n nz7-20020a0562143a8700b0068f71daf86bsm707907qvb.43.2024.02.29.05.02.16\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 29 Feb 2024 05:02:17 -0800 (PST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1709211740;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=DCl9GMX+djO4+6Pw6+YP9GrOL1H/g1c5P0w/rKZLbWM=;\n b=JQfCyDNEDn2lnApWJSzvbIKAmYXtr7AtVKvdow/OSeggBcNKyzKaenqSCFQ6Y2PvNOndHo\n EtBVZgvYK2JYYY2vw3X1G1Is/3brphsCmuD7XthuEE0qn5wa7nPVwVvqAx7Iay2xk6Kldz\n M204hq+AIufWfvxOlHJGiIqew1GRyaY=", "X-MC-Unique": "Mkbcix9bM3iECq4oZvuAQQ-1", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1709211739; x=1709816539;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=DCl9GMX+djO4+6Pw6+YP9GrOL1H/g1c5P0w/rKZLbWM=;\n b=wG/if19EDigh10S1sR89F5cPGWaBaBG7boXmLoNpf66bF53qR2R6Jxg2BDzxhB2Qt6\n secM6ZVNSGYMd2E7TpnBptu1rLLYRjXw2/aJaDTMSnwsOmQNdAqdFUAOSTQ/nC6bN2ji\n Y3WYAyTfOuurisJVlnjDR/aSbBfOo7p4nSvKBlpkXZm+xY0kjuMWUNQtmhAB6egh00y1\n 3bNuisj5Fi5Uvqb49xvJk15JQyRPn2+XpAy3teTrHw0P0jeHRclsDCGOpkZGmsAeu4zD\n mh16LYYh+lu0TagLfkxJA0YcCpXMPw4XFoEckkSWDbrWAF/1glxvbX0shfWRSSalS5L6\n BsCA==", "X-Gm-Message-State": "AOJu0YyvnCcTJQOWXu06sjuR4VKesUQKoF4IvuAIrtVIGpEl0D6UdFJQ\n mX/YrTapU4QgFwW0wmYbpiIB90WIDcUF9P0coZ7i+fFFbKXK2rJSBvom+FM/WYqgWdwPQBz7LeN\n gtzZS19GnAmvteDJLlBPCIFkjsqss7oPCuFyIXKcS", "X-Received": [ "by 2002:a05:6214:321:b0:68f:2a2b:c6e0 with SMTP id\n j1-20020a056214032100b0068f2a2bc6e0mr1946992qvu.64.1709211738338;\n Thu, 29 Feb 2024 05:02:18 -0800 (PST)", "by 2002:a05:6214:321:b0:68f:2a2b:c6e0 with SMTP id\n j1-20020a056214032100b0068f2a2bc6e0mr1946930qvu.64.1709211737665;\n Thu, 29 Feb 2024 05:02:17 -0800 (PST)" ], "X-Google-Smtp-Source": "\n AGHT+IFPyoWAybJFA22JZ4oWr9oL1Lh8wVBKaSsfp6EK5F9I1SQD84vzOeMrvNsGhx1jF/9epn1pjw==", "From": "Maryam Tahhan <mtahhan@redhat.com>", "To": "ferruh.yigit@amd.com, stephen@networkplumber.org, lihuisong@huawei.com,\n fengchengwen@huawei.com, liuyonglong@huawei.com, david.marchand@redhat.com,\n shibin.koikkara.reeny@intel.com, ciara.loftus@intel.com", "Cc": "dev@dpdk.org,\n\tMaryam Tahhan <mtahhan@redhat.com>,\n\tstable@dpdk.org", "Subject": "[v10 1/3] docs: AF_XDP Device Plugin", "Date": "Thu, 29 Feb 2024 08:01:22 -0500", "Message-ID": "<20240229130212.343036-2-mtahhan@redhat.com>", "X-Mailer": "git-send-email 2.41.0", "In-Reply-To": "<20240229130212.343036-1-mtahhan@redhat.com>", "References": "<20240229130212.343036-1-mtahhan@redhat.com>", "MIME-Version": "1.0", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true", "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": "Fixup the references to the AF_XDP Device Plugin in\nthe documentation (was referred to as CNI previously)\nand document the single netdev limitation for deploying\nan AF_XDP based DPDK pod. Also renames af_xdp_cni.rst to\naf_xdp_dp.rst\n\nFixes: 7fc6ae50369d (\"net/af_xdp: support CNI Integration\")\nCc: stable@dpdk.org\n\nSigned-off-by: Maryam Tahhan <mtahhan@redhat.com>\n---\n doc/guides/howto/af_xdp_cni.rst | 253 ---------------------------\n doc/guides/howto/af_xdp_dp.rst | 299 ++++++++++++++++++++++++++++++++\n doc/guides/howto/index.rst | 2 +-\n doc/guides/nics/af_xdp.rst | 4 +-\n 4 files changed, 302 insertions(+), 256 deletions(-)\n delete mode 100644 doc/guides/howto/af_xdp_cni.rst\n create mode 100644 doc/guides/howto/af_xdp_dp.rst", "diff": "diff --git a/doc/guides/howto/af_xdp_cni.rst b/doc/guides/howto/af_xdp_cni.rst\ndeleted file mode 100644\nindex a1a6d5b99c..0000000000\n--- a/doc/guides/howto/af_xdp_cni.rst\n+++ /dev/null\n@@ -1,253 +0,0 @@\n-.. SPDX-License-Identifier: BSD-3-Clause\n- Copyright(c) 2023 Intel Corporation.\n-\n-Using a CNI with the AF_XDP driver\n-==================================\n-\n-Introduction\n-------------\n-\n-CNI, the Container Network Interface, is a technology for configuring\n-container network interfaces\n-and which can be used to setup Kubernetes networking.\n-AF_XDP is a Linux socket Address Family that enables an XDP program\n-to redirect packets to a memory buffer in userspace.\n-\n-This document explains how to enable the `AF_XDP Plugin for Kubernetes`_ within\n-a DPDK application using the :doc:`../nics/af_xdp` to connect and use these technologies.\n-\n-.. _AF_XDP Plugin for Kubernetes: https://github.com/intel/afxdp-plugins-for-kubernetes\n-\n-\n-Background\n-----------\n-\n-The standard :doc:`../nics/af_xdp` initialization process involves loading an eBPF program\n-onto the kernel netdev to be used by the PMD.\n-This operation requires root or escalated Linux privileges\n-and thus prevents the PMD from working in an unprivileged container.\n-The AF_XDP CNI plugin handles this situation\n-by providing a device plugin that performs the program loading.\n-\n-At a technical level the CNI opens a Unix Domain Socket and listens for a client\n-to make requests over that socket.\n-A DPDK application acting as a client connects and initiates a configuration \"handshake\".\n-The client then receives a file descriptor which points to the XSKMAP\n-associated with the loaded eBPF program.\n-The XSKMAP is a BPF map of AF_XDP sockets (XSK).\n-The client can then proceed with creating an AF_XDP socket\n-and inserting that socket into the XSKMAP pointed to by the descriptor.\n-\n-The EAL vdev argument ``use_cni`` is used to indicate that the user wishes\n-to run the PMD in unprivileged mode and to receive the XSKMAP file descriptor\n-from the CNI.\n-When this flag is set,\n-the ``XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD`` libbpf flag\n-should be used when creating the socket\n-to instruct libbpf not to load the default libbpf program on the netdev.\n-Instead the loading is handled by the CNI.\n-\n-.. note::\n-\n- The Unix Domain Socket file path appear in the end user is \"/tmp/afxdp.sock\".\n-\n-\n-Prerequisites\n--------------\n-\n-Docker and container prerequisites:\n-\n-* Set up the device plugin\n- as described in the instructions for `AF_XDP Plugin for Kubernetes`_.\n-\n-* The Docker image should contain the libbpf and libxdp libraries,\n- which are dependencies for AF_XDP,\n- and should include support for the ``ethtool`` command.\n-\n-* The Pod should have enabled the capabilities ``CAP_NET_RAW`` and ``CAP_BPF``\n- for AF_XDP along with support for hugepages.\n-\n-* Increase locked memory limit so containers have enough memory for packet buffers.\n- For example:\n-\n- .. code-block:: console\n-\n- cat << EOF | sudo tee /etc/systemd/system/containerd.service.d/limits.conf\n- [Service]\n- LimitMEMLOCK=infinity\n- EOF\n-\n-* dpdk-testpmd application should have AF_XDP feature enabled.\n-\n- For further information see the docs for the: :doc:`../../nics/af_xdp`.\n-\n-\n-Example\n--------\n-\n-Howto run dpdk-testpmd with CNI plugin:\n-\n-* Clone the CNI plugin\n-\n- .. code-block:: console\n-\n- # git clone https://github.com/intel/afxdp-plugins-for-kubernetes.git\n-\n-* Build the CNI plugin\n-\n- .. code-block:: console\n-\n- # cd afxdp-plugins-for-kubernetes/\n- # make build\n-\n- .. note::\n-\n- CNI plugin has a dependence on the config.json.\n-\n- Sample Config.json\n-\n- .. code-block:: json\n-\n- {\n- \"logLevel\":\"debug\",\n- \"logFile\":\"afxdp-dp-e2e.log\",\n- \"pools\":[\n- {\n- \"name\":\"e2e\",\n- \"mode\":\"primary\",\n- \"timeout\":30,\n- \"ethtoolCmds\" : [\"-L -device- combined 1\"],\n- \"devices\":[\n- {\n- \"name\":\"ens785f0\"\n- }\n- ]\n- }\n- ]\n- }\n-\n- For further reference please use the `config.json`_\n-\n- .. _config.json: https://github.com/intel/afxdp-plugins-for-kubernetes/blob/v0.0.2/test/e2e/config.json\n-\n-* Create the Network Attachment definition\n-\n- .. code-block:: console\n-\n- # kubectl create -f nad.yaml\n-\n- Sample nad.yml\n-\n- .. code-block:: yaml\n-\n- apiVersion: \"k8s.cni.cncf.io/v1\"\n- kind: NetworkAttachmentDefinition\n- metadata:\n- name: afxdp-e2e-test\n- annotations:\n- k8s.v1.cni.cncf.io/resourceName: afxdp/e2e\n- spec:\n- config: '{\n- \"cniVersion\": \"0.3.0\",\n- \"type\": \"afxdp\",\n- \"mode\": \"cdq\",\n- \"logFile\": \"afxdp-cni-e2e.log\",\n- \"logLevel\": \"debug\",\n- \"ipam\": {\n- \"type\": \"host-local\",\n- \"subnet\": \"192.168.1.0/24\",\n- \"rangeStart\": \"192.168.1.200\",\n- \"rangeEnd\": \"192.168.1.216\",\n- \"routes\": [\n- { \"dst\": \"0.0.0.0/0\" }\n- ],\n- \"gateway\": \"192.168.1.1\"\n- }\n- }'\n-\n- For further reference please use the `nad.yaml`_\n-\n- .. _nad.yaml: https://github.com/intel/afxdp-plugins-for-kubernetes/blob/v0.0.2/test/e2e/nad.yaml\n-\n-* Build the Docker image\n-\n- .. code-block:: console\n-\n- # docker build -t afxdp-e2e-test -f Dockerfile .\n-\n- Sample Dockerfile:\n-\n- .. code-block:: console\n-\n- FROM ubuntu:20.04\n- RUN apt-get update -y\n- RUN apt install build-essential libelf-dev -y\n- RUN apt-get install iproute2 acl -y\n- RUN apt install python3-pyelftools ethtool -y\n- RUN apt install libnuma-dev libjansson-dev libpcap-dev net-tools -y\n- RUN apt-get install clang llvm -y\n- COPY ./libbpf<version>.tar.gz /tmp\n- RUN cd /tmp && tar -xvmf libbpf<version>.tar.gz && cd libbpf/src && make install\n- COPY ./libxdp<version>.tar.gz /tmp\n- RUN cd /tmp && tar -xvmf libxdp<version>.tar.gz && cd libxdp && make install\n-\n- .. note::\n-\n- All the files that need to COPY-ed should be in the same directory as the Dockerfile\n-\n-* Run the Pod\n-\n- .. code-block:: console\n-\n- # kubectl create -f pod.yaml\n-\n- Sample pod.yaml:\n-\n- .. code-block:: yaml\n-\n- apiVersion: v1\n- kind: Pod\n- metadata:\n- name: afxdp-e2e-test\n- annotations:\n- k8s.v1.cni.cncf.io/networks: afxdp-e2e-test\n- spec:\n- containers:\n- - name: afxdp\n- image: afxdp-e2e-test:latest\n- imagePullPolicy: Never\n- env:\n- - name: LD_LIBRARY_PATH\n- value: /usr/lib64/:/usr/local/lib/\n- command: [\"tail\", \"-f\", \"/dev/null\"]\n- securityContext:\n- capabilities:\n- add:\n- - CAP_NET_RAW\n- - CAP_BPF\n- resources:\n- requests:\n- hugepages-2Mi: 2Gi\n- memory: 2Gi\n- afxdp/e2e: '1'\n- limits:\n- hugepages-2Mi: 2Gi\n- memory: 2Gi\n- afxdp/e2e: '1'\n-\n- For further reference please use the `pod.yaml`_\n-\n- .. _pod.yaml: https://github.com/intel/afxdp-plugins-for-kubernetes/blob/v0.0.2/test/e2e/pod-1c1d.yaml\n-\n-* Run DPDK with a command like the following:\n-\n- .. code-block:: console\n-\n- kubectl exec -i <Pod name> --container <containers name> -- \\\n- /<Path>/dpdk-testpmd -l 0,1 --no-pci \\\n- --vdev=net_af_xdp0,use_cni=1,iface=<interface name> \\\n- -- --no-mlockall --in-memory\n-\n-For further reference please use the `e2e`_ test case in `AF_XDP Plugin for Kubernetes`_\n-\n- .. _e2e: https://github.com/intel/afxdp-plugins-for-kubernetes/tree/v0.0.2/test/e2e\ndiff --git a/doc/guides/howto/af_xdp_dp.rst b/doc/guides/howto/af_xdp_dp.rst\nnew file mode 100644\nindex 0000000000..7166d904bd\n--- /dev/null\n+++ b/doc/guides/howto/af_xdp_dp.rst\n@@ -0,0 +1,299 @@\n+.. SPDX-License-Identifier: BSD-3-Clause\n+ Copyright(c) 2023 Intel Corporation.\n+\n+Using the AF_XDP driver in Kubernetes\n+=====================================\n+\n+Introduction\n+------------\n+\n+Two infrastructure components are needed in order to provision a pod that is\n+using the AF_XDP PMD in Kubernetes:\n+\n+1. AF_XDP Device Plugin (DP).\n+2. AF_XDP Container Network Interface (CNI) binary.\n+\n+Both of these components are available through the `AF_XDP Device Plugin for Kubernetes`_\n+repository.\n+\n+The AF_XDP DP provisions and advertises networking interfaces to Kubernetes,\n+while the CNI configures and plumbs network interfaces for the Pod.\n+\n+This document explains how to use the `AF_XDP Device Plugin for Kubernetes`_ with\n+a DPDK application using the :doc:`../nics/af_xdp`.\n+\n+.. _AF_XDP Device Plugin for Kubernetes: https://github.com/intel/afxdp-plugins-for-kubernetes\n+\n+Background\n+----------\n+\n+The standard :doc:`../nics/af_xdp` initialization process involves loading an eBPF program\n+onto the kernel netdev to be used by the PMD.\n+This operation requires root or escalated Linux privileges\n+and thus prevents the PMD from working in an unprivileged container.\n+The AF_XDP Device Plugin handles this situation\n+by managing the eBPF program(s) on behalf of the Pod, outside of the pod context.\n+\n+At a technical level the AF_XDP Device Plugin opens a Unix Domain Socket (UDS) and listens for a client\n+to make requests over that socket.\n+A DPDK application acting as a client connects and initiates a configuration \"handshake\".\n+After some validation on the Device Plugin side, the client receives a file descriptor which points to the XSKMAP\n+associated with the loaded eBPF program.\n+The XSKMAP is an eBPF map of AF_XDP sockets (XSK).\n+The client can then proceed with creating an AF_XDP socket\n+and inserting that socket into the XSKMAP pointed to by the descriptor.\n+\n+The EAL vdev argument ``use_cni`` is used to indicate that the user wishes\n+to run the PMD in unprivileged mode and to receive the XSKMAP file descriptor\n+from the CNI.\n+When this flag is set,\n+the ``XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD`` libbpf flag\n+should be used when creating the socket\n+to instruct libbpf not to load the default libbpf program on the netdev.\n+Instead the loading is handled by the AF_XDP Device Plugin.\n+\n+Limitations\n+-----------\n+\n+For DPDK versions <= v23.11 the Unix Domain Socket file path appears in\n+the pod at \"/tmp/afxdp.sock\". The handshake implementation in the AF_XDP PMD\n+is only compatible with the AF_XDP Device Plugin up to commit id `38317c2`_\n+and the pod is limited to a single netdev.\n+\n+.. note::\n+\n+ DPDK AF_XDP PMD <= v23.11 will not work with the latest version of the\n+ AF_XDP Device Plugin.\n+\n+The issue is if a single pod requests different devices from different pools it\n+results in multiple UDS servers serving the pod with the container using only a\n+single mount point for their UDS as ``/tmp/afxdp.sock``. This means that at best one\n+device might be able to complete the handshake. This has been fixed in the AF_XDP\n+Device Plugin so that the mount point in the pods for the UDS appear at\n+``/tmp/afxdp_dp/<netdev>/afxdp.sock``. Later versions of DPDK fix this hardcoded path\n+in the PMD alongside the ``use_cni`` parameter.\n+\n+.. _38317c2: https://github.com/intel/afxdp-plugins-for-kubernetes/commit/38317c256b5c7dfb39e013a0f76010c2ded03669\n+\n+\n+Prerequisites\n+-------------\n+\n+Device Plugin and DPDK container prerequisites:\n+\n+* Create a DPDK container image.\n+\n+* Set up the device plugin and prepare the Pod Spec as described in\n+ the instructions for `AF_XDP Device Plugin for Kubernetes`_.\n+\n+* The Docker image should contain the libbpf and libxdp libraries,\n+ which are dependencies for AF_XDP,\n+ and should include support for the ``ethtool`` command.\n+\n+* The Pod should have enabled the capabilities ``CAP_NET_RAW`` for\n+ AF_XDP socket creation, ``IPC_LOCK`` for umem creation and\n+ ``CAP_BPF`` (for Kernel < 5.19) along with support for hugepages.\n+\n+ .. note::\n+\n+ For Kernel versions < 5.19, all BPF sys calls required CAP_BPF, to access maps shared\n+ between the eBFP program and the userspace program. Kernels >= 5.19, only requires CAP_BPF\n+ for map creation (BPF_MAP_CREATE) and loading programs (BPF_PROG_LOAD).\n+\n+* Increase locked memory limit so containers have enough memory for packet buffers.\n+ For example:\n+\n+ .. code-block:: console\n+\n+ cat << EOF | sudo tee /etc/systemd/system/containerd.service.d/limits.conf\n+ [Service]\n+ LimitMEMLOCK=infinity\n+ EOF\n+\n+* dpdk-testpmd application should have AF_XDP feature enabled.\n+\n+ For further information see the docs for the: :doc:`../../nics/af_xdp`.\n+\n+\n+Example\n+-------\n+\n+Build a DPDK container image (using Docker)\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+1. Create a Dockerfile (should be placed in top level DPDK directory):\n+\n+ .. code-block:: console\n+\n+ FROM fedora:38\n+\n+ # Setup container to build DPDK applications\n+ RUN dnf -y upgrade && dnf -y install \\\n+ libbsd-devel \\\n+ numactl-libs \\\n+ libbpf-devel \\\n+ libbpf \\\n+ meson \\\n+ ninja-build \\\n+ libxdp-devel \\\n+ libxdp \\\n+ numactl-devel \\\n+ python3-pyelftools \\\n+ python38 \\\n+ iproute\n+ RUN dnf groupinstall -y 'Development Tools'\n+\n+ # Create DPDK dir and copy over sources\n+ # Create DPDK dir and copy over sources\n+ COPY ./ /dpdk\n+ WORKDIR /dpdk\n+\n+ # Build DPDK\n+ RUN meson setup build\n+ RUN ninja -C build\n+\n+2. Build a DPDK container image (using Docker)\n+\n+ .. code-block:: console\n+\n+ # docker build -t dpdk -f Dockerfile\n+\n+Run dpdk-testpmd with the AF_XDP Device Plugin + CNI\n+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+* Clone the AF_XDP Device plugin and CNI\n+\n+ .. code-block:: console\n+\n+ # git clone https://github.com/intel/afxdp-plugins-for-kubernetes.git\n+\n+ .. note::\n+\n+ Ensure you have the AF_XDP Device Plugin + CNI prerequisites installed.\n+\n+* Build the AF_XDP Device plugin and CNI\n+\n+ .. code-block:: console\n+\n+ # cd afxdp-plugins-for-kubernetes/\n+ # make image\n+\n+* Make sure to modify the image used by the `daemonset.yml`_ file in the deployments directory with\n+ the following configuration:\n+\n+ .. _daemonset.yml : https://github.com/intel/afxdp-plugins-for-kubernetes/blob/main/deployments/daemonset.yml\n+\n+ .. code-block:: yaml\n+\n+ image: afxdp-device-plugin:latest\n+\n+ .. note::\n+\n+ This will select the AF_XDP DP image that was built locally. Detailed configuration\n+ options can be found in the AF_XDP Device Plugin `readme`_ .\n+\n+ .. _readme: https://github.com/intel/afxdp-plugins-for-kubernetes#readme\n+\n+* Deploy the AF_XDP Device Plugin and CNI\n+\n+ .. code-block:: console\n+\n+ # kubectl create -f deployments/daemonset.yml\n+\n+* Create the Network Attachment definition\n+\n+ .. code-block:: console\n+\n+ # kubectl create -f nad.yaml\n+\n+ Sample nad.yml\n+\n+ .. code-block:: yaml\n+\n+ apiVersion: \"k8s.cni.cncf.io/v1\"\n+ kind: NetworkAttachmentDefinition\n+ metadata:\n+ name: afxdp-network\n+ annotations:\n+ k8s.v1.cni.cncf.io/resourceName: afxdp/myPool\n+ spec:\n+ config: '{\n+ \"cniVersion\": \"0.3.0\",\n+ \"type\": \"afxdp\",\n+ \"mode\": \"primary\",\n+ \"logFile\": \"afxdp-cni.log\",\n+ \"logLevel\": \"debug\",\n+ \"ethtoolCmds\" : [\"-N -device- rx-flow-hash udp4 fn\",\n+ \"-N -device- flow-type udp4 dst-port 2152 action 22\"\n+ ],\n+ \"ipam\": {\n+ \"type\": \"host-local\",\n+ \"subnet\": \"192.168.1.0/24\",\n+ \"rangeStart\": \"192.168.1.200\",\n+ \"rangeEnd\": \"192.168.1.220\",\n+ \"routes\": [\n+ { \"dst\": \"0.0.0.0/0\" }\n+ ],\n+ \"gateway\": \"192.168.1.1\"\n+ }\n+ }'\n+\n+ For further reference please use the example provided by the AF_XDP DP `nad.yaml`_\n+\n+ .. _nad.yaml: https://github.com/intel/afxdp-plugins-for-kubernetes/blob/main/examples/network-attachment-definition.yaml\n+\n+* Run the Pod\n+\n+ .. code-block:: console\n+\n+ # kubectl create -f pod.yaml\n+\n+ Sample pod.yaml:\n+\n+ .. code-block:: yaml\n+\n+ apiVersion: v1\n+ kind: Pod\n+ metadata:\n+ name: dpdk\n+ annotations:\n+ k8s.v1.cni.cncf.io/networks: afxdp-network\n+ spec:\n+ containers:\n+ - name: testpmd\n+ image: dpdk:latest\n+ command: [\"tail\", \"-f\", \"/dev/null\"]\n+ securityContext:\n+ capabilities:\n+ add:\n+ - NET_RAW\n+ - IPC_LOCK\n+ resources:\n+ requests:\n+ afxdp/myPool: '1'\n+ limits:\n+ hugepages-1Gi: 2Gi\n+ cpu: 2\n+ memory: 256Mi\n+ afxdp/myPool: '1'\n+ volumeMounts:\n+ - name: hugepages\n+ mountPath: /dev/hugepages\n+ volumes:\n+ - name: hugepages\n+ emptyDir:\n+ medium: HugePages\n+\n+ For further reference please use the `pod.yaml`_\n+\n+ .. _pod.yaml: https://github.com/intel/afxdp-plugins-for-kubernetes/blob/main/examples/pod-spec.yaml\n+\n+* Run DPDK with a command like the following:\n+\n+ .. code-block:: console\n+\n+ kubectl exec -i <Pod name> --container <containers name> -- \\\n+ /<Path>/dpdk-testpmd -l 0,1 --no-pci \\\n+ --vdev=net_af_xdp0,use_cni=1,iface=<interface name> \\\n+ --no-mlockall --in-memory \\\n+ -- -i --a --nb-cores=2 --rxq=1 --txq=1 --forward-mode=macswap;\ndiff --git a/doc/guides/howto/index.rst b/doc/guides/howto/index.rst\nindex 71a3381c36..a7692e8a97 100644\n--- a/doc/guides/howto/index.rst\n+++ b/doc/guides/howto/index.rst\n@@ -8,7 +8,7 @@ HowTo Guides\n :maxdepth: 2\n :numbered:\n \n- af_xdp_cni\n+ af_xdp_dp\n lm_bond_virtio_sriov\n lm_virtio_vhost_user\n flow_bifurcation\ndiff --git a/doc/guides/nics/af_xdp.rst b/doc/guides/nics/af_xdp.rst\nindex 1932525d4d..4dd9c73742 100644\n--- a/doc/guides/nics/af_xdp.rst\n+++ b/doc/guides/nics/af_xdp.rst\n@@ -155,9 +155,9 @@ use_cni\n ~~~~~~~\n \n The EAL vdev argument ``use_cni`` is used to indicate that the user wishes to\n-enable the `AF_XDP Plugin for Kubernetes`_ within a DPDK application.\n+enable the `AF_XDP Device Plugin for Kubernetes`_ with a DPDK application/pod.\n \n-.. _AF_XDP Plugin for Kubernetes: https://github.com/intel/afxdp-plugins-for-kubernetes\n+.. _AF_XDP Device Plugin for Kubernetes: https://github.com/intel/afxdp-plugins-for-kubernetes\n \n .. code-block:: console\n \n", "prefixes": [ "v10", "1/3" ] }{ "id": 137488, "url": "