get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139786,
    "url": "http://patches.dpdk.org/api/patches/139786/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240502025201.28322-2-stephen@networkplumber.org/",
    "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": "<20240502025201.28322-2-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240502025201.28322-2-stephen@networkplumber.org",
    "date": "2024-05-02T02:49:20",
    "name": "[v11,1/9] net/tap: do not duplicate fd's",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d4938ac82f963567396ee4697e4ca2dcddd0d51e",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "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/20240502025201.28322-2-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 31862,
            "url": "http://patches.dpdk.org/api/series/31862/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31862",
            "date": "2024-05-02T02:49:19",
            "name": "net/tap fix RSS (BPF) flow support",
            "version": 11,
            "mbox": "http://patches.dpdk.org/series/31862/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/139786/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/139786/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 39C8043F63;\n\tThu,  2 May 2024 04:52:18 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id EBEB0402D1;\n\tThu,  2 May 2024 04:52:14 +0200 (CEST)",
            "from mail-oi1-f182.google.com (mail-oi1-f182.google.com\n [209.85.167.182])\n by mails.dpdk.org (Postfix) with ESMTP id 8D6134026F\n for <dev@dpdk.org>; Thu,  2 May 2024 04:52:12 +0200 (CEST)",
            "by mail-oi1-f182.google.com with SMTP id\n 5614622812f47-3c74ff209f6so4725222b6e.0\n for <dev@dpdk.org>; Wed, 01 May 2024 19:52:12 -0700 (PDT)",
            "from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n z19-20020aa78893000000b006ecfc3a8d6csm104818pfe.124.2024.05.01.19.52.10\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 01 May 2024 19:52:11 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1714618332;\n x=1715223132; darn=dpdk.org;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=Z+sgJoMxCVpJYi/L8I9hUKU7XfLnKe56z3tFiksnJkM=;\n b=xwTFnUelyYNB/m+2mKeYpCusIdJHjDxm0h/FjPs2tAHpnEgesG7sa5ZX0K7jZVprku\n 46nj5fHI8XKyj8eN4j/NqqQQFu+efjElp+bqdqEUcBkfveKMSPsd1yqUq5d2hTdVJtuA\n dWO/YIfelRVVt7+GA4D9UW+BFTTuOzlIe2EOX+OolteVv3VZEtAsnfP7Fd6F7Yqh3oxM\n 1/kFNMKriAvAjx6L7u2Zhi1pAIV9XrcARBF1KqZO6xMBKMnZTYpBrAkXMafjKpl4e9nN\n LpqSjUskaBbdkEcvFTGm8MuRpr6bwir3emIWWEPR6fnSCYrfBrBw7BJ/cK+hk4JIJezu\n 2chw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1714618332; x=1715223132;\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=Z+sgJoMxCVpJYi/L8I9hUKU7XfLnKe56z3tFiksnJkM=;\n b=IbwMLbVX3czhGpBC6Flz3BOat16UUtQCar1sMcpwQjorGm5zaFwcQaYOg2MJlRSUW3\n WgbufkWBJbf2ZqIFLM+l2M17S42gCWwmc50bA2t1PRlpOSsBAnqfn00ZscOpfIxovaVL\n jkwOQt95j2HSkG2z/pMLibvDr1EqznGS1j7xxZLzKDEvuE302vM9QVsaV2qLKcyD23ki\n MDeS2P6HHREit1qhlrpWQ9lHE3diQg0KQSd7t3YRwxLr0qToTGF0gf9MdU2QGRIBGWy0\n QmZAdXB9eDK7qOztfx6ZlrFcV1NUgSyGb7zrwtqkoVLPrXa0uuGBHgIu0TQYClkUFP2Q\n xi2Q==",
        "X-Gm-Message-State": "AOJu0Yyeh7BBaYGSAhFSXbRwEFjaphrnFd/+v7B62ZKQg4ar1DHWaao4\n xG2ZV6W6kMfznGFqwy0anzIuYPz3ObqYTBIEa2ahIJ1O2U5XZyKOklCoJcBhJNzVHcoZjYSp1hK\n gKGc=",
        "X-Google-Smtp-Source": "\n AGHT+IE1rpBKSQOsGPxH3LOvJC/h4O7xVSawMv7xxsC3p5mOk8TVF04xvRFOG7X7wtr+6bgoyvgWUg==",
        "X-Received": "by 2002:a05:6808:253:b0:3c8:4300:f56e with SMTP id\n m19-20020a056808025300b003c84300f56emr4704956oie.48.1714618331583;\n Wed, 01 May 2024 19:52:11 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v11 1/9] net/tap: do not duplicate fd's",
        "Date": "Wed,  1 May 2024 19:49:20 -0700",
        "Message-ID": "<20240502025201.28322-2-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240502025201.28322-1-stephen@networkplumber.org>",
        "References": "<20240130034925.44869-1-stephen@networkplumber.org>\n <20240502025201.28322-1-stephen@networkplumber.org>",
        "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": "The TAP device can use same file descriptor for both rx and tx queues.\nThis allows up to 8 queues (versus 4) to be used with secondary process.\n\nBugzilla ID: 1381\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n drivers/net/tap/rte_eth_tap.c | 192 ++++++++++++++--------------------\n drivers/net/tap/rte_eth_tap.h |   3 +-\n drivers/net/tap/tap_flow.c    |   3 +-\n drivers/net/tap/tap_intr.c    |   7 +-\n 4 files changed, 85 insertions(+), 120 deletions(-)",
    "diff": "diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex 69d9da695b..b84fc01856 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -124,8 +124,7 @@ enum ioctl_mode {\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+\tint q_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@@ -446,7 +445,7 @@ pmd_rx_burst(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)\n \t\tuint16_t data_off = rte_pktmbuf_headroom(mbuf);\n \t\tint len;\n \n-\t\tlen = readv(process_private->rxq_fds[rxq->queue_id],\n+\t\tlen = readv(process_private->fds[rxq->queue_id],\n \t\t\t*rxq->iovecs,\n \t\t\t1 + (rxq->rxmode->offloads & RTE_ETH_RX_OFFLOAD_SCATTER ?\n \t\t\t     rxq->nb_rx_desc : 1));\n@@ -643,7 +642,7 @@ tap_write_mbufs(struct tx_queue *txq, uint16_t num_mbufs,\n \t\t}\n \n \t\t/* copy the tx frame data */\n-\t\tn = writev(process_private->txq_fds[txq->queue_id], iovecs, k);\n+\t\tn = writev(process_private->fds[txq->queue_id], iovecs, k);\n \t\tif (n <= 0)\n \t\t\treturn -1;\n \n@@ -851,7 +850,6 @@ tap_mp_req_on_rxtx(struct rte_eth_dev *dev)\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 \tint i;\n \n@@ -859,16 +857,13 @@ tap_mp_req_on_rxtx(struct rte_eth_dev *dev)\n \tstrlcpy(msg.name, TAP_MP_REQ_START_RXTX, sizeof(msg.name));\n \tstrlcpy(request_param->port_name, dev->data->name, sizeof(request_param->port_name));\n \tmsg.len_param = sizeof(*request_param);\n-\tfor (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 (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+\t/* rx and tx share file descriptors and nb_tx_queues == nb_rx_queues */\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++)\n+\t\tmsg.fds[i] = process_private->fds[i];\n+\n+\trequest_param->q_count = dev->data->nb_rx_queues;\n+\tmsg.num_fds = dev->data->nb_rx_queues;\n \n \terr = rte_mp_sendmsg(&msg);\n \tif (err < 0) {\n@@ -910,8 +905,6 @@ tap_mp_req_start_rxtx(const struct rte_mp_msg *request, __rte_unused const void\n \tstruct rte_eth_dev *dev;\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 \tdev = rte_eth_dev_get_by_name(request_param->port_name);\n@@ -920,14 +913,13 @@ tap_mp_req_start_rxtx(const struct rte_mp_msg *request, __rte_unused const void\n \t\t\trequest_param->port_name);\n \t\treturn -1;\n \t}\n+\n \tprocess_private = dev->process_private;\n-\tfd_iterator = 0;\n-\tTAP_LOG(DEBUG, \"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+\tTAP_LOG(DEBUG, \"tap_attach q:%d\\n\", request_param->q_count);\n+\n+\tfor (int q = 0; q < request_param->q_count; q++)\n+\t\tprocess_private->fds[q] = request->fds[q];\n+\n \n \treturn 0;\n }\n@@ -1115,13 +1107,21 @@ tap_stats_reset(struct rte_eth_dev *dev)\n \treturn 0;\n }\n \n+static void\n+tap_queue_close(struct pmd_process_private *process_private, uint16_t qid)\n+{\n+\tif (process_private->fds[qid] != -1) {\n+\t\tclose(process_private->fds[qid]);\n+\t\tprocess_private->fds[qid] = -1;\n+\t}\n+}\n+\n static int\n tap_dev_close(struct rte_eth_dev *dev)\n {\n \tint i;\n \tstruct pmd_internals *internals = dev->data->dev_private;\n \tstruct pmd_process_private *process_private = dev->process_private;\n-\tstruct rx_queue *rxq;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n \t\trte_free(dev->process_private);\n@@ -1141,19 +1141,14 @@ tap_dev_close(struct rte_eth_dev *dev)\n \t}\n \n \tfor (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) {\n-\t\tif (process_private->rxq_fds[i] != -1) {\n-\t\t\trxq = &internals->rxq[i];\n-\t\t\tclose(process_private->rxq_fds[i]);\n-\t\t\tprocess_private->rxq_fds[i] = -1;\n-\t\t\ttap_rxq_pool_free(rxq->pool);\n-\t\t\trte_free(rxq->iovecs);\n-\t\t\trxq->pool = NULL;\n-\t\t\trxq->iovecs = NULL;\n-\t\t}\n-\t\tif (process_private->txq_fds[i] != -1) {\n-\t\t\tclose(process_private->txq_fds[i]);\n-\t\t\tprocess_private->txq_fds[i] = -1;\n-\t\t}\n+\t\tstruct rx_queue *rxq = &internals->rxq[i];\n+\n+\t\ttap_queue_close(process_private, i);\n+\n+\t\ttap_rxq_pool_free(rxq->pool);\n+\t\trte_free(rxq->iovecs);\n+\t\trxq->pool = NULL;\n+\t\trxq->iovecs = NULL;\n \t}\n \n \tif (internals->remote_if_index) {\n@@ -1206,15 +1201,16 @@ tap_rx_queue_release(struct rte_eth_dev *dev, uint16_t qid)\n \n \tif (!rxq)\n \t\treturn;\n+\n \tprocess_private = rte_eth_devices[rxq->in_port].process_private;\n-\tif (process_private->rxq_fds[rxq->queue_id] != -1) {\n-\t\tclose(process_private->rxq_fds[rxq->queue_id]);\n-\t\tprocess_private->rxq_fds[rxq->queue_id] = -1;\n-\t\ttap_rxq_pool_free(rxq->pool);\n-\t\trte_free(rxq->iovecs);\n-\t\trxq->pool = NULL;\n-\t\trxq->iovecs = NULL;\n-\t}\n+\n+\ttap_rxq_pool_free(rxq->pool);\n+\trte_free(rxq->iovecs);\n+\trxq->pool = NULL;\n+\trxq->iovecs = NULL;\n+\n+\tif (dev->data->tx_queues[qid] == NULL)\n+\t\ttap_queue_close(process_private, qid);\n }\n \n static void\n@@ -1225,12 +1221,10 @@ tap_tx_queue_release(struct rte_eth_dev *dev, uint16_t qid)\n \n \tif (!txq)\n \t\treturn;\n-\tprocess_private = rte_eth_devices[txq->out_port].process_private;\n \n-\tif (process_private->txq_fds[txq->queue_id] != -1) {\n-\t\tclose(process_private->txq_fds[txq->queue_id]);\n-\t\tprocess_private->txq_fds[txq->queue_id] = -1;\n-\t}\n+\tprocess_private = rte_eth_devices[txq->out_port].process_private;\n+\tif (dev->data->rx_queues[qid] == NULL)\n+\t\ttap_queue_close(process_private, qid);\n }\n \n static int\n@@ -1482,52 +1476,31 @@ tap_setup_queue(struct rte_eth_dev *dev,\n \t\tuint16_t qid,\n \t\tint is_rx)\n {\n-\tint ret;\n-\tint *fd;\n-\tint *other_fd;\n-\tconst char *dir;\n+\tint fd, ret;\n \tstruct pmd_internals *pmd = dev->data->dev_private;\n \tstruct pmd_process_private *process_private = dev->process_private;\n \tstruct rx_queue *rx = &internals->rxq[qid];\n \tstruct tx_queue *tx = &internals->txq[qid];\n-\tstruct rte_gso_ctx *gso_ctx;\n+\tstruct rte_gso_ctx *gso_ctx = is_rx ? NULL : &tx->gso_ctx;\n+\tconst char *dir = is_rx ? \"rx\" : \"tx\";\n \n-\tif (is_rx) {\n-\t\tfd = &process_private->rxq_fds[qid];\n-\t\tother_fd = &process_private->txq_fds[qid];\n-\t\tdir = \"rx\";\n-\t\tgso_ctx = NULL;\n-\t} else {\n-\t\tfd = &process_private->txq_fds[qid];\n-\t\tother_fd = &process_private->rxq_fds[qid];\n-\t\tdir = \"tx\";\n-\t\tgso_ctx = &tx->gso_ctx;\n-\t}\n-\tif (*fd != -1) {\n+\tfd = process_private->fds[qid];\n+\tif (fd != -1) {\n \t\t/* fd for this queue already exists */\n \t\tTAP_LOG(DEBUG, \"%s: fd %d for %s queue qid %d exists\",\n-\t\t\tpmd->name, *fd, dir, qid);\n+\t\t\tpmd->name, fd, dir, qid);\n \t\tgso_ctx = NULL;\n-\t} else if (*other_fd != -1) {\n-\t\t/* Only other_fd exists. dup it */\n-\t\t*fd = dup(*other_fd);\n-\t\tif (*fd < 0) {\n-\t\t\t*fd = -1;\n-\t\t\tTAP_LOG(ERR, \"%s: dup() failed.\", pmd->name);\n-\t\t\treturn -1;\n-\t\t}\n-\t\tTAP_LOG(DEBUG, \"%s: dup fd %d for %s queue qid %d (%d)\",\n-\t\t\tpmd->name, *other_fd, dir, qid, *fd);\n \t} else {\n-\t\t/* Both RX and TX fds do not exist (equal -1). Create fd */\n-\t\t*fd = tun_alloc(pmd, 0, 0);\n-\t\tif (*fd < 0) {\n-\t\t\t*fd = -1; /* restore original value */\n+\t\tfd = tun_alloc(pmd, 0, 0);\n+\t\tif (fd < 0) {\n \t\t\tTAP_LOG(ERR, \"%s: tun_alloc() failed.\", pmd->name);\n \t\t\treturn -1;\n \t\t}\n+\n \t\tTAP_LOG(DEBUG, \"%s: add %s queue for qid %d fd %d\",\n-\t\t\tpmd->name, dir, qid, *fd);\n+\t\t\tpmd->name, dir, qid, fd);\n+\n+\t\tprocess_private->fds[qid] = fd;\n \t}\n \n \ttx->mtu = &dev->data->mtu;\n@@ -1540,7 +1513,7 @@ tap_setup_queue(struct rte_eth_dev *dev,\n \n \ttx->type = pmd->type;\n \n-\treturn *fd;\n+\treturn fd;\n }\n \n static int\n@@ -1620,7 +1593,7 @@ tap_rx_queue_setup(struct rte_eth_dev *dev,\n \n \tTAP_LOG(DEBUG, \"  RX TUNTAP device name %s, qid %d on fd %d\",\n \t\tinternals->name, rx_queue_id,\n-\t\tprocess_private->rxq_fds[rx_queue_id]);\n+\t\tprocess_private->fds[rx_queue_id]);\n \n \treturn 0;\n \n@@ -1664,7 +1637,7 @@ tap_tx_queue_setup(struct rte_eth_dev *dev,\n \tTAP_LOG(DEBUG,\n \t\t\"  TX TUNTAP device name %s, qid %d on fd %d csum %s\",\n \t\tinternals->name, tx_queue_id,\n-\t\tprocess_private->txq_fds[tx_queue_id],\n+\t\tprocess_private->fds[tx_queue_id],\n \t\ttxq->csum ? \"on\" : \"off\");\n \n \treturn 0;\n@@ -2001,10 +1974,9 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,\n \tdev->intr_handle = pmd->intr_handle;\n \n \t/* Presetup the fds to -1 as being not valid */\n-\tfor (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++) {\n-\t\tprocess_private->rxq_fds[i] = -1;\n-\t\tprocess_private->txq_fds[i] = -1;\n-\t}\n+\tfor (i = 0; i < RTE_PMD_TAP_MAX_QUEUES; i++)\n+\t\tprocess_private->fds[i] = -1;\n+\n \n \tif (pmd->type == ETH_TUNTAP_TYPE_TAP) {\n \t\tif (rte_is_zero_ether_addr(mac_addr))\n@@ -2332,7 +2304,6 @@ tap_mp_attach_queues(const char *port_name, struct rte_eth_dev *dev)\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 \tmemset(&request, 0, sizeof(request));\n@@ -2352,18 +2323,17 @@ tap_mp_attach_queues(const char *port_name, struct rte_eth_dev *dev)\n \tTAP_LOG(DEBUG, \"Received IPC reply for %s\", reply_param->port_name);\n \n \t/* Attach the queues from received file descriptors */\n-\tif (reply_param->rxq_count + reply_param->txq_count != reply->num_fds) {\n+\tif (reply_param->q_count != reply->num_fds) {\n \t\tTAP_LOG(ERR, \"Unexpected number of fds received\");\n \t\treturn -1;\n \t}\n \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+\tdev->data->nb_rx_queues = reply_param->q_count;\n+\tdev->data->nb_tx_queues = reply_param->q_count;\n+\n+\tfor (int q = 0; q < reply_param->q_count; q++)\n+\t\tprocess_private->fds[q] = reply->fds[q];\n+\n \tfree(reply);\n \treturn 0;\n }\n@@ -2393,25 +2363,19 @@ tap_mp_sync_queues(const struct rte_mp_msg *request, const void *peer)\n \n \t/* Fill file descriptors for all queues */\n \treply.num_fds = 0;\n-\treply_param->rxq_count = 0;\n-\tif (dev->data->nb_rx_queues + dev->data->nb_tx_queues >\n-\t\t\tRTE_MP_MAX_FD_NUM){\n-\t\tTAP_LOG(ERR, \"Number of rx/tx queues exceeds max number of fds\");\n+\treply_param->q_count = 0;\n+\n+\tRTE_ASSERT(dev->data->nb_rx_queues == dev->data->nb_tx_queues);\n+\tif (dev->data->nb_rx_queues > RTE_MP_MAX_FD_NUM) {\n+\t\tTAP_LOG(ERR, \"Number of rx/tx queues %u exceeds max number of fds %u\",\n+\t\t\tdev->data->nb_rx_queues, RTE_MP_MAX_FD_NUM);\n \t\treturn -1;\n \t}\n \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-\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\treply.fds[reply.num_fds++] = process_private->fds[queue];\n+\t\treply_param->q_count++;\n \t}\n-\tRTE_ASSERT(reply_param->txq_count == dev->data->nb_tx_queues);\n \n \t/* Send reply */\n \tstrlcpy(reply.name, request->name, sizeof(reply.name));\ndiff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h\nindex 5ac93f93e9..dc8201020b 100644\n--- a/drivers/net/tap/rte_eth_tap.h\n+++ b/drivers/net/tap/rte_eth_tap.h\n@@ -96,8 +96,7 @@ struct pmd_internals {\n };\n \n struct pmd_process_private {\n-\tint rxq_fds[RTE_PMD_TAP_MAX_QUEUES];\n-\tint txq_fds[RTE_PMD_TAP_MAX_QUEUES];\n+\tint fds[RTE_PMD_TAP_MAX_QUEUES];\n };\n \n /* tap_intr.c */\ndiff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c\nindex fa50fe45d7..a78fd50cd4 100644\n--- a/drivers/net/tap/tap_flow.c\n+++ b/drivers/net/tap/tap_flow.c\n@@ -1595,8 +1595,9 @@ tap_flow_isolate(struct rte_eth_dev *dev,\n \t * If netdevice is there, setup appropriate flow rules immediately.\n \t * Otherwise it will be set when bringing up the netdevice (tun_alloc).\n \t */\n-\tif (!process_private->rxq_fds[0])\n+\tif (process_private->fds[0] == -1)\n \t\treturn 0;\n+\n \tif (set) {\n \t\tstruct rte_flow *remote_flow;\n \ndiff --git a/drivers/net/tap/tap_intr.c b/drivers/net/tap/tap_intr.c\nindex a9097def1a..1908f71f97 100644\n--- a/drivers/net/tap/tap_intr.c\n+++ b/drivers/net/tap/tap_intr.c\n@@ -68,9 +68,11 @@ tap_rx_intr_vec_install(struct rte_eth_dev *dev)\n \t}\n \tfor (i = 0; i < n; i++) {\n \t\tstruct rx_queue *rxq = pmd->dev->data->rx_queues[i];\n+\t\tint fd = process_private->fds[i];\n \n \t\t/* Skip queues that cannot request interrupts. */\n-\t\tif (!rxq || process_private->rxq_fds[i] == -1) {\n+\t\tif (!rxq || fd == -1) {\n+\t\t\t/* Use invalid intr_vec[] index to disable entry. */\n \t\t\t/* Use invalid intr_vec[] index to disable entry. */\n \t\t\tif (rte_intr_vec_list_index_set(intr_handle, i,\n \t\t\tRTE_INTR_VEC_RXTX_OFFSET + RTE_MAX_RXTX_INTR_VEC_ID))\n@@ -80,8 +82,7 @@ tap_rx_intr_vec_install(struct rte_eth_dev *dev)\n \t\tif (rte_intr_vec_list_index_set(intr_handle, i,\n \t\t\t\t\tRTE_INTR_VEC_RXTX_OFFSET + count))\n \t\t\treturn -rte_errno;\n-\t\tif (rte_intr_efds_index_set(intr_handle, count,\n-\t\t\t\t\t\t   process_private->rxq_fds[i]))\n+\t\tif (rte_intr_efds_index_set(intr_handle, count, fd))\n \t\t\treturn -rte_errno;\n \t\tcount++;\n \t}\n",
    "prefixes": [
        "v11",
        "1/9"
    ]
}