get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 105068,
    "url": "http://patches.dpdk.org/api/patches/105068/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211210153245.9505-1-ciara.loftus@intel.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": "<20211210153245.9505-1-ciara.loftus@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211210153245.9505-1-ciara.loftus@intel.com",
    "date": "2021-12-10T15:32:45",
    "name": "[RFC] net/af_xdp: reenable secondary process support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b2195c5f0a21f23426efc2158195f6638b983cf1",
    "submitter": {
        "id": 144,
        "url": "http://patches.dpdk.org/api/people/144/?format=api",
        "name": "Loftus, Ciara",
        "email": "ciara.loftus@intel.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/20211210153245.9505-1-ciara.loftus@intel.com/mbox/",
    "series": [
        {
            "id": 20913,
            "url": "http://patches.dpdk.org/api/series/20913/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=20913",
            "date": "2021-12-10T15:32:45",
            "name": "[RFC] net/af_xdp: reenable secondary process support",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/20913/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/105068/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/105068/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 4984AA0093;\n\tFri, 10 Dec 2021 16:32:59 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 0D5B64014F;\n\tFri, 10 Dec 2021 16:32:59 +0100 (CET)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by mails.dpdk.org (Postfix) with ESMTP id C09A940041\n for <dev@dpdk.org>; Fri, 10 Dec 2021 16:32:56 +0100 (CET)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 10 Dec 2021 07:32:55 -0800",
            "from silpixa00401086.ir.intel.com (HELO localhost.localdomain)\n ([10.55.129.110])\n by orsmga002.jf.intel.com with ESMTP; 10 Dec 2021 07:32:53 -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=1639150376; x=1670686376;\n h=from:to:cc:subject:date:message-id:mime-version:\n content-transfer-encoding;\n bh=5m5po86MIMHUDwi65LQpr/DzJr1F5jtv9FIorexkzuo=;\n b=KAAKJ94+YwIHVEBWk/bzBRY2ImMpb42BAksZ3xyS2ipkQ0QdB3ogC2bs\n YwoQmO6ayXLJsHnPPdLDN/dyoyoNBwfuCi0fgNFvfVu/OIf/kxYUa6l+y\n K+JTsnzqYgGf9VfSNYMar0W+QHs38JbyWW/2dh5bcFtuq1uJqC2S3tVCM\n azvCw49L9jNlIb8TFonLfzk3xpXUSNMpaFMI0QwyrOqfI58gzUZizL2g4\n M0BowAZBdNllr2B+iLxp/H5JkUBKYfjrlelpi4BYMFGD2J8EsMGYGdNb5\n UQpSEpEL3VsNhH5WIyaSloQpOZI0x7A6lFUy1i2WAZS1sq+hI72a0+No3 w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,10193\"; a=\"238588679\"",
            "E=Sophos;i=\"5.88,196,1635231600\"; d=\"scan'208\";a=\"238588679\"",
            "E=Sophos;i=\"5.88,196,1635231600\"; d=\"scan'208\";a=\"480758960\""
        ],
        "X-ExtLoop1": "1",
        "From": "Ciara Loftus <ciara.loftus@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "stephen@networkplumber.org,\n\tCiara Loftus <ciara.loftus@intel.com>",
        "Subject": "[RFC PATCH] net/af_xdp: reenable secondary process support",
        "Date": "Fri, 10 Dec 2021 15:32:45 +0000",
        "Message-Id": "<20211210153245.9505-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": "Secondary process support had been disabled for the AF_XDP PMD\nbecause there was no logic in place to share the AF_XDP socket\nfile descriptors between the processes. This commit introduces\nthis logic using the IPC APIs.\n\nSince AF_XDP rings are single-producer single-consumer, rx/tx\nin the secondary process is disabled. However other operations\nincluding retrieval of stats are permitted.\n\nSigned-off-by: Ciara Loftus <ciara.loftus@intel.com>\n---\n doc/guides/nics/af_xdp.rst             |   9 ++\n doc/guides/nics/features/af_xdp.ini    |   1 +\n doc/guides/rel_notes/release_22_03.rst |   4 +\n drivers/net/af_xdp/rte_eth_af_xdp.c    | 210 +++++++++++++++++++++++--\n 4 files changed, 210 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/doc/guides/nics/af_xdp.rst b/doc/guides/nics/af_xdp.rst\nindex c9d0e1ad6c..40ace58de0 100644\n--- a/doc/guides/nics/af_xdp.rst\n+++ b/doc/guides/nics/af_xdp.rst\n@@ -143,4 +143,13 @@ Limitations\n   NAPI context from a watchdog timer instead of from softirqs. More information\n   on this feature can be found at [1].\n \n+- **Secondary Processes**\n+\n+  Rx and Tx are not supported for secondary processes due to the single-producer\n+  single-consumer nature of the AF_XDP rings. However other operations including\n+  statistics retrieval are permitted.\n+  The maximum number of queues permitted for PMDs operating in this model is 8\n+  as this is the maximum number of fds that can be sent through the IPC APIs as\n+  defined by RTE_MP_MAX_FD_NUM.\n+\n   [1] https://lwn.net/Articles/837010/\n\\ No newline at end of file\ndiff --git a/doc/guides/nics/features/af_xdp.ini b/doc/guides/nics/features/af_xdp.ini\nindex 54b738e616..8e7e075aaf 100644\n--- a/doc/guides/nics/features/af_xdp.ini\n+++ b/doc/guides/nics/features/af_xdp.ini\n@@ -9,4 +9,5 @@ Power mgmt address monitor = Y\n MTU update           = Y\n Promiscuous mode     = Y\n Stats per queue      = Y\n+Multiprocess aware   = Y\n x86-64               = Y\ndiff --git a/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst\nindex 6d99d1eaa9..ec719e9738 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+* **Updated AF_XDP PMD.**\n+\n+  * Re-enabled secondary process support. RX/TX is not supported.\n+\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 96c2c9d939..8608a4f379 100644\n--- a/drivers/net/af_xdp/rte_eth_af_xdp.c\n+++ b/drivers/net/af_xdp/rte_eth_af_xdp.c\n@@ -81,6 +81,18 @@ RTE_LOG_REGISTER_DEFAULT(af_xdp_logtype, NOTICE);\n \n #define ETH_AF_XDP_ETH_OVERHEAD\t\t(RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN)\n \n+#define ETH_AF_XDP_MP_KEY \"afxdp_mp_send_fds\"\n+\n+static int afxdp_dev_count;\n+\n+/* Message header to synchronize fds via IPC */\n+struct ipc_hdr {\n+\tchar port_name[RTE_DEV_NAME_MAX_LEN];\n+\t/* The file descriptors are in the dedicated part\n+\t * of the Unix message to be translated by the kernel.\n+\t */\n+};\n+\n struct xsk_umem_info {\n \tstruct xsk_umem *umem;\n \tstruct rte_ring *buf_ring;\n@@ -148,6 +160,10 @@ struct pmd_internals {\n \tstruct pkt_tx_queue *tx_queues;\n };\n \n+struct pmd_process_private {\n+\tint rxq_xsk_fds[RTE_MAX_QUEUES_PER_PORT];\n+};\n+\n #define ETH_AF_XDP_IFACE_ARG\t\t\t\"iface\"\n #define ETH_AF_XDP_START_QUEUE_ARG\t\t\"start_queue\"\n #define ETH_AF_XDP_QUEUE_COUNT_ARG\t\t\"queue_count\"\n@@ -857,11 +873,12 @@ static int\n eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n {\n \tstruct pmd_internals *internals = dev->data->dev_private;\n+\tstruct pmd_process_private *process_private = dev->process_private;\n \tstruct xdp_statistics xdp_stats;\n \tstruct pkt_rx_queue *rxq;\n \tstruct pkt_tx_queue *txq;\n \tsocklen_t optlen;\n-\tint i, ret;\n+\tint i, ret, fd;\n \n \tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n \t\toptlen = sizeof(struct xdp_statistics);\n@@ -877,8 +894,9 @@ eth_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n \t\tstats->ibytes += stats->q_ibytes[i];\n \t\tstats->imissed += rxq->stats.rx_dropped;\n \t\tstats->oerrors += txq->stats.tx_dropped;\n-\t\tret = getsockopt(xsk_socket__fd(rxq->xsk), SOL_XDP,\n-\t\t\t\tXDP_STATISTICS, &xdp_stats, &optlen);\n+\t\tfd = process_private->rxq_xsk_fds[i];\n+\t\tret = fd >= 0 ? getsockopt(fd, SOL_XDP, XDP_STATISTICS,\n+\t\t\t\t\t   &xdp_stats, &optlen) : -1;\n \t\tif (ret != 0) {\n \t\t\tAF_XDP_LOG(ERR, \"getsockopt() failed for XDP_STATISTICS.\\n\");\n \t\t\treturn -1;\n@@ -945,8 +963,10 @@ eth_dev_close(struct rte_eth_dev *dev)\n \tstruct pkt_rx_queue *rxq;\n \tint i;\n \n-\tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n+\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n+\t\trte_free(dev->process_private);\n \t\treturn 0;\n+\t}\n \n \tAF_XDP_LOG(INFO, \"Closing AF_XDP ethdev on numa socket %u\\n\",\n \t\trte_socket_id());\n@@ -1351,6 +1371,7 @@ eth_rx_queue_setup(struct rte_eth_dev *dev,\n \t\t   struct rte_mempool *mb_pool)\n {\n \tstruct pmd_internals *internals = dev->data->dev_private;\n+\tstruct pmd_process_private *process_private = dev->process_private;\n \tstruct pkt_rx_queue *rxq;\n \tint ret;\n \n@@ -1389,6 +1410,8 @@ eth_rx_queue_setup(struct rte_eth_dev *dev,\n \trxq->fds[0].fd = xsk_socket__fd(rxq->xsk);\n \trxq->fds[0].events = POLLIN;\n \n+\tprocess_private->rxq_xsk_fds[rx_queue_id] = rxq->fds[0].fd;\n+\n \tdev->data->rx_queues[rx_queue_id] = rxq;\n \treturn 0;\n \n@@ -1690,6 +1713,7 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,\n {\n \tconst char *name = rte_vdev_device_name(dev);\n \tconst unsigned int numa_node = dev->device.numa_node;\n+\tstruct pmd_process_private *process_private;\n \tstruct pmd_internals *internals;\n \tstruct rte_eth_dev *eth_dev;\n \tint ret;\n@@ -1755,9 +1779,17 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,\n \tif (ret)\n \t\tgoto err_free_tx;\n \n+\tprocess_private = (struct pmd_process_private *)\n+\t\trte_zmalloc_socket(name, sizeof(struct pmd_process_private),\n+\t\t\t\t   RTE_CACHE_LINE_SIZE, numa_node);\n+\tif (process_private == NULL) {\n+\t\tAF_XDP_LOG(ERR, \"Failed to alloc memory for process private\\n\");\n+\t\tgoto err_free_tx;\n+\t}\n+\n \teth_dev = rte_eth_vdev_allocate(dev, 0);\n \tif (eth_dev == NULL)\n-\t\tgoto err_free_tx;\n+\t\tgoto err_free_pp;\n \n \teth_dev->data->dev_private = internals;\n \teth_dev->data->dev_link = pmd_link;\n@@ -1766,6 +1798,10 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,\n \teth_dev->dev_ops = &ops;\n \teth_dev->rx_pkt_burst = eth_af_xdp_rx;\n \teth_dev->tx_pkt_burst = eth_af_xdp_tx;\n+\teth_dev->process_private = process_private;\n+\n+\tfor (i = 0; i < queue_cnt; i++)\n+\t\tprocess_private->rxq_xsk_fds[i] = -1;\n \n #if defined(XDP_UMEM_UNALIGNED_CHUNK_FLAG)\n \tAF_XDP_LOG(INFO, \"Zero copy between umem and mbuf enabled.\\n\");\n@@ -1773,6 +1809,8 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,\n \n \treturn eth_dev;\n \n+err_free_pp:\n+\trte_free(process_private);\n err_free_tx:\n \trte_free(internals->tx_queues);\n err_free_rx:\n@@ -1782,6 +1820,115 @@ init_internals(struct rte_vdev_device *dev, const char *if_name,\n \treturn NULL;\n }\n \n+/* Secondary process requests rxq fds from primary. */\n+static int\n+afxdp_mp_request_fds(const char *name, struct rte_eth_dev *dev)\n+{\n+\tstruct pmd_process_private *process_private = dev->process_private;\n+\tstruct timespec timeout = {.tv_sec = 1, .tv_nsec = 0};\n+\tstruct rte_mp_msg request, *reply;\n+\tstruct rte_mp_reply replies;\n+\tstruct ipc_hdr *request_param = (struct ipc_hdr *)request.param;\n+\tint i, ret;\n+\n+\t/* Prepare the request */\n+\tmemset(&request, 0, sizeof(request));\n+\tstrlcpy(request.name, ETH_AF_XDP_MP_KEY, sizeof(request.name));\n+\tstrlcpy(request_param->port_name, name,\n+\t\tsizeof(request_param->port_name));\n+\trequest.len_param = sizeof(*request_param);\n+\n+\t/* Send the request and receive the reply */\n+\tAF_XDP_LOG(DEBUG, \"Sending IPC request for %s\\n\", name);\n+\tret = rte_mp_request_sync(&request, &replies, &timeout);\n+\tif (ret < 0 || replies.nb_received != 1) {\n+\t\tAF_XDP_LOG(ERR, \"Failed to request fds from primary: %d\",\n+\t\t\t   rte_errno);\n+\t\treturn -1;\n+\t}\n+\treply = replies.msgs;\n+\tAF_XDP_LOG(DEBUG, \"Received IPC reply for %s\\n\", name);\n+\tif (dev->data->nb_rx_queues != reply->num_fds) {\n+\t\tAF_XDP_LOG(ERR, \"Incorrect number of fds received: %d != %d\\n\",\n+\t\t\t   reply->num_fds, dev->data->nb_rx_queues);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tfor (i = 0; i < reply->num_fds; i++)\n+\t\tprocess_private->rxq_xsk_fds[i] = reply->fds[i];\n+\n+\tfree(reply);\n+\treturn 0;\n+}\n+\n+/* Primary process sends rxq fds to secondary. */\n+static int\n+afxdp_mp_send_fds(const struct rte_mp_msg *request, const void *peer)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tstruct pmd_process_private *process_private;\n+\tstruct rte_mp_msg reply;\n+\tconst struct ipc_hdr *request_param =\n+\t\t(const struct ipc_hdr *)request->param;\n+\tstruct ipc_hdr *reply_param =\n+\t\t(struct ipc_hdr *)reply.param;\n+\tconst char *request_name = request_param->port_name;\n+\tuint16_t port_id;\n+\tint i, ret;\n+\n+\tAF_XDP_LOG(DEBUG, \"Received IPC request for %s\\n\", request_name);\n+\n+\t/* Find the requested port */\n+\tret = rte_eth_dev_get_port_by_name(request_name, &port_id);\n+\tif (ret) {\n+\t\tAF_XDP_LOG(ERR, \"Failed to get port id for %s\\n\", request_name);\n+\t\treturn -1;\n+\t}\n+\tdev = &rte_eth_devices[port_id];\n+\tprocess_private = dev->process_private;\n+\n+\t/* Populate the reply with the xsk fd for each queue */\n+\treply.num_fds = 0;\n+\tif (dev->data->nb_rx_queues > RTE_MP_MAX_FD_NUM) {\n+\t\tAF_XDP_LOG(ERR, \"Number of rx queues (%d) exceeds max number of fds (%d)\\n\",\n+\t\t\t   dev->data->nb_rx_queues, RTE_MP_MAX_FD_NUM);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++)\n+\t\treply.fds[reply.num_fds++] = process_private->rxq_xsk_fds[i];\n+\n+\t/* Send the reply */\n+\tstrlcpy(reply.name, request->name, sizeof(reply.name));\n+\tstrlcpy(reply_param->port_name, request_name,\n+\t\tsizeof(reply_param->port_name));\n+\treply.len_param = sizeof(*reply_param);\n+\tAF_XDP_LOG(DEBUG, \"Sending IPC reply for %s\\n\", reply_param->port_name);\n+\tif (rte_mp_reply(&reply, peer) < 0) {\n+\t\tAF_XDP_LOG(ERR, \"Failed to reply to IPC request\\n\");\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n+/* Secondary proccess rx function. RX is disabled because rings are SPSC */\n+static uint16_t\n+eth_af_xdp_rx_noop(void *queue __rte_unused,\n+\t\tstruct rte_mbuf **bufs __rte_unused,\n+\t\tuint16_t nb_pkts __rte_unused)\n+{\n+\treturn 0;\n+}\n+\n+/* Secondary proccess tx function. TX is disabled because rings are SPSC */\n+static uint16_t\n+eth_af_xdp_tx_noop(void *queue __rte_unused,\n+\t\t\tstruct rte_mbuf **bufs __rte_unused,\n+\t\t\tuint16_t nb_pkts __rte_unused)\n+{\n+\treturn 0;\n+}\n+\n static int\n rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)\n {\n@@ -1791,19 +1938,39 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)\n \tint xsk_queue_cnt = ETH_AF_XDP_DFLT_QUEUE_COUNT;\n \tint shared_umem = 0;\n \tchar prog_path[PATH_MAX] = {'\\0'};\n-\tint busy_budget = -1;\n+\tint busy_budget = -1, ret;\n \tstruct rte_eth_dev *eth_dev = NULL;\n-\tconst char *name;\n+\tconst char *name = rte_vdev_device_name(dev);\n \n-\tAF_XDP_LOG(INFO, \"Initializing pmd_af_xdp for %s\\n\",\n-\t\trte_vdev_device_name(dev));\n+\tAF_XDP_LOG(INFO, \"Initializing pmd_af_xdp for %s\\n\", name);\n \n-\tname = rte_vdev_device_name(dev);\n \tif (rte_eal_process_type() == RTE_PROC_SECONDARY) {\n-\t\tAF_XDP_LOG(ERR, \"Failed to probe %s. \"\n-\t\t\t\t\"AF_XDP PMD does not support secondary processes.\\n\",\n-\t\t\t\tname);\n-\t\treturn -ENOTSUP;\n+\t\teth_dev = rte_eth_dev_attach_secondary(name);\n+\t\tif (eth_dev == NULL) {\n+\t\t\tAF_XDP_LOG(ERR, \"Failed to probe %s\\n\", name);\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t\teth_dev->dev_ops = &ops;\n+\t\teth_dev->device = &dev->device;\n+\t\teth_dev->rx_pkt_burst = eth_af_xdp_rx_noop;\n+\t\teth_dev->tx_pkt_burst = eth_af_xdp_tx_noop;\n+\t\teth_dev->process_private = (struct pmd_process_private *)\n+\t\t\trte_zmalloc_socket(name,\n+\t\t\t\t\t   sizeof(struct pmd_process_private),\n+\t\t\t\t\t   RTE_CACHE_LINE_SIZE,\n+\t\t\t\t\t   eth_dev->device->numa_node);\n+\t\tif (eth_dev->process_private == NULL) {\n+\t\t\tAF_XDP_LOG(ERR,\n+\t\t\t\t\"Failed to alloc memory for process private\\n\");\n+\t\t\treturn -ENOMEM;\n+\t\t}\n+\n+\t\t/* Obtain the xsk fds from the primary process. */\n+\t\tif (afxdp_mp_request_fds(name, eth_dev))\n+\t\t\treturn -1;\n+\n+\t\trte_eth_dev_probing_finish(eth_dev);\n+\t\treturn 0;\n \t}\n \n \tkvlist = rte_kvargs_parse(rte_vdev_device_args(dev), valid_arguments);\n@@ -1838,6 +2005,17 @@ rte_pmd_af_xdp_probe(struct rte_vdev_device *dev)\n \t\treturn -1;\n \t}\n \n+\t/* Register IPC callback which shares xsk fds from primary to secondary */\n+\tif (!afxdp_dev_count) {\n+\t\tret = rte_mp_action_register(ETH_AF_XDP_MP_KEY, afxdp_mp_send_fds);\n+\t\tif (ret < 0) {\n+\t\t\tAF_XDP_LOG(ERR, \"%s: Failed to register IPC callback: %s\",\n+\t\t\t\t   name, strerror(rte_errno));\n+\t\t\treturn -1;\n+\t\t}\n+\t}\n+\tafxdp_dev_count++;\n+\n \trte_eth_dev_probing_finish(eth_dev);\n \n \treturn 0;\n@@ -1860,6 +2038,10 @@ rte_pmd_af_xdp_remove(struct rte_vdev_device *dev)\n \t\treturn 0;\n \n \teth_dev_close(eth_dev);\n+\trte_free(eth_dev->process_private);\n+\tif (afxdp_dev_count == 1)\n+\t\trte_mp_action_unregister(ETH_AF_XDP_MP_KEY);\n+\tafxdp_dev_count--;\n \trte_eth_dev_release_port(eth_dev);\n \n \n",
    "prefixes": [
        "RFC"
    ]
}