get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/136752/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 136752,
    "url": "http://patchwork.dpdk.org/api/patches/136752/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20240214160716.2391286-3-mtahhan@redhat.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": "<20240214160716.2391286-3-mtahhan@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240214160716.2391286-3-mtahhan@redhat.com",
    "date": "2024-02-14T16:06:48",
    "name": "[v8,2/3] net/af_xdp: fix multi interface support for K8s",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a605e7ec675dc9966469b64319f1e0403a6e9268",
    "submitter": {
        "id": 3236,
        "url": "http://patchwork.dpdk.org/api/people/3236/?format=api",
        "name": "Maryam Tahhan",
        "email": "mtahhan@redhat.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/20240214160716.2391286-3-mtahhan@redhat.com/mbox/",
    "series": [
        {
            "id": 31106,
            "url": "http://patchwork.dpdk.org/api/series/31106/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=31106",
            "date": "2024-02-14T16:06:46",
            "name": "net/af_xdp: fix multi interface support for K8s",
            "version": 8,
            "mbox": "http://patchwork.dpdk.org/series/31106/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/136752/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/136752/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 1FF5A43B38;\n\tWed, 14 Feb 2024 17:07:38 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 677E2427DF;\n\tWed, 14 Feb 2024 17:07:30 +0100 (CET)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id 1A43840E72\n for <dev@dpdk.org>; Wed, 14 Feb 2024 17:07:27 +0100 (CET)",
            "from mail-qt1-f199.google.com (mail-qt1-f199.google.com\n [209.85.160.199]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-106-d8oapCDEPHOAI0EaWOnTzQ-1; Wed, 14 Feb 2024 11:07:26 -0500",
            "by mail-qt1-f199.google.com with SMTP id\n d75a77b69052e-42c6fa2059cso43981101cf.1\n for <dev@dpdk.org>; Wed, 14 Feb 2024 08:07:26 -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 x22-20020ac87316000000b0042c7d4a8ce0sm2120155qto.3.2024.02.14.08.07.23\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 14 Feb 2024 08:07:23 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1707926847;\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=VIIhc1VSO3wt4tEdpW44hPlZHvihzCKZY+39vRHBE9g=;\n b=KV6qInXtRr4T0kLm93m5QOuweqnxld2u8L57oVMz1jWGDO036z4N1d2KBjlQGqYIF5rbkx\n EkyyNubocf24AX6Gw4CkuNsob7YDn6gCvddtwZBy41ChCZVEOzfq8cJvP8CpQ+3E96GGjz\n 1BYkfVZgxxWBU8wW04sQM9pZ40PMJx0=",
        "X-MC-Unique": "d8oapCDEPHOAI0EaWOnTzQ-1",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1707926845; x=1708531645;\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=VIIhc1VSO3wt4tEdpW44hPlZHvihzCKZY+39vRHBE9g=;\n b=dFJmmhBLdEFpp6CsBfEd7IWs9egcA/NDA46d55QUBgui49uSHaEm9w797wFojy58RB\n z51xsOBNFWISWTZjKXTuZ44UdLLe9flpAcJfKzYlZ01+ViLPhXm2Zr4X8FbPV25/i909\n Ld/2LBONxFk8TlLbeEdmd3hczJSmWRAnRTLDoZz3ab6SSOKtczD4TVnkTGDZXzLBONIY\n xuB/LX565P9u/Nmy0T1TP92mXCIGEWdSuO4l3K1UJ0BbnWntXP+jqECyn0ICPgdo3suS\n yMCoSpR/gvwYO0mZYocr875g0xA/oC4e+8Q2/l0mLENjktUweBQxIPKsEJO7Iot3eNR6\n 9MAA==",
        "X-Gm-Message-State": "AOJu0YxBf/TogUBcNL4i2/7a59d3dQit7hdowsJS9uwoRnr1jYm7KgWI\n styGUQoIzYQFja5xoGCYBdF3EJzUL0Hy1HSIHK0UxTkuTkXEq/U4azfLqFXWdNjzQPNoBReSCL1\n AzH1krxudlDlvspEMQma3ynf+zi4zIp3bMz574/Fd",
        "X-Received": [
            "by 2002:a05:622a:181a:b0:42d:a9e0:52e7 with SMTP id\n t26-20020a05622a181a00b0042da9e052e7mr3109388qtc.36.1707926845504;\n Wed, 14 Feb 2024 08:07:25 -0800 (PST)",
            "by 2002:a05:622a:181a:b0:42d:a9e0:52e7 with SMTP id\n t26-20020a05622a181a00b0042da9e052e7mr3109351qtc.36.1707926845073;\n Wed, 14 Feb 2024 08:07:25 -0800 (PST)"
        ],
        "X-Google-Smtp-Source": "\n AGHT+IHvNtw8EJVv/cwmKcGsKSuel/pBQv+E7o78KNNTf1cSopoOxt4vO7if2I3ZHZWvCDAaseWXRQ==",
        "X-Forwarded-Encrypted": "i=1;\n AJvYcCXWbXf1ldpQC6q/I160SDXtQTXM32fK0XiEBDCsrmcXm3tqByZE4jnUykwMSqGtgkD/6JQ/X1hAfyuWtNtPBADK9lo+GYHcvaXv2EJdOx/nx4dAmN+7nLq0GZGvN3lybMvgMqi05hoAayg8XiwDyJfvTtcCtKuJKdq6DPRv4mDhsyUE95G+hkWW8/zQO+A4JsSyJN4l1DElijzx3OWmQLyQuparlAn49ud/a+7PqQD7oIlcJHaAos1KD3KSl31QjI6NbTCINULlyV14E03JMTaeaVBh3LTuJ5bj8BoOuuNeybLAB8RXU/NFHY9pjr3nQYPJOW6X9jjmrzJ9j9oWWgj6WZUeSSnufkbDZA==",
        "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": "[v8 2/3] net/af_xdp: fix multi interface support for K8s",
        "Date": "Wed, 14 Feb 2024 11:06:48 -0500",
        "Message-ID": "<20240214160716.2391286-3-mtahhan@redhat.com>",
        "X-Mailer": "git-send-email 2.41.0",
        "In-Reply-To": "<20240214160716.2391286-1-mtahhan@redhat.com>",
        "References": "<20240214160716.2391286-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": "The original 'use_cni' implementation, was added\nto enable support for the AF_XDP PMD in a K8s env\nwithout any escalated privileges.\nHowever 'use_cni' used a hardcoded socket rather\nthan a configurable one. If a DPDK pod is requesting\nmultiple net devices and these devices are from\ndifferent pools, then the AF_XDP PMD attempts to\nmount all the netdev UDSes in the pod as /tmp/afxdp.sock.\nWhich means that at best only 1 netdev will handshake\ncorrectly with the AF_XDP DP. This patch addresses\nthis by making the socket parameter configurable using\na new vdev param called 'dp_path' alongside the\noriginal 'use_cni' param. If the 'dp_path' parameter\nis not set alongside the 'use_cni' parameter, then\nit's configured inside the AF_XDP PMD (transparently\nto the user). This change has been tested\nwith the AF_XDP DP PR 81[1], with both single and\nmultiple interfaces.\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_dp.rst         | 43 ++++++++++--\n doc/guides/nics/af_xdp.rst             | 14 ++++\n doc/guides/rel_notes/release_24_03.rst |  7 ++\n drivers/net/af_xdp/rte_eth_af_xdp.c    | 92 ++++++++++++++++----------\n 4 files changed, 115 insertions(+), 41 deletions(-)",
    "diff": "diff --git a/doc/guides/howto/af_xdp_dp.rst b/doc/guides/howto/af_xdp_dp.rst\nindex 657fc8d52c..8a64ec5599 100644\n--- a/doc/guides/howto/af_xdp_dp.rst\n+++ b/doc/guides/howto/af_xdp_dp.rst\n@@ -52,13 +52,18 @@ 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+The EAL vdev argument ``dp_path`` is used alongside the ``use_cni`` argument\n+to explicitly tell the AF_XDP PMD where to find the UDS to interact with the\n+AF_XDP Device Plugin. If this argument is not passed alongside the ``use_cni``\n+argument then the AF_XDP PMD configures it internally.\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+is only compatible with the `AF_XDP Device Plugin for Kubernetes`_  up to\n+commit id `38317c2`_ and the pod is limited to a single netdev.\n \n .. note::\n \n@@ -75,6 +80,14 @@ in the PMD alongside the `use_cni` parameter.\n \n .. _38317c2: https://github.com/intel/afxdp-plugins-for-kubernetes/commit/38317c256b5c7dfb39e013a0f76010c2ded03669\n \n+.. note::\n+\n+    The introduction of the ``dp_path`` EAL vdev argument fixes the limitation above. If a\n+    user doesn't explicitly set the ``dp_path``parameter when using ``use_cni`` then that\n+    path is transparently configured in the AF_XDP PMD to the default\n+    `AF_XDP Device Plugin for Kubernetes`_ mount point path. This is compatible with the latest\n+    AF_XDP Device Plugin. For backwards compatibility with versions of the AF_XDP DP <= commit\n+    id `38317c2`_ please explicitly set ``dp_path`` to ``/tmp/afxdp.sock``.\n \n Prerequisites\n -------------\n@@ -105,10 +118,10 @@ Device Plugin and DPDK container prerequisites:\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+    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@@ -284,7 +297,7 @@ Run dpdk-testpmd with the AF_XDP Device Plugin + CNI\n         emptyDir:\n           medium: HugePages\n \n-  For further reference please use the `pod.yaml`_\n+  For further reference please see the `pod.yaml`_\n \n   .. _pod.yaml: https://github.com/intel/afxdp-plugins-for-kubernetes/blob/main/examples/pod-spec.yaml\n \n@@ -297,3 +310,19 @@ Run dpdk-testpmd with the AF_XDP Device Plugin + CNI\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;\n+\n+  Or\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>,dp_path=\"/tmp/afxdp_dp/<interface name>/afxdp.sock\" \\\n+           --no-mlockall --in-memory \\\n+           -- -i --a --nb-cores=2 --rxq=1 --txq=1 --forward-mode=macswap;\n+\n+.. note::\n+\n+    If the ``dp_path`` parameter isn't explicitly set (like the example above)\n+    the AF_XDP PMD will set the parameter value to\n+    ``/tmp/afxdp_dp/<<interface name>>/afxdp.sock``.\ndiff --git a/doc/guides/nics/af_xdp.rst b/doc/guides/nics/af_xdp.rst\nindex 4dd9c73742..7f8651beda 100644\n--- a/doc/guides/nics/af_xdp.rst\n+++ b/doc/guides/nics/af_xdp.rst\n@@ -171,6 +171,20 @@ enable the `AF_XDP Device Plugin for Kubernetes`_ with a DPDK application/pod.\n    so enabling and disabling of the promiscuous mode through the DPDK application\n    is also not supported.\n \n+dp_path\n+~~~~~~~\n+\n+The EAL vdev argument ``dp_path`` is used alongside the ``use_cni`` argument\n+to explicitly tell the AF_XDP PMD where to find the UDS to interact with the\n+`AF_XDP Device Plugin for Kubernetes`_. If this argument is not passed\n+alongside the ``use_cni`` argument then the AF_XDP PMD configures it internally.\n+\n+.. _AF_XDP Device Plugin for Kubernetes: https://github.com/intel/afxdp-plugins-for-kubernetes\n+\n+.. code-block:: console\n+\n+   --vdev=net_af_xdp0,use_cni=1,dp_path=\"/tmp/afxdp_dp/<<interface name>>/afxdp.sock\"\n+\n Limitations\n -----------\n \ndiff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst\nindex 6f8ad27808..7f3653ad6f 100644\n--- a/doc/guides/rel_notes/release_24_03.rst\n+++ b/doc/guides/rel_notes/release_24_03.rst\n@@ -55,6 +55,13 @@ New Features\n      Also, make sure to start the actual text at the margin.\n      =======================================================\n \n+* **Enabled AF_XDP PMD multi interface (UDS) support with AF_XDP Device Plugin**.\n+\n+  The EAL vdev argument for the AF_XDP PMD ``use_cni`` previously limited\n+  a pod to using only a single netdev/interface. The latest changes (adding\n+  the ``dp_path`` parameter) remove this limitation and maintain backward\n+  compatibility for any applications already using the ``use_cni`` vdev\n+  argument with the AF_XDP Device Plugin.\n \n Removed Items\n -------------\ndiff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c\nindex 353c8688ec..6be8badf54 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -83,12 +83,13 @@ RTE_LOG_REGISTER_DEFAULT(af_xdp_logtype, NOTICE);\n \n #define ETH_AF_XDP_MP_KEY \"afxdp_mp_send_fds\"\n \n+#define DP_BASE_PATH\t\t\t\"/tmp/afxdp_dp\"\n+#define DP_UDS_SOCK             \"afxdp.sock\"\n #define MAX_LONG_OPT_SZ\t\t\t64\n #define UDS_MAX_FD_NUM\t\t\t2\n #define UDS_MAX_CMD_LEN\t\t\t64\n #define UDS_MAX_CMD_RESP\t\t128\n #define UDS_XSK_MAP_FD_MSG\t\t\"/xsk_map_fd\"\n-#define UDS_SOCK\t\t\t\"/tmp/afxdp.sock\"\n #define UDS_CONNECT_MSG\t\t\t\"/connect\"\n #define UDS_HOST_OK_MSG\t\t\t\"/host_ok\"\n #define UDS_HOST_NAK_MSG\t\t\"/host_nak\"\n@@ -171,6 +172,7 @@ struct pmd_internals {\n \tbool custom_prog_configured;\n \tbool force_copy;\n \tbool use_cni;\n+\tchar dp_path[PATH_MAX];\n \tstruct bpf_map *map;\n \n \tstruct rte_ether_addr eth_addr;\n@@ -191,6 +193,7 @@ struct pmd_process_private {\n #define ETH_AF_XDP_BUDGET_ARG\t\t\t\"busy_budget\"\n #define ETH_AF_XDP_FORCE_COPY_ARG\t\t\"force_copy\"\n #define ETH_AF_XDP_USE_CNI_ARG\t\t\t\"use_cni\"\n+#define ETH_AF_XDP_DP_PATH_ARG\t\t\t\"dp_path\"\n \n static const char * const valid_arguments[] = {\n \tETH_AF_XDP_IFACE_ARG,\n@@ -201,6 +204,7 @@ static const char * const valid_arguments[] = {\n \tETH_AF_XDP_BUDGET_ARG,\n \tETH_AF_XDP_FORCE_COPY_ARG,\n \tETH_AF_XDP_USE_CNI_ARG,\n+\tETH_AF_XDP_DP_PATH_ARG,\n \tNULL\n };\n \n@@ -1351,7 +1355,7 @@ configure_preferred_busy_poll(struct pkt_rx_queue *rxq)\n }\n \n static int\n-init_uds_sock(struct sockaddr_un *server)\n+init_uds_sock(struct sockaddr_un *server, const char *dp_path)\n {\n \tint sock;\n \n@@ -1362,7 +1366,7 @@ init_uds_sock(struct sockaddr_un *server)\n \t}\n \n \tserver->sun_family = AF_UNIX;\n-\tstrlcpy(server->sun_path, UDS_SOCK, sizeof(server->sun_path));\n+\tstrlcpy(server->sun_path, dp_path, sizeof(server->sun_path));\n \n \tif (connect(sock, (struct sockaddr *)server, sizeof(struct sockaddr_un)) < 0) {\n \t\tclose(sock);\n@@ -1382,7 +1386,7 @@ struct msg_internal {\n };\n \n static int\n-send_msg(int sock, char *request, int *fd)\n+send_msg(int sock, char *request, int *fd, const char *dp_path)\n {\n \tint snd;\n \tstruct iovec iov;\n@@ -1393,7 +1397,7 @@ send_msg(int sock, char *request, int *fd)\n \n \tmemset(&dst, 0, sizeof(dst));\n \tdst.sun_family = AF_UNIX;\n-\tstrlcpy(dst.sun_path, UDS_SOCK, sizeof(dst.sun_path));\n+\tstrlcpy(dst.sun_path, dp_path, sizeof(dst.sun_path));\n \n \t/* Initialize message header structure */\n \tmemset(&msgh, 0, sizeof(msgh));\n@@ -1470,8 +1474,8 @@ read_msg(int sock, char *response, struct sockaddr_un *s, int *fd)\n }\n \n static int\n-make_request_cni(int sock, struct sockaddr_un *server, char *request,\n-\t\t int *req_fd, char *response, int *out_fd)\n+make_request_dp(int sock, struct sockaddr_un *server, char *request,\n+\t\t int *req_fd, char *response, int *out_fd, const char *dp_path)\n {\n \tint rval;\n \n@@ -1483,7 +1487,7 @@ make_request_cni(int sock, struct sockaddr_un *server, char *request,\n \tif (req_fd == NULL)\n \t\trval = write(sock, request, strlen(request));\n \telse\n-\t\trval = send_msg(sock, request, req_fd);\n+\t\trval = send_msg(sock, request, req_fd, dp_path);\n \n \tif (rval < 0) {\n \t\tAF_XDP_LOG(ERR, \"Write error %s\\n\", strerror(errno));\n@@ -1507,7 +1511,7 @@ check_response(char *response, char *exp_resp, long size)\n }\n \n static int\n-get_cni_fd(char *if_name)\n+uds_get_xskmap_fd(char *if_name, const char *dp_path)\n {\n \tchar request[UDS_MAX_CMD_LEN], response[UDS_MAX_CMD_RESP];\n \tchar hostname[MAX_LONG_OPT_SZ], exp_resp[UDS_MAX_CMD_RESP];\n@@ -1520,14 +1524,14 @@ get_cni_fd(char *if_name)\n \t\treturn -1;\n \n \tmemset(&server, 0, sizeof(server));\n-\tsock = init_uds_sock(&server);\n+\tsock = init_uds_sock(&server, dp_path);\n \tif (sock < 0)\n \t\treturn -1;\n \n-\t/* Initiates handshake to CNI send: /connect,hostname */\n+\t/* Initiates handshake to the AF_XDP Device Plugin send: /connect,hostname */\n \tsnprintf(request, sizeof(request), \"%s,%s\", UDS_CONNECT_MSG, hostname);\n \tmemset(response, 0, sizeof(response));\n-\tif (make_request_cni(sock, &server, request, NULL, response, &out_fd) < 0) {\n+\tif (make_request_dp(sock, &server, request, NULL, response, &out_fd, dp_path) < 0) {\n \t\tAF_XDP_LOG(ERR, \"Error in processing cmd [%s]\\n\", request);\n \t\tgoto err_close;\n \t}\n@@ -1541,7 +1545,7 @@ get_cni_fd(char *if_name)\n \t/* Request for \"/version\" */\n \tstrlcpy(request, UDS_VERSION_MSG, UDS_MAX_CMD_LEN);\n \tmemset(response, 0, sizeof(response));\n-\tif (make_request_cni(sock, &server, request, NULL, response, &out_fd) < 0) {\n+\tif (make_request_dp(sock, &server, request, NULL, response, &out_fd, dp_path) < 0) {\n \t\tAF_XDP_LOG(ERR, \"Error in processing cmd [%s]\\n\", request);\n \t\tgoto err_close;\n \t}\n@@ -1549,7 +1553,7 @@ get_cni_fd(char *if_name)\n \t/* Request for file descriptor for netdev name*/\n \tsnprintf(request, sizeof(request), \"%s,%s\", UDS_XSK_MAP_FD_MSG, if_name);\n \tmemset(response, 0, sizeof(response));\n-\tif (make_request_cni(sock, &server, request, NULL, response, &out_fd) < 0) {\n+\tif (make_request_dp(sock, &server, request, NULL, response, &out_fd, dp_path) < 0) {\n \t\tAF_XDP_LOG(ERR, \"Error in processing cmd [%s]\\n\", request);\n \t\tgoto err_close;\n \t}\n@@ -1571,7 +1575,7 @@ get_cni_fd(char *if_name)\n \t/* Initiate close connection */\n \tstrlcpy(request, UDS_FIN_MSG, UDS_MAX_CMD_LEN);\n \tmemset(response, 0, sizeof(response));\n-\tif (make_request_cni(sock, &server, request, NULL, response, &out_fd) < 0) {\n+\tif (make_request_dp(sock, &server, request, NULL, response, &out_fd, dp_path) < 0) {\n \t\tAF_XDP_LOG(ERR, \"Error in processing cmd [%s]\\n\", request);\n \t\tgoto err_close;\n \t}\n@@ -1695,17 +1699,16 @@ xsk_configure(struct pmd_internals *internals, struct pkt_rx_queue *rxq,\n \t}\n \n \tif (internals->use_cni) {\n-\t\tint err, fd, map_fd;\n+\t\tint err, map_fd;\n \n-\t\t/* get socket fd from CNI plugin */\n-\t\tmap_fd = get_cni_fd(internals->if_name);\n+\t\t/* get socket fd from AF_XDP Device Plugin */\n+\t\tmap_fd = uds_get_xskmap_fd(internals->if_name, internals->dp_path);\n \t\tif (map_fd < 0) {\n-\t\t\tAF_XDP_LOG(ERR, \"Failed to receive CNI plugin fd\\n\");\n+\t\t\tAF_XDP_LOG(ERR, \"Failed to receive xskmap fd from AF_XDP Device Plugin\\n\");\n \t\t\tgoto out_xsk;\n \t\t}\n-\t\t/* get socket fd */\n-\t\tfd = xsk_socket__fd(rxq->xsk);\n-\t\terr = bpf_map_update_elem(map_fd, &rxq->xsk_queue_idx, &fd, 0);\n+\n+\t\terr = xsk_socket__update_xskmap(rxq->xsk, map_fd);\n \t\tif (err) {\n \t\t\tAF_XDP_LOG(ERR, \"Failed to insert unprivileged xsk in map.\\n\");\n \t\t\tgoto out_xsk;\n@@ -1881,13 +1884,13 @@ static const struct eth_dev_ops ops = {\n \t.get_monitor_addr = eth_get_monitor_addr,\n };\n \n-/* CNI option works in unprivileged container environment\n- * and ethernet device functionality will be reduced. So\n- * additional customiszed eth_dev_ops struct is needed\n- * for cni. Promiscuous enable and disable functionality\n- * is removed.\n+/* AF_XDP Device Plugin option works in unprivileged\n+ * container environments and ethernet device functionality\n+ * will be reduced. So additional customised eth_dev_ops\n+ * struct is needed for the Device Plugin. Promiscuous\n+ * enable and disable functionality is removed.\n  **/\n-static const struct eth_dev_ops ops_cni = {\n+static const struct eth_dev_ops ops_afxdp_dp = {\n \t.dev_start = eth_dev_start,\n \t.dev_stop = eth_dev_stop,\n \t.dev_close = eth_dev_close,\n@@ -2023,7 +2026,8 @@ xdp_get_channels_info(const char *if_name, int *max_queues,\n static int\n parse_parameters(struct rte_kvargs *kvlist, char *if_name, int *start_queue,\n \t\t int *queue_cnt, int *shared_umem, char *prog_path,\n-\t\t int *busy_budget, int *force_copy, int *use_cni)\n+\t\t int *busy_budget, int *force_copy, int *use_cni,\n+\t\t char *dp_path)\n {\n \tint ret;\n \n@@ -2069,6 +2073,11 @@ parse_parameters(struct rte_kvargs *kvlist, char *if_name, int *start_queue,\n \tif (ret < 0)\n \t\tgoto free_kvlist;\n \n+\tret = rte_kvargs_process(kvlist, ETH_AF_XDP_DP_PATH_ARG,\n+\t\t\t\t &parse_prog_arg, dp_path);\n+\tif (ret < 0)\n+\t\tgoto free_kvlist;\n+\n free_kvlist:\n \trte_kvargs_free(kvlist);\n \treturn ret;\n@@ -2108,7 +2117,7 @@ static struct rte_eth_dev *\n init_internals(struct rte_vdev_device *dev, const char *if_name,\n \t       int start_queue_idx, int queue_cnt, int shared_umem,\n \t       const char *prog_path, int busy_budget, int force_copy,\n-\t       int use_cni)\n+\t       int use_cni, const char *dp_path)\n {\n \tconst char *name = rte_vdev_device_name(dev);\n \tconst unsigned int numa_node = dev->device.numa_node;\n@@ -2138,6 +2147,7 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,\n \tinternals->shared_umem = shared_umem;\n \tinternals->force_copy = force_copy;\n \tinternals->use_cni = use_cni;\n+    strlcpy(internals->dp_path, dp_path, PATH_MAX);\n \n \tif (xdp_get_channels_info(if_name, &internals->max_queue_cnt,\n \t\t\t\t  &internals->combined_queue_cnt)) {\n@@ -2199,7 +2209,7 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,\n \tif (!internals->use_cni)\n \t\teth_dev->dev_ops = &ops;\n \telse\n-\t\teth_dev->dev_ops = &ops_cni;\n+\t\teth_dev->dev_ops = &ops_afxdp_dp;\n \n \teth_dev->rx_pkt_burst = eth_af_xdp_rx;\n \teth_dev->tx_pkt_burst = eth_af_xdp_tx;\n@@ -2328,6 +2338,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)\n \tint busy_budget = -1, ret;\n \tint force_copy = 0;\n \tint use_cni = 0;\n+    char dp_path[PATH_MAX] = {'\\0'};\n \tstruct rte_eth_dev *eth_dev = NULL;\n \tconst char *name = rte_vdev_device_name(dev);\n \n@@ -2370,7 +2381,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)\n \n \tif (parse_parameters(kvlist, if_name, &xsk_start_queue_idx,\n \t\t\t     &xsk_queue_cnt, &shared_umem, prog_path,\n-\t\t\t     &busy_budget, &force_copy, &use_cni) < 0) {\n+\t\t\t     &busy_budget, &force_copy, &use_cni, dp_path) < 0) {\n \t\tAF_XDP_LOG(ERR, \"Invalid kvargs value\\n\");\n \t\treturn -EINVAL;\n \t}\n@@ -2387,6 +2398,18 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)\n \t\t\treturn -EINVAL;\n \t}\n \n+\tif (use_cni && !strnlen(dp_path, PATH_MAX)) {\n+\t\tsnprintf(dp_path, sizeof(dp_path), \"%s/%s/%s\", DP_BASE_PATH, if_name, DP_UDS_SOCK);\n+\t\tAF_XDP_LOG(INFO, \"'%s' parameter not provided, setting value to '%s'\\n\",\n+\t\t\tETH_AF_XDP_DP_PATH_ARG, dp_path);\n+\t}\n+\n+    if (!use_cni && strnlen(dp_path, PATH_MAX)) {\n+\t\tAF_XDP_LOG(ERR, \"'%s' parameter is set, but '%s' was not enabled\\n\",\n+\t\t\tETH_AF_XDP_DP_PATH_ARG, ETH_AF_XDP_USE_CNI_ARG);\n+\t\t\treturn -EINVAL;\n+\t}\n+\n \tif (strlen(if_name) == 0) {\n \t\tAF_XDP_LOG(ERR, \"Network interface must be specified\\n\");\n \t\treturn -EINVAL;\n@@ -2410,7 +2433,7 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)\n \n \teth_dev = init_internals(dev, if_name, xsk_start_queue_idx,\n \t\t\t\t xsk_queue_cnt, shared_umem, prog_path,\n-\t\t\t\t busy_budget, force_copy, use_cni);\n+\t\t\t\t busy_budget, force_copy, use_cni, dp_path);\n \tif (eth_dev == NULL) {\n \t\tAF_XDP_LOG(ERR, \"Failed to init internals\\n\");\n \t\treturn -1;\n@@ -2471,4 +2494,5 @@ RTE_PMD_REGISTER_PARAM_STRING(net_af_xdp,\n \t\t\t      \"xdp_prog=<string> \"\n \t\t\t      \"busy_budget=<int> \"\n \t\t\t      \"force_copy=<int> \"\n-\t\t\t      \"use_cni=<int> \");\n+\t\t\t      \"use_cni=<int> \"\n+\t\t\t      \"dp_path=<string> \");\n",
    "prefixes": [
        "v8",
        "2/3"
    ]
}