get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 47031,
    "url": "http://patches.dpdk.org/api/patches/47031/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1539850509-9332-3-git-send-email-rasland@mellanox.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": "<1539850509-9332-3-git-send-email-rasland@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1539850509-9332-3-git-send-email-rasland@mellanox.com",
    "date": "2018-10-18T08:15:09",
    "name": "[v9,3/3] net/tap: allow secondary process to access primary device queues",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "5b902c99d25f47e6976f73c75542ad4ed77782a0",
    "submitter": {
        "id": 513,
        "url": "http://patches.dpdk.org/api/people/513/?format=api",
        "name": "Raslan Darawsheh",
        "email": "rasland@mellanox.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1539850509-9332-3-git-send-email-rasland@mellanox.com/mbox/",
    "series": [
        {
            "id": 1969,
            "url": "http://patches.dpdk.org/api/series/1969/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1969",
            "date": "2018-10-18T08:15:07",
            "name": "[v9,1/3] net/tap: add queue and port ids in Rx/Tx queues structures",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/1969/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/47031/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/47031/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 03EFE1B123;\n\tThu, 18 Oct 2018 10:15:32 +0200 (CEST)",
            "from EUR03-DB5-obe.outbound.protection.outlook.com\n\t(mail-eopbgr40041.outbound.protection.outlook.com [40.107.4.41])\n\tby dpdk.org (Postfix) with ESMTP id 6178F7D4E\n\tfor <dev@dpdk.org>; Thu, 18 Oct 2018 10:15:25 +0200 (CEST)",
            "from mellanox.com (37.142.13.130) by\n\tAM3PR05MB1250.eurprd05.prod.outlook.com (2a01:111:e400:586f::12) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.26;\n\tThu, 18 Oct 2018 08:15:22 +0000"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n\ts=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=DDBOZZufpitdYa1M7Ff9eHfb+UbgaDpPN2s6cXsLEDc=;\n\tb=R6AmTkc2Yz/OXMI5viHINQrqUdemveSTWKx9NdzUXavTgtW2wh+wCQ62X3jc62VfxuRBvWrncpLZnaahETYLUtu/KMRXgax84KqcdS9wsPrcP+VZGVXANai8bmUpt2Mh3S/enPqCG+2yi6hjX13BCerMy/PK+fCHL9VLifH9RDg=",
        "Authentication-Results": "spf=none (sender IP is )\n\tsmtp.mailfrom=rasland@mellanox.com; ",
        "From": "Raslan Darawsheh <rasland@mellanox.com>",
        "To": "keith.wiles@intel.com",
        "Cc": "thomas@monjalon.net, dev@dpdk.org, shahafs@mellanox.com,\n\trasland@mellanox.com, orika@mellanox.com, ferruh.yigit@intel.com",
        "Date": "Thu, 18 Oct 2018 11:15:09 +0300",
        "Message-Id": "<1539850509-9332-3-git-send-email-rasland@mellanox.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1539850509-9332-1-git-send-email-rasland@mellanox.com>",
        "References": "<1539182356-15496-2-git-send-email-rasland@mellanox.com>\n\t<1539850509-9332-1-git-send-email-rasland@mellanox.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[37.142.13.130]",
        "X-ClientProxiedBy": "CWLP265CA0376.GBRP265.PROD.OUTLOOK.COM\n\t(2603:10a6:401:5e::28) To AM3PR05MB1250.eurprd05.prod.outlook.com\n\t(2a01:111:e400:586f::12)",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-Office365-Filtering-Correlation-Id": "892051ce-c40a-476b-53a6-08d634d1da6e",
        "X-MS-Office365-Filtering-HT": "Tenant",
        "X-Microsoft-Antispam": "BCL:0; PCL:0;\n\tRULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);\n\tSRVR:AM3PR05MB1250; ",
        "X-Microsoft-Exchange-Diagnostics": [
            "1; AM3PR05MB1250;\n\t3:AuAgB2Q+gc4j4EYtl07UQ/cIicBZfeKOwd9+FeSd6nA0299VXnHyDfVAlbK/Vju6e6rDDp0b7KXMLCrXhVx05tFoUT4OiagzJvT8qGiMStEpY+121jYmpVVKc8vmDLpLXEPI7uSbo0sC5fSbkWmhJe34eXoxWhMHErjgcdsEWKjVElE3LVwSsqNQPhIc1Q98LT2B85Pvr5nlwWmvGq0PYAN8WQfoUF7pPLepfygh2H2S7ADsrvMp6vTz6AmI3q6w;\n\t25:QlRlb+Rbou5qv7l9RO38MBDKLuE0EoflRaPOAdaQe4K0Aq7/lB5vya73uLJUTxKj1s46ZlzMT3z+GnfGrWGihqTLmfNnU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hardtgvhEFuLYvn8uYePwmB2OQ==;\n\t5:tIcvFpArun30bZEO8+1fUFpgDuiXgoiT/atWJr8WX4hojaGChFtVLT3yoVy0J0wj2309Y6zsPKVPbSoWqwuTXiIA//OhSz3sJJVVMMuWXt27CYneZ0OsZwixVAO+wGSJO3suTTPGDQS8b7vswq1Rgujq1wEetsKnjSHYGlEpy6g=;\n\t7:NCF/qgv0vek7p/9oIji8QGHsi1IAitf11CpSWp3poRFVCLWZHAkATq4Mewl4mMzIah1kLX4XxTeAxtFXZ/5oKnkBGByMnoceKjkkUQJeb9Fvlys8Bi79GmDVfj7bjkeE5u7WQGoErgfHjdVEDaCw6FXE8NcuHgCBQWNhR9FuTAzdVj8cA8o8kACkcsSGnBllAhFz2vDM2Onp3Xi9Xbo/lh240ENDv8xikX8jRNndORV5u4A4BfzxPpZAGm/qXYU6"
        ],
        "X-MS-TrafficTypeDiagnostic": "AM3PR05MB1250:",
        "X-LD-Processed": "a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr",
        "X-Microsoft-Antispam-PRVS": "<AM3PR05MB1250320D04C6B533EDFA9A55C2F80@AM3PR05MB1250.eurprd05.prod.outlook.com>",
        "X-Exchange-Antispam-Report-Test": "UriScan:(72170088055959);",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-Exchange-Antispam-Report-CFA-Test": "BCL:0; PCL:0;\n\tRULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(4982022)(52105095)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(201708071742011)(7699051)(76991095);\n\tSRVR:AM3PR05MB1250; BCL:0; PCL:0; RULEID:; SRVR:AM3PR05MB1250; ",
        "X-Forefront-PRVS": "08296C9B35",
        "X-Forefront-Antispam-Report": "SFV:NSPM;\n\tSFS:(10009020)(376002)(396003)(136003)(346002)(39860400002)(366004)(199004)(189003)(7736002)(16586007)(966005)(2361001)(6306002)(26005)(8886007)(305945005)(4326008)(6916009)(186003)(68736007)(55016002)(5660300001)(53936002)(2616005)(16526019)(478600001)(25786009)(14444005)(2351001)(50466002)(105586002)(5024004)(106356001)(69596002)(956004)(2906002)(33026002)(316002)(47776003)(476003)(76176011)(21086003)(48376002)(8936002)(11346002)(81156014)(50226002)(446003)(52116002)(66066001)(4744004)(36756003)(7696005)(6666004)(8676002)(6116002)(486006)(3846002)(51416003)(97736004)(86362001)(81166006)(386003);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:AM3PR05MB1250; H:mellanox.com; FPR:;\n\tSPF:None; \n\tLANG:en; PTR:InfoNoRecords; A:1; MX:1; ",
        "Received-SPF": "None (protection.outlook.com: mellanox.com does not designate\n\tpermitted sender hosts)",
        "X-Microsoft-Antispam-Message-Info": "FjZcSDSaUsaY9viZ5JIlNsdZxHIj68jTS1eZSJSktcd3wJb1NBZMQk0qTBCJf/fsB6iJKeaie04xPabG4Yw9sz0VaFZcUD1PSN5TjybIG5cL4LZrwlnKt7ZbEd6/Gd2w2UCPS1QbJJLYu2THgjR4ARvnMAsiLajh+JQjuk0STfHn8afx7vw/1hz+tadNyWDKYFG1IuCJFEkR5UCXOELyfN7080sC6lurBJQojD9Cry2pfnCzoYu44s2sB1NaqT9DK5rvjk+oZRfknXVlVQDfzPp9pCoSZd0DVnzJ5e6DwG/OloompmBhJ1ItUOJws27HbaxxzCmUOiZXX2nVvvLyOsA83pYRq/W3CGv95d/3FZs=",
        "SpamDiagnosticOutput": "1:99",
        "SpamDiagnosticMetadata": "NSPM",
        "X-OriginatorOrg": "Mellanox.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "18 Oct 2018 08:15:22.9610\n\t(UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "892051ce-c40a-476b-53a6-08d634d1da6e",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "Hosted",
        "X-MS-Exchange-CrossTenant-Id": "a652971c-7d2e-4d9b-a6a4-d149256f461b",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM3PR05MB1250",
        "Subject": "[dpdk-dev] [PATCH v9 3/3] net/tap: allow secondary process to\n\taccess primary device queues",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "In the case the device is created by the primary process,\nthe secondary must request some file descriptors to attach the queues.\nThe file descriptors are shared via IPC Unix socket.\n\nThanks to the IPC synchronization, the secondary process\nis now able to do Rx/Tx on a TAP created by the primary process.\n\nSigned-off-by: Raslan Darawsheh <rasland@mellanox.com>\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n\n---\n    v2:\n       - translate file descriptors via IPC API\n       - add documentation\n    v3:\n       - rabse the commit\n       - use private static array for fd's to be local for each process\n\n    v4:\n       - removed TODO and FIXME tags\n       - used strlcpy instead of strcpy\n\n    v5: rebase the commit on top of Alejandro Lucero patch for secondary\n        process private pointer.\n        http://patches.dpdk.org/patch/46185/\n\n    v6: reword the commit log\n\n    v7: rely on tap_device_count for registration\n    v8: fix the fail recovery\n    v9: sent the good fix for the fail recovery\n---\n---\n doc/guides/nics/tap.rst                |  16 ++++\n doc/guides/rel_notes/release_18_11.rst |   5 ++\n drivers/net/tap/Makefile               |   1 +\n drivers/net/tap/meson.build            |   1 +\n drivers/net/tap/rte_eth_tap.c          | 154 ++++++++++++++++++++++++++++++++-\n 5 files changed, 176 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/doc/guides/nics/tap.rst b/doc/guides/nics/tap.rst\nindex 2714868..9a3d7b3 100644\n--- a/doc/guides/nics/tap.rst\n+++ b/doc/guides/nics/tap.rst\n@@ -152,6 +152,22 @@ Distribute IPv4 TCP packets using RSS to a given MAC address over queues 0-3::\n    testpmd> flow create 0 priority 4 ingress pattern eth dst is 0a:0b:0c:0d:0e:0f \\\n             / ipv4 / tcp / end actions rss queues 0 1 2 3 end / end\n \n+Multi-process sharing\n+---------------------\n+\n+It is possible to attach an existing TAP device in a secondary process,\n+by declaring it as a vdev with the same name as in the primary process,\n+and without any parameter.\n+\n+The port attached in a secondary process will give access to the\n+statistics and the queues.\n+Therefore it can be used for monitoring or Rx/Tx processing.\n+\n+The IPC synchronization of Rx/Tx queues is currently limited:\n+\n+  - Maximum 8 queues shared\n+  - Synchronized on probing, but not on later port update\n+\n Example\n -------\n \ndiff --git a/doc/guides/rel_notes/release_18_11.rst b/doc/guides/rel_notes/release_18_11.rst\nindex 2133a5b..3240b52 100644\n--- a/doc/guides/rel_notes/release_18_11.rst\n+++ b/doc/guides/rel_notes/release_18_11.rst\n@@ -104,6 +104,11 @@ New Features\n   the specified port. The port must be stopped before the command call in order\n   to reconfigure queues.\n \n+* **Added TAP Rx/Tx queues sharing with a secondary process.**\n+\n+  A secondary process can attach a TAP device created in the primary process,\n+  probe the queues, and process Rx/Tx in a secondary process.\n+\n \n API Changes\n -----------\ndiff --git a/drivers/net/tap/Makefile b/drivers/net/tap/Makefile\nindex 3243365..7748283 100644\n--- a/drivers/net/tap/Makefile\n+++ b/drivers/net/tap/Makefile\n@@ -22,6 +22,7 @@ CFLAGS += -O3\n CFLAGS += -I$(SRCDIR)\n CFLAGS += -I.\n CFLAGS += $(WERROR_FLAGS)\n+CFLAGS += -DALLOW_EXPERIMENTAL_API\n LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring\n LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_hash\n LDLIBS += -lrte_bus_vdev -lrte_gso\ndiff --git a/drivers/net/tap/meson.build b/drivers/net/tap/meson.build\nindex 37f65b7..f7e8852 100644\n--- a/drivers/net/tap/meson.build\n+++ b/drivers/net/tap/meson.build\n@@ -35,6 +35,7 @@ args = [\n \t  'TCA_ACT_BPF_FD' ],\n ]\n config = configuration_data()\n+allow_experimental_apis = true\n foreach arg:args\n \tconfig.set(arg[0], cc.has_header_symbol(arg[1], arg[2]))\n endforeach\ndiff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex 3372d54..09171b3 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -16,6 +16,8 @@\n #include <rte_debug.h>\n #include <rte_ip.h>\n #include <rte_string_fns.h>\n+#include <rte_ethdev.h>\n+#include <rte_errno.h>\n \n #include <assert.h>\n #include <sys/types.h>\n@@ -62,6 +64,10 @@\n #define TAP_GSO_MBUFS_NUM \\\n \t(TAP_GSO_MBUFS_PER_CORE * TAP_GSO_MBUF_CACHE_SIZE)\n \n+/* IPC key for queue fds sync */\n+#define TAP_MP_KEY \"tap_mp_sync_queues\"\n+\n+static int tap_devices_count;\n static struct rte_vdev_driver pmd_tap_drv;\n static struct rte_vdev_driver pmd_tun_drv;\n \n@@ -100,6 +106,17 @@ enum ioctl_mode {\n \tREMOTE_ONLY,\n };\n \n+/* Message header to synchronize queues via IPC */\n+struct ipc_queues {\n+\tchar port_name[RTE_DEV_NAME_MAX_LEN];\n+\tint rxq_count;\n+\tint txq_count;\n+\t/*\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 static int tap_intr_handle_set(struct rte_eth_dev *dev, int set);\n \n /**\n@@ -2006,6 +2023,102 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)\n \treturn ret;\n }\n \n+/* Request queue file descriptors from secondary to primary. */\n+static int\n+tap_mp_attach_queues(const char *port_name, struct rte_eth_dev *dev)\n+{\n+\tint ret;\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_queues *request_param = (struct ipc_queues *)request.param;\n+\tstruct ipc_queues *reply_param;\n+\tstruct pmd_process_private *process_private = dev->process_private;\n+\tint queue, fd_iterator;\n+\n+\t/* Prepare the request */\n+\tstrlcpy(request.name, TAP_MP_KEY, sizeof(request.name));\n+\tstrlcpy(request_param->port_name, port_name,\n+\t\tsizeof(request_param->port_name));\n+\trequest.len_param = sizeof(*request_param);\n+\t/* Send request and receive reply */\n+\tret = rte_mp_request_sync(&request, &replies, &timeout);\n+\tif (ret < 0) {\n+\t\tTAP_LOG(ERR, \"Failed to request queues from primary: %d\",\n+\t\t\trte_errno);\n+\t\treturn -1;\n+\t}\n+\treply = &replies.msgs[0];\n+\treply_param = (struct ipc_queues *)reply->param;\n+\tTAP_LOG(DEBUG, \"Received IPC reply for %s\", reply_param->port_name);\n+\n+\t/* Attach the queues from received file descriptors */\n+\tdev->data->nb_rx_queues = reply_param->rxq_count;\n+\tdev->data->nb_tx_queues = reply_param->txq_count;\n+\tfd_iterator = 0;\n+\tfor (queue = 0; queue < reply_param->rxq_count; queue++)\n+\t\tprocess_private->rxq_fds[queue] = reply->fds[fd_iterator++];\n+\tfor (queue = 0; queue < reply_param->txq_count; queue++)\n+\t\tprocess_private->txq_fds[queue] = reply->fds[fd_iterator++];\n+\n+\treturn 0;\n+}\n+\n+/* Send the queue file descriptors from the primary process to secondary. */\n+static int\n+tap_mp_sync_queues(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_queues *request_param =\n+\t\t(const struct ipc_queues *)request->param;\n+\tstruct ipc_queues *reply_param =\n+\t\t(struct ipc_queues *)reply.param;\n+\tuint16_t port_id;\n+\tint queue;\n+\tint ret;\n+\n+\t/* Get requested port */\n+\tTAP_LOG(DEBUG, \"Received IPC request for %s\", request_param->port_name);\n+\tret = rte_eth_dev_get_port_by_name(request_param->port_name, &port_id);\n+\tif (ret) {\n+\t\tTAP_LOG(ERR, \"Failed to get port id for %s\",\n+\t\t\trequest_param->port_name);\n+\t\treturn -1;\n+\t}\n+\tdev = &rte_eth_devices[port_id];\n+\tprocess_private = dev->process_private;\n+\n+\t/* Fill file descriptors for all queues */\n+\treply.num_fds = 0;\n+\treply_param->rxq_count = 0;\n+\tfor (queue = 0; queue < dev->data->nb_rx_queues; queue++) {\n+\t\treply.fds[reply.num_fds++] = process_private->rxq_fds[queue];\n+\t\treply_param->rxq_count++;\n+\t}\n+\tRTE_ASSERT(reply_param->rxq_count == dev->data->nb_rx_queues);\n+\tRTE_ASSERT(reply_param->txq_count == dev->data->nb_tx_queues);\n+\tRTE_ASSERT(reply.num_fds <= RTE_MP_MAX_FD_NUM);\n+\n+\treply_param->txq_count = 0;\n+\tfor (queue = 0; queue < dev->data->nb_tx_queues; queue++) {\n+\t\treply.fds[reply.num_fds++] = process_private->txq_fds[queue];\n+\t\treply_param->txq_count++;\n+\t}\n+\n+\t/* Send reply */\n+\tstrlcpy(reply.name, request->name, sizeof(reply.name));\n+\tstrlcpy(reply_param->port_name, request_param->port_name,\n+\t\tsizeof(reply_param->port_name));\n+\treply.len_param = sizeof(*reply_param);\n+\tif (rte_mp_reply(&reply, peer) < 0) {\n+\t\tTAP_LOG(ERR, \"Failed to reply an IPC request to sync queues\");\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n /* Open a TAP interface device.\n  */\n static int\n@@ -2019,6 +2132,7 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \tchar remote_iface[RTE_ETH_NAME_MAX_LEN];\n \tstruct ether_addr user_mac = { .addr_bytes = {0} };\n \tstruct rte_eth_dev *eth_dev;\n+\tint tap_devices_count_increased = 0;\n \n \tstrcpy(tuntap_name, \"TAP\");\n \n@@ -2032,9 +2146,28 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \t\t\tTAP_LOG(ERR, \"Failed to probe %s\", name);\n \t\t\treturn -1;\n \t\t}\n-\t\t/* TODO: request info from primary to set up Rx and Tx */\n \t\teth_dev->dev_ops = &ops;\n \t\teth_dev->device = &dev->device;\n+\t\teth_dev->rx_pkt_burst = pmd_rx_burst;\n+\t\teth_dev->tx_pkt_burst = pmd_tx_burst;\n+\t\tif (!rte_eal_primary_proc_alive(NULL)) {\n+\t\t\tTAP_LOG(ERR, \"Primary process is missing\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\teth_dev->process_private = (struct pmd_process_private *)\n+\t\t\trte_zmalloc_socket(name,\n+\t\t\t\tsizeof(struct pmd_process_private),\n+\t\t\t\tRTE_CACHE_LINE_SIZE,\n+\t\t\t\teth_dev->device->numa_node);\n+\t\tif (eth_dev->process_private == NULL) {\n+\t\t\tTAP_LOG(ERR,\n+\t\t\t\t\"Failed to alloc memory for process private\");\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tret = tap_mp_attach_queues(name, eth_dev);\n+\t\tif (ret != 0)\n+\t\t\treturn -1;\n \t\trte_eth_dev_probing_finish(eth_dev);\n \t\treturn 0;\n \t}\n@@ -2082,6 +2215,17 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \tTAP_LOG(NOTICE, \"Initializing pmd_tap for %s as %s\",\n \t\tname, tap_name);\n \n+\t/* Register IPC feed callback */\n+\tif (!tap_devices_count) {\n+\t\tret = rte_mp_action_register(TAP_MP_KEY, tap_mp_sync_queues);\n+\t\tif (ret < 0) {\n+\t\t\tTAP_LOG(ERR, \"%s: Failed to register IPC callback: %s\",\n+\t\t\t\ttuntap_name, strerror(rte_errno));\n+\t\t\tgoto leave;\n+\t\t}\n+\t}\n+\ttap_devices_count++;\n+\ttap_devices_count_increased = 1;\n \tret = eth_dev_tap_create(dev, tap_name, remote_iface, &user_mac,\n \t\tETH_TUNTAP_TYPE_TAP);\n \n@@ -2089,6 +2233,11 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \tif (ret == -1) {\n \t\tTAP_LOG(ERR, \"Failed to create pmd for %s as %s\",\n \t\t\tname, tap_name);\n+\t\tif (tap_devices_count_increased == 1) {\n+\t\t\tif (!tap_devices_count)\n+\t\t\t\trte_mp_action_unregister(TAP_MP_KEY);\n+\t\t\ttap_devices_count--;\n+\t\t}\n \t\ttap_unit--;\t\t/* Restore the unit number */\n \t}\n \trte_kvargs_free(kvlist);\n@@ -2137,6 +2286,9 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev)\n \tclose(internals->ioctl_sock);\n \trte_free(eth_dev->data->dev_private);\n \trte_free(eth_dev->process_private);\n+\tif (tap_devices_count == 1)\n+\t\trte_mp_action_unregister(TAP_MP_KEY);\n+\ttap_devices_count--;\n \trte_eth_dev_release_port(eth_dev);\n \n \tif (internals->ka_fd != -1) {\n",
    "prefixes": [
        "v9",
        "3/3"
    ]
}