get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104700,
    "url": "http://patchwork.dpdk.org/api/patches/104700/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20211125122546.23542-1-kumaraparamesh92@gmail.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": "<20211125122546.23542-1-kumaraparamesh92@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211125122546.23542-1-kumaraparamesh92@gmail.com",
    "date": "2021-11-25T12:25:46",
    "name": "net/tap: Bug fix to populate fds in secondary process",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "cb15a38031221315c6879a4ec4414fad2b90475e",
    "submitter": {
        "id": 2391,
        "url": "http://patchwork.dpdk.org/api/people/2391/?format=api",
        "name": "Kumara Parameshwaran",
        "email": "kumaraparamesh92@gmail.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/20211125122546.23542-1-kumaraparamesh92@gmail.com/mbox/",
    "series": [
        {
            "id": 20775,
            "url": "http://patchwork.dpdk.org/api/series/20775/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=20775",
            "date": "2021-11-25T12:25:46",
            "name": "net/tap: Bug fix to populate fds in secondary process",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/20775/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/104700/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/104700/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 CB9D5A0C45;\n\tThu, 25 Nov 2021 13:25:55 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8A93C40DF5;\n\tThu, 25 Nov 2021 13:25:55 +0100 (CET)",
            "from mail-pg1-f174.google.com (mail-pg1-f174.google.com\n [209.85.215.174])\n by mails.dpdk.org (Postfix) with ESMTP id 5E15340140\n for <dev@dpdk.org>; Thu, 25 Nov 2021 13:25:54 +0100 (CET)",
            "by mail-pg1-f174.google.com with SMTP id m15so5091317pgu.11\n for <dev@dpdk.org>; Thu, 25 Nov 2021 04:25:54 -0800 (PST)",
            "from kparameshwa-a01.vmware.com.com ([106.51.27.43])\n by smtp.gmail.com with ESMTPSA id a3sm3645213pfv.5.2021.11.25.04.25.51\n (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);\n Thu, 25 Nov 2021 04:25:52 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n h=from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding;\n bh=K1dJeqMn7RvVUbbVUjFjwnCyoXPz7FGKOpJEouqox+c=;\n b=kyXkKJL3mTJ5q1TJMRUjHAqFYmJoonFPbNwSkGLdq8lcu3KxaVSvGKzzFNPX+as/ZQ\n DwalHR+vpaGkoTBjyjNMbAw6A/G4QzXH2AxpP7d3gnYdSxNaLDlU7rdUr0a00zrum4H9\n hLHyaWeXC9+DkQmP9Pbvg52atacIcdVaUvSr451wKiGILNW7ZlnLBU3ByzWG0nBPFXwm\n MfvKpX/oSzy4wwz8EIivgRvMY4zCWjGlPZyYPHvVMvjYPrEwN8dUCO433jU0neUXIjod\n 6ZSNjCqCstbemoJL9G6SNJACgHE361Bokq9oOfavZU5IxHM6HyV/WeySFIx+xCj6w4WS\n 6p3Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n :content-transfer-encoding;\n bh=K1dJeqMn7RvVUbbVUjFjwnCyoXPz7FGKOpJEouqox+c=;\n b=nAy+8ASssz8irYrwYMRMXw76W/gheVbIoiLbxTVzMIx4v4xuLLLkNOzFWZGqLLUThJ\n j0+1ivoYRDdzbmm6dN1J1CyX4o/wUgDbbP5l9HRXM/qS3Yk9InOVFN9rt42uwW/rs6is\n R2pzxgYXtIa71OjeVkX38YmFlsEhKBASSFZSk5csEdpiZGNi53KfkoyhlrvAuS4CmsFc\n eNFKT1Mob1DmWNZz1xkw0zROGS2V5fLobhRZ/e/8rXSq7RVkbzLAdxNXf7CGRc7eIcz4\n dOpMpbVhuN7Trf5nq6pOPaxeJrJrRgfAVymc9Z2xMpjESGim3CVpoa9HZU19A7w1tQQL\n 03DA==",
        "X-Gm-Message-State": "AOAM533LXlP0pk4JOPItjAOjStFUgKUH1mz4ibA//tzrhyXrPfHTIb96\n l//mjFipJYWLVUnCM0ufkAw=",
        "X-Google-Smtp-Source": "\n ABdhPJxNuuRfKPt/cdlancwWN9LAryZyaLnoEiyt9A2t++H/ZaGfvAlQeQl0YpkC25pxWHUf9hqP1w==",
        "X-Received": "by 2002:aa7:88d6:0:b0:49f:dd4b:ddbc with SMTP id\n k22-20020aa788d6000000b0049fdd4bddbcmr13959025pff.31.1637843153360;\n Thu, 25 Nov 2021 04:25:53 -0800 (PST)",
        "From": "Kumara Parameshwaran <kumaraparamesh92@gmail.com>",
        "To": "keith.wiles@intel.com",
        "Cc": "dev@dpdk.org,\n\tKumara Parameshwaran <kparameshwar@vmware.com>",
        "Subject": "[PATCH] net/tap: Bug fix to populate fds in secondary process",
        "Date": "Thu, 25 Nov 2021 17:55:46 +0530",
        "Message-Id": "<20211125122546.23542-1-kumaraparamesh92@gmail.com>",
        "X-Mailer": "git-send-email 2.30.1 (Apple Git-130)",
        "MIME-Version": "1.0",
        "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": "From: Kumara Parameshwaran <kparameshwar@vmware.com>\n\nWhen a tap device is hotplugged to primary process which in turn\nadds the device to all secondary process, the secondary process\ndoes a tap_mp_attach_queues, but the fds are not populated in\nthe primary during the probe they are populated during the queue_setup,\nadded a fix to sync the queues during rte_eth_dev_start\n\nSigned-off-by: Kumara Parameshwaran <kparameshwar@vmware.com>\n---\n drivers/net/tap/rte_eth_tap.c | 79 +++++++++++++++++++++++++++++++++++\n 1 file changed, 79 insertions(+)",
    "diff": "diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex f1b48cae82..98791f8dbe 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -67,6 +67,7 @@\n \n /* IPC key for queue fds sync */\n #define TAP_MP_KEY \"tap_mp_sync_queues\"\n+#define TAP_MP_REQ_START_RXTX \"tap_mp_req_start_rxtx\"\n \n #define TAP_IOV_DEFAULT_MAX 1024\n \n@@ -880,11 +881,50 @@ tap_link_set_up(struct rte_eth_dev *dev)\n \treturn tap_ioctl(pmd, SIOCSIFFLAGS, &ifr, 1, LOCAL_AND_REMOTE);\n }\n \n+static int tap_mp_req_on_rxtx(struct rte_eth_dev *dev)\n+{\n+\tstruct rte_mp_msg msg;\n+\tstruct ipc_queues *request_param = (struct ipc_queues *)msg.param;\n+\tint err;\n+\tint fd_iterator = 0;\n+\tstruct pmd_process_private *process_private = dev->process_private;\n+\n+\tmemset(&msg, 0, sizeof(msg));\n+\tstrcpy(msg.name, TAP_MP_REQ_START_RXTX);\n+\tstrlcpy(request_param->port_name, dev->data->name,\n+\t\tsizeof(request_param->port_name));\n+\tmsg.len_param = sizeof(*request_param);\n+\tfor (int i=0; i < dev->data->nb_tx_queues; i++) {\n+\t\tmsg.fds[fd_iterator++] = process_private->txq_fds[i];\n+\t\tmsg.num_fds++;\n+\t\trequest_param->txq_count++;\n+\t}\n+\tfor (int i=0; i < dev->data->nb_rx_queues; i++) {\n+\t\tmsg.fds[fd_iterator++] = process_private->rxq_fds[i];\n+\t\tmsg.num_fds++;\n+\t\trequest_param->rxq_count++;\n+\t}\n+\n+\tRTE_ASSERT(request_param->txq_count == dev->data->nb_tx_queues);\n+\tRTE_ASSERT(request_param->rxq_count == dev->data->nb_rx_queues);\n+\n+\terr = rte_mp_sendmsg(&msg);\n+\tif (err < 0) {\n+\t\tTAP_LOG(ERR, \"Failed to send start req to secondary %d\",\n+\t\t\trte_errno);\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n tap_dev_start(struct rte_eth_dev *dev)\n {\n \tint err, i;\n \n+\ttap_mp_req_on_rxtx(dev);\n+\n \terr = tap_intr_handle_set(dev, 1);\n \tif (err)\n \t\treturn err;\n@@ -901,6 +941,39 @@ tap_dev_start(struct rte_eth_dev *dev)\n \treturn err;\n }\n \n+static int\n+tap_mp_req_start_rxtx(const struct rte_mp_msg *request, __rte_unused const void *peer)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tint ret;\n+\tuint16_t port_id;\n+\tconst struct ipc_queues *request_param =\n+\t\t(const struct ipc_queues *)request->param;\n+\tint fd_iterator;\n+\tint queue;\n+\tstruct pmd_process_private *process_private;\n+\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+\tdev->data->nb_rx_queues = request_param->rxq_count;\n+\tdev->data->nb_tx_queues = request_param->txq_count;\n+\tfd_iterator = 0;\n+\tRTE_LOG(DEBUG, PMD, \"tap_attach rx_q:%d tx_q:%d\\n\", request_param->rxq_count,\n+\t\trequest_param->txq_count);\n+\tfor (queue = 0; queue < request_param->txq_count; queue++)\n+\t\tprocess_private->txq_fds[queue] = request->fds[fd_iterator++];\n+\tfor (queue = 0; queue < request_param->rxq_count; queue++)\n+\t\tprocess_private->rxq_fds[queue] = request->fds[fd_iterator++];\n+\n+\treturn 0;\n+}\n+\n /* This function gets called when the current port gets stopped.\n  */\n static int\n@@ -2445,6 +2518,12 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \t\tret = tap_mp_attach_queues(name, eth_dev);\n \t\tif (ret != 0)\n \t\t\treturn -1;\n+\n+\t\tret = rte_mp_action_register(TAP_MP_REQ_START_RXTX, tap_mp_req_start_rxtx);\n+\t\tif (ret < 0 && rte_errno != ENOTSUP)\n+\t\t\tTAP_LOG(ERR, \"tap: Failed to register IPC callback: %s\",\n+\t\t\t\tstrerror(rte_errno));\n+\n \t\trte_eth_dev_probing_finish(eth_dev);\n \t\treturn 0;\n \t}\n",
    "prefixes": []
}