get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139714,
    "url": "https://patches.dpdk.org/api/patches/139714/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240426155125.125910-10-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "https://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": "<20240426155125.125910-10-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240426155125.125910-10-stephen@networkplumber.org",
    "date": "2024-04-26T15:48:59",
    "name": "[v9,9/9] net/tap: simplify the internal structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "e3f4ac12092cf7f98edeb95c974592cd6116b1b0",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240426155125.125910-10-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 31834,
            "url": "https://patches.dpdk.org/api/series/31834/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31834",
            "date": "2024-04-26T15:48:50",
            "name": "net/tap: fix RSS (BPF) support",
            "version": 9,
            "mbox": "https://patches.dpdk.org/series/31834/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/139714/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/139714/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 6DC7E43F19;\n\tFri, 26 Apr 2024 17:52:50 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 50C1143F3F;\n\tFri, 26 Apr 2024 17:51:52 +0200 (CEST)",
            "from mail-pj1-f49.google.com (mail-pj1-f49.google.com\n [209.85.216.49]) by mails.dpdk.org (Postfix) with ESMTP id AA92743F11\n for <dev@dpdk.org>; Fri, 26 Apr 2024 17:51:44 +0200 (CEST)",
            "by mail-pj1-f49.google.com with SMTP id\n 98e67ed59e1d1-2a484f772e2so1620495a91.3\n for <dev@dpdk.org>; Fri, 26 Apr 2024 08:51:44 -0700 (PDT)",
            "from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226])\n by smtp.gmail.com with ESMTPSA id\n ns5-20020a17090b250500b002a5f44353d2sm16770978pjb.7.2024.04.26.08.51.42\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 26 Apr 2024 08:51:43 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1714146704;\n x=1714751504; 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=CASiGeiYMOqJ2aivudSsgIq3JXXBscw18MAvjgHM6LA=;\n b=IF486AijkvAGOTKw3CSBpdUu/bvjhHJoV8Z1QLb8aMIuWM3rXzc4b5oXqw4ojpcDhn\n rew3rgeu27H22DUBQ4VszF0NZAI1SQi24XbKLcZ5+FNLVl25vjN6VmAdgEs8iFh2dbcA\n aGaPbJgD05bUn9bF344nxPPwA//ipswjJpHgV7l+NAxouLmiLFAEel6Ova4wmNPPAfFq\n +te+U+80rt1T4GcYb93fNpj02KbZSeGFc7iIhDnCynxnr8XfiI6vxFzMfyyKlXqCt/XV\n 4p5PLKC/1ms8ZDUUQuOkoaedfupPu3s4naV0430SJ49lUGu6he7OFbdE2qz7HzuECawO\n b4Gw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20230601; t=1714146704; x=1714751504;\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=CASiGeiYMOqJ2aivudSsgIq3JXXBscw18MAvjgHM6LA=;\n b=VDUwZu2JMheKVMzhi4oAcFM/UtEC9c7vYw0fGJPJpgFdZHB5R+sKTin1nvCwk3qPby\n IfeELs23hqsTCtyRRZHnRp8J4P3AmgpPf0+m2vN9Ko1IGJwC3IKsRFE4MRSSr4vM3uqP\n A4F6glXySzWFwpewZfhRIGVIAjlejnqlSDGuAv4wRvjJOyPpfRcledwzDMMXTxibgTrA\n gOTi4n5TzaGeAyLFaPA9exVZoIBIS9DXD8h5xwjyMx0tcg3AxOjtWmh7xozD9Oeucc/i\n suzd2Z0aOok3zUWij1r5Bq/md0T9YHUbFPcA1NdcBC9M4ZtlLD8IV7Uo+i9Gsx/G1Dyv\n Irfw==",
        "X-Gm-Message-State": "AOJu0Yy//gZTpijMBFU+KqvTkubjgnXSw1j1wSqc8uL6D6oY4hQ0I6Sq\n kGlp9+dmyre0R2aEywzf4YAg30iLNjZ+KINw6da26Z0pdjlvYdfjyZO5txBxeULOAOXA1VyBQie\n auaI=",
        "X-Google-Smtp-Source": "\n AGHT+IHEPspmWeDM7tQ9QynDnSDfQPwpBYXOPrM0RCgis1K0wqQQnDTFyMw+Z2LiGiK3g/IXl2EEiA==",
        "X-Received": "by 2002:a17:90a:d397:b0:2af:6ce2:bd2f with SMTP id\n q23-20020a17090ad39700b002af6ce2bd2fmr3232163pju.1.1714146703888;\n Fri, 26 Apr 2024 08:51:43 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>",
        "Subject": "[PATCH v9 9/9] net/tap: simplify the internal structure",
        "Date": "Fri, 26 Apr 2024 08:48:59 -0700",
        "Message-ID": "<20240426155125.125910-10-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.43.0",
        "In-Reply-To": "<20240426155125.125910-1-stephen@networkplumber.org>",
        "References": "<20240130034925.44869-1-stephen@networkplumber.org>\n <20240426155125.125910-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 names of Linux network devices are IFNAMSIZ(16) not the\nsame as DPDK which has up to 64 characters. Don't need to\nhold onto the whole ifreq to save the remote interface flags.\n\nRearrange internal structure for locality.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n drivers/net/tap/rte_eth_tap.c | 42 ++++++++++++++++++++++-------------\n drivers/net/tap/rte_eth_tap.h | 12 +++++-----\n 2 files changed, 32 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex 793730de08..b066a8acd1 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -212,7 +212,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)\n \t * and need to find the resulting device.\n \t */\n \tTAP_LOG(DEBUG, \"Device name is '%s'\", ifr.ifr_name);\n-\tstrlcpy(pmd->name, ifr.ifr_name, RTE_ETH_NAME_MAX_LEN);\n+\tstrlcpy(pmd->name, ifr.ifr_name, IFNAMSIZ);\n \n \tif (is_keepalive) {\n \t\t/*\n@@ -1151,9 +1151,13 @@ tap_dev_close(struct rte_eth_dev *dev)\n \t}\n \n \tif (internals->remote_if_index) {\n+\t\tstruct ifreq remote_ifr;\n+\n+\t\tstrlcpy(remote_ifr.ifr_name, internals->remote_iface, IFNAMSIZ);\n+\t\tremote_ifr.ifr_flags = internals->remote_flags;\n+\n \t\t/* Restore initial remote state */\n-\t\tint ret = ioctl(internals->ioctl_sock, SIOCSIFFLAGS,\n-\t\t\t\t&internals->remote_initial_flags);\n+\t\tint ret = ioctl(internals->ioctl_sock, SIOCSIFFLAGS, &remote_ifr);\n \t\tif (ret)\n \t\t\tTAP_LOG(ERR, \"restore remote state failed: %d\", ret);\n \n@@ -2074,16 +2078,22 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,\n \tLIST_INIT(&pmd->flows);\n \n \tif (strlen(remote_iface)) {\n+\t\tstruct ifreq remote_ifr;\n+\n \t\tpmd->remote_if_index = if_nametoindex(remote_iface);\n \t\tif (!pmd->remote_if_index) {\n \t\t\tTAP_LOG(ERR, \"%s: failed to get %s if_index.\",\n \t\t\t\tpmd->name, remote_iface);\n \t\t\tgoto error_remote;\n \t\t}\n-\t\tstrlcpy(pmd->remote_iface, remote_iface, RTE_ETH_NAME_MAX_LEN);\n+\t\tstrlcpy(pmd->remote_iface, remote_iface, IFNAMSIZ);\n+\n+\t\tmemset(&remote_ifr, 0, sizeof(ifr));\n+\t\tstrlcpy(remote_ifr.ifr_name, remote_iface, IFNAMSIZ);\n \n \t\t/* Save state of remote device */\n-\t\ttap_ioctl(pmd, SIOCGIFFLAGS, &pmd->remote_initial_flags, 0, REMOTE_ONLY);\n+\t\ttap_ioctl(pmd, SIOCGIFFLAGS, &remote_ifr, 0, REMOTE_ONLY);\n+\t\tpmd->remote_flags = remote_ifr.ifr_flags;\n \n \t\t/* Replicate remote MAC address */\n \t\tif (tap_ioctl(pmd, SIOCGIFHWADDR, &ifr, 0, REMOTE_ONLY) < 0) {\n@@ -2197,10 +2207,10 @@ set_interface_name(const char *key __rte_unused,\n \t\t\t\tvalue);\n \t\t\treturn -1;\n \t\t}\n-\t\tstrlcpy(name, value, RTE_ETH_NAME_MAX_LEN);\n+\t\tstrlcpy(name, value, IFNAMSIZ);\n \t} else {\n \t\t/* use tap%d which causes kernel to choose next available */\n-\t\tstrlcpy(name, DEFAULT_TAP_NAME \"%d\", RTE_ETH_NAME_MAX_LEN);\n+\t\tstrlcpy(name, DEFAULT_TAP_NAME \"%d\", IFNAMSIZ);\n \t}\n \treturn 0;\n }\n@@ -2218,7 +2228,7 @@ set_remote_iface(const char *key __rte_unused,\n \t\t\t\tvalue);\n \t\t\treturn -1;\n \t\t}\n-\t\tstrlcpy(name, value, RTE_ETH_NAME_MAX_LEN);\n+\t\tstrlcpy(name, value, IFNAMSIZ);\n \t}\n \n \treturn 0;\n@@ -2269,13 +2279,13 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)\n \tconst char *name, *params;\n \tint ret;\n \tstruct rte_kvargs *kvlist = NULL;\n-\tchar tun_name[RTE_ETH_NAME_MAX_LEN];\n-\tchar remote_iface[RTE_ETH_NAME_MAX_LEN];\n+\tchar tun_name[IFNAMSIZ];\n+\tchar remote_iface[IFNAMSIZ];\n \tstruct rte_eth_dev *eth_dev;\n \n \tname = rte_vdev_device_name(dev);\n \tparams = rte_vdev_device_args(dev);\n-\tmemset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);\n+\tmemset(remote_iface, 0, IFNAMSIZ);\n \n \tif (rte_eal_process_type() == RTE_PROC_SECONDARY &&\n \t    strlen(params) == 0) {\n@@ -2291,7 +2301,7 @@ rte_pmd_tun_probe(struct rte_vdev_device *dev)\n \t}\n \n \t/* use tun%d which causes kernel to choose next available */\n-\tstrlcpy(tun_name, DEFAULT_TUN_NAME \"%d\", RTE_ETH_NAME_MAX_LEN);\n+\tstrlcpy(tun_name, DEFAULT_TUN_NAME \"%d\", IFNAMSIZ);\n \n \tif (params && (params[0] != '\\0')) {\n \t\tTAP_LOG(DEBUG, \"parameters (%s)\", params);\n@@ -2431,8 +2441,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \tint ret;\n \tstruct rte_kvargs *kvlist = NULL;\n \tint speed;\n-\tchar tap_name[RTE_ETH_NAME_MAX_LEN];\n-\tchar remote_iface[RTE_ETH_NAME_MAX_LEN];\n+\tchar tap_name[IFNAMSIZ];\n+\tchar remote_iface[IFNAMSIZ];\n \tstruct rte_ether_addr user_mac = { .addr_bytes = {0} };\n \tstruct rte_eth_dev *eth_dev;\n \tint tap_devices_count_increased = 0;\n@@ -2486,8 +2496,8 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \tspeed = RTE_ETH_SPEED_NUM_10G;\n \n \t/* use tap%d which causes kernel to choose next available */\n-\tstrlcpy(tap_name, DEFAULT_TAP_NAME \"%d\", RTE_ETH_NAME_MAX_LEN);\n-\tmemset(remote_iface, 0, RTE_ETH_NAME_MAX_LEN);\n+\tstrlcpy(tap_name, DEFAULT_TAP_NAME \"%d\", IFNAMSIZ);\n+\tmemset(remote_iface, 0, IFNAMSIZ);\n \n \tif (params && (params[0] != '\\0')) {\n \t\tTAP_LOG(DEBUG, \"parameters (%s)\", params);\ndiff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h\nindex ce4322ad04..ca510e2c6b 100644\n--- a/drivers/net/tap/rte_eth_tap.h\n+++ b/drivers/net/tap/rte_eth_tap.h\n@@ -68,15 +68,16 @@ struct tx_queue {\n \n struct pmd_internals {\n \tstruct rte_eth_dev *dev;          /* Ethernet device. */\n-\tchar remote_iface[RTE_ETH_NAME_MAX_LEN]; /* Remote netdevice name */\n-\tchar name[RTE_ETH_NAME_MAX_LEN];  /* Internal Tap device name */\n+\tchar remote_iface[IFNAMSIZ];\t  /* Remote netdevice name */\n+\tchar name[IFNAMSIZ];\t\t  /* Internal Tap device name */\n \tint type;                         /* Type field - TUN|TAP */\n \tint persist;\t\t\t  /* 1 if keep link up, else 0 */\n \tstruct rte_ether_addr eth_addr;   /* Mac address of the device port */\n-\tstruct ifreq remote_initial_flags;/* Remote netdevice flags on init */\n+\tuint16_t remote_flags;\t\t  /* Remote netdevice flags on init */\n \tint remote_if_index;              /* remote netdevice IF_INDEX */\n \tint if_index;                     /* IF_INDEX for the port */\n \tint ioctl_sock;                   /* socket for ioctl calls */\n+\tint ka_fd;                        /* keep-alive file descriptor */\n \n #ifdef HAVE_TCA_FLOWER\n \tint nlsk_fd;                      /* Netlink socket fd */\n@@ -88,12 +89,11 @@ struct pmd_internals {\n \t/* implicit rte_flow rules set when a remote device is active */\n \tLIST_HEAD(tap_implicit_flows, rte_flow) implicit_flows;\n #endif\n+\tstruct rte_intr_handle *intr_handle;         /* LSC interrupt handle. */\n+\tstruct rte_mempool *gso_ctx_mp;     /* Mempool for GSO packets */\n \n \tstruct rx_queue rxq[RTE_PMD_TAP_MAX_QUEUES]; /* List of RX queues */\n \tstruct tx_queue txq[RTE_PMD_TAP_MAX_QUEUES]; /* List of TX queues */\n-\tstruct rte_intr_handle *intr_handle;         /* LSC interrupt handle. */\n-\tint ka_fd;                        /* keep-alive file descriptor */\n-\tstruct rte_mempool *gso_ctx_mp;     /* Mempool for GSO packets */\n };\n \n struct pmd_process_private {\n",
    "prefixes": [
        "v9",
        "9/9"
    ]
}