get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 134358,
    "url": "http://patchwork.dpdk.org/api/patches/134358/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20231114123552.398072-37-huangdengdui@huawei.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": "<20231114123552.398072-37-huangdengdui@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231114123552.398072-37-huangdengdui@huawei.com",
    "date": "2023-11-14T12:35:46",
    "name": "[v3,36/42] net/tap: use rte strerror",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "4e861b1509081fed46ee0a476d2329496fe344fd",
    "submitter": {
        "id": 3066,
        "url": "http://patchwork.dpdk.org/api/people/3066/?format=api",
        "name": "huangdengdui",
        "email": "huangdengdui@huawei.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patchwork.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20231114123552.398072-37-huangdengdui@huawei.com/mbox/",
    "series": [
        {
            "id": 30293,
            "url": "http://patchwork.dpdk.org/api/series/30293/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=30293",
            "date": "2023-11-14T12:35:13",
            "name": "replace strerror",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/30293/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/134358/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/134358/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 B271043329;\n\tTue, 14 Nov 2023 13:39:55 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 603FC4161A;\n\tTue, 14 Nov 2023 13:36:38 +0100 (CET)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id A9AFA402D8\n for <dev@dpdk.org>; Tue, 14 Nov 2023 13:35:59 +0100 (CET)",
            "from dggpeml500011.china.huawei.com (unknown [172.30.72.55])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SV5PC0df3zvQhC;\n Tue, 14 Nov 2023 20:35:43 +0800 (CST)",
            "from localhost.huawei.com (10.50.165.33) by\n dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.31; Tue, 14 Nov 2023 20:35:58 +0800"
        ],
        "From": "Dengdui Huang <huangdengdui@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@amd.com>, <stephen@networkplumber.org>,\n <lihuisong@huawei.com>, <fengchengwen@huawei.com>, <liuyonglong@huawei.com>",
        "Subject": "[PATCH v3 36/42] net/tap: use rte strerror",
        "Date": "Tue, 14 Nov 2023 20:35:46 +0800",
        "Message-ID": "<20231114123552.398072-37-huangdengdui@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20231114123552.398072-1-huangdengdui@huawei.com>",
        "References": "<20231114082539.1858594-44-huangdengdui@huawei.com>\n <20231114123552.398072-1-huangdengdui@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.50.165.33]",
        "X-ClientProxiedBy": "dggems706-chm.china.huawei.com (10.3.19.183) To\n dggpeml500011.china.huawei.com (7.185.36.84)",
        "X-CFilter-Loop": "Reflected",
        "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 function strerror() is insecure in a multi-thread environment.\nThis patch uses rte_strerror() to replace it.\n\nCc: stable@dpdk.org\n\nSigned-off-by: Dengdui Huang <huangdengdui@huawei.com>\nAcked-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n drivers/net/tap/rte_eth_tap.c | 26 +++++++++++++-------------\n drivers/net/tap/tap_flow.c    | 18 +++++++++---------\n drivers/net/tap/tap_netlink.c |  5 +++--\n drivers/net/tap/tap_tcmsgs.c  |  6 ++++--\n 4 files changed, 29 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c\nindex b41fa971cb..ff290ea5bf 100644\n--- a/drivers/net/tap/rte_eth_tap.c\n+++ b/drivers/net/tap/rte_eth_tap.c\n@@ -196,7 +196,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)\n \t/* Set the TUN/TAP configuration and set the name if needed */\n \tif (ioctl(fd, TUNSETIFF, (void *)&ifr) < 0) {\n \t\tTAP_LOG(WARNING, \"Unable to set TUNSETIFF for %s: %s\",\n-\t\t\tifr.ifr_name, strerror(errno));\n+\t\t\tifr.ifr_name, rte_strerror(errno));\n \t\tgoto error;\n \t}\n \n@@ -204,7 +204,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)\n \tif (persistent && ioctl(fd, TUNSETPERSIST, 1) < 0) {\n \t\tTAP_LOG(WARNING,\n \t\t\t\"Unable to set persist %s: %s\",\n-\t\t\tifr.ifr_name, strerror(errno));\n+\t\t\tifr.ifr_name, rte_strerror(errno));\n \t\tgoto error;\n \t}\n \n@@ -224,7 +224,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)\n \t\tif (ioctl(fd, TUNSETQUEUE, (void *)&ifr) < 0) {\n \t\t\tTAP_LOG(WARNING,\n \t\t\t\t\"Unable to detach keep-alive queue for %s: %s\",\n-\t\t\t\tifr.ifr_name, strerror(errno));\n+\t\t\t\tifr.ifr_name, rte_strerror(errno));\n \t\t\tgoto error;\n \t\t}\n \t}\n@@ -242,7 +242,7 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)\n \tif (fcntl(fd, F_SETFL, flags) < 0) {\n \t\tTAP_LOG(WARNING,\n \t\t\t\"Unable to set %s to nonblocking: %s\",\n-\t\t\tifr.ifr_name, strerror(errno));\n+\t\t\tifr.ifr_name, rte_strerror(errno));\n \t\tgoto error;\n \t}\n \n@@ -295,18 +295,18 @@ tun_alloc(struct pmd_internals *pmd, int is_keepalive, int persistent)\n \t\t/* Enable signal on file descriptor */\n \t\tif (fcntl(fd, F_SETSIG, signo) < 0) {\n \t\t\tTAP_LOG(WARNING, \"Unable to set signo %d for fd %d: %s\",\n-\t\t\t\tsigno, fd, strerror(errno));\n+\t\t\t\tsigno, fd, rte_strerror(errno));\n \t\t\tgoto error;\n \t\t}\n \t\tif (fcntl(fd, F_SETFL, flags | O_ASYNC) < 0) {\n \t\t\tTAP_LOG(WARNING, \"Unable to set fcntl flags: %s\",\n-\t\t\t\tstrerror(errno));\n+\t\t\t\trte_strerror(errno));\n \t\t\tgoto error;\n \t\t}\n \n \t\tif (fcntl(fd, F_SETOWN, getpid()) < 0) {\n \t\t\tTAP_LOG(WARNING, \"Unable to set fcntl owner: %s\",\n-\t\t\t\tstrerror(errno));\n+\t\t\t\trte_strerror(errno));\n \t\t\tgoto error;\n \t\t}\n \t}\n@@ -821,7 +821,7 @@ tap_ioctl(struct pmd_internals *pmd, unsigned long request,\n \n error:\n \tTAP_LOG(DEBUG, \"%s(%s) failed: %s(%d)\", ifr->ifr_name,\n-\t\ttap_ioctl_req2str(request), strerror(errno), errno);\n+\t\ttap_ioctl_req2str(request), rte_strerror(errno), errno);\n \treturn -errno;\n }\n \n@@ -1966,7 +1966,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,\n \tif (pmd->ioctl_sock == -1) {\n \t\tTAP_LOG(ERR,\n \t\t\t\"%s Unable to get a socket for management: %s\",\n-\t\t\ttuntap_name, strerror(errno));\n+\t\t\ttuntap_name, rte_strerror(errno));\n \t\tgoto error_exit;\n \t}\n \n@@ -2127,7 +2127,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,\n \n disable_rte_flow:\n \tTAP_LOG(ERR, \" Disabling rte flow support: %s(%d)\",\n-\t\tstrerror(errno), errno);\n+\t\trte_strerror(errno), errno);\n \tif (strlen(remote_iface)) {\n \t\tTAP_LOG(ERR, \"Remote feature requires flow support.\");\n \t\tgoto error_exit;\n@@ -2137,7 +2137,7 @@ eth_dev_tap_create(struct rte_vdev_device *vdev, const char *tap_name,\n \n error_remote:\n \tTAP_LOG(ERR, \" Can't set up remote feature: %s(%d)\",\n-\t\tstrerror(errno), errno);\n+\t\trte_strerror(errno), errno);\n \ttap_flow_implicit_flush(pmd, NULL);\n \n error_exit:\n@@ -2475,7 +2475,7 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \t\t\tret = rte_mp_action_register(TAP_MP_REQ_START_RXTX, tap_mp_req_start_rxtx);\n \t\t\tif (ret < 0 && rte_errno != ENOTSUP) {\n \t\t\t\tTAP_LOG(ERR, \"tap: Failed to register IPC callback: %s\",\n-\t\t\t\t\tstrerror(rte_errno));\n+\t\t\t\t\trte_strerror(rte_errno));\n \t\t\t\treturn -1;\n \t\t\t}\n \t\t}\n@@ -2535,7 +2535,7 @@ rte_pmd_tap_probe(struct rte_vdev_device *dev)\n \t\tret = rte_mp_action_register(TAP_MP_KEY, tap_mp_sync_queues);\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+\t\t\t\trte_strerror(rte_errno));\n \t\t\tgoto leave;\n \t\t}\n \t}\ndiff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c\nindex ed4d42f92f..9d6b84f5c7 100644\n--- a/drivers/net/tap/tap_flow.c\n+++ b/drivers/net/tap/tap_flow.c\n@@ -1409,7 +1409,7 @@ tap_flow_create(struct rte_eth_dev *dev,\n \tif (err < 0) {\n \t\tTAP_LOG(ERR,\n \t\t\t\"Kernel refused TC filter rule creation (%d): %s\",\n-\t\t\terrno, strerror(errno));\n+\t\t\terrno, rte_strerror(errno));\n \t\trte_flow_error_set(error, EEXIST, RTE_FLOW_ERROR_TYPE_HANDLE,\n \t\t\t\t   NULL,\n \t\t\t\t   \"overlapping rules or Kernel too old for flower support\");\n@@ -1454,7 +1454,7 @@ tap_flow_create(struct rte_eth_dev *dev,\n \t\tif (err < 0) {\n \t\t\tTAP_LOG(ERR,\n \t\t\t\t\"Kernel refused TC filter rule creation (%d): %s\",\n-\t\t\t\terrno, strerror(errno));\n+\t\t\t\terrno, rte_strerror(errno));\n \t\t\trte_flow_error_set(\n \t\t\t\terror, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE,\n \t\t\t\tNULL,\n@@ -1508,7 +1508,7 @@ tap_flow_destroy_pmd(struct pmd_internals *pmd,\n \tif (ret < 0) {\n \t\tTAP_LOG(ERR,\n \t\t\t\"Kernel refused TC filter rule deletion (%d): %s\",\n-\t\t\terrno, strerror(errno));\n+\t\t\terrno, rte_strerror(errno));\n \t\trte_flow_error_set(\n \t\t\terror, ENOTSUP, RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n \t\t\t\"couldn't receive kernel ack to our request\");\n@@ -1532,7 +1532,7 @@ tap_flow_destroy_pmd(struct pmd_internals *pmd,\n \t\tif (ret < 0) {\n \t\t\tTAP_LOG(ERR,\n \t\t\t\t\"Kernel refused TC filter rule deletion (%d): %s\",\n-\t\t\t\terrno, strerror(errno));\n+\t\t\t\terrno, rte_strerror(errno));\n \t\t\trte_flow_error_set(\n \t\t\t\terror, ENOMEM, RTE_FLOW_ERROR_TYPE_HANDLE,\n \t\t\t\tNULL, \"Failure trying to receive nl ack\");\n@@ -1755,7 +1755,7 @@ int tap_flow_implicit_create(struct pmd_internals *pmd,\n \t\t\tgoto success;\n \t\tTAP_LOG(ERR,\n \t\t\t\"Kernel refused TC filter rule creation (%d): %s\",\n-\t\t\terrno, strerror(errno));\n+\t\t\terrno, rte_strerror(errno));\n \t\tgoto fail;\n \t}\n \tLIST_INSERT_HEAD(&pmd->implicit_flows, remote_flow, next);\n@@ -1871,7 +1871,7 @@ static int rss_enable(struct pmd_internals *pmd,\n \tif (pmd->map_fd < 0) {\n \t\tTAP_LOG(ERR,\n \t\t\t\"Failed to create BPF map (%d): %s\",\n-\t\t\t\terrno, strerror(errno));\n+\t\t\t\terrno, rte_strerror(errno));\n \t\trte_flow_error_set(\n \t\t\terror, ENOTSUP, RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n \t\t\t\"Kernel too old or not configured \"\n@@ -1946,7 +1946,7 @@ static int rss_enable(struct pmd_internals *pmd,\n \t\tif (err < 0) {\n \t\t\tTAP_LOG(ERR,\n \t\t\t\t\"Kernel refused TC filter rule creation (%d): %s\",\n-\t\t\t\terrno, strerror(errno));\n+\t\t\t\terrno, rte_strerror(errno));\n \t\t\treturn err;\n \t\t}\n \t\tLIST_INSERT_HEAD(&pmd->rss_flows, rss_flow, next);\n@@ -2111,7 +2111,7 @@ static int rss_add_actions(struct rte_flow *flow, struct pmd_internals *pmd,\n \tif (err) {\n \t\tTAP_LOG(ERR,\n \t\t\t\"Failed to update BPF map entry #%u (%d): %s\",\n-\t\t\tflow->key_idx, errno, strerror(errno));\n+\t\t\tflow->key_idx, errno, rte_strerror(errno));\n \t\trte_flow_error_set(\n \t\t\terror, ENOTSUP, RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n \t\t\t\"Kernel too old or not configured \"\n@@ -2130,7 +2130,7 @@ static int rss_add_actions(struct rte_flow *flow, struct pmd_internals *pmd,\n \tif (flow->bpf_fd[SEC_L3_L4] < 0) {\n \t\tTAP_LOG(ERR,\n \t\t\t\"Failed to load BPF section %s (%d): %s\",\n-\t\t\t\tsec_name[SEC_L3_L4], errno, strerror(errno));\n+\t\t\t\tsec_name[SEC_L3_L4], errno, rte_strerror(errno));\n \t\trte_flow_error_set(\n \t\t\terror, ENOTSUP, RTE_FLOW_ERROR_TYPE_HANDLE, NULL,\n \t\t\t\"Kernel too old or not configured \"\ndiff --git a/drivers/net/tap/tap_netlink.c b/drivers/net/tap/tap_netlink.c\nindex 75af3404b0..354574ba29 100644\n--- a/drivers/net/tap/tap_netlink.c\n+++ b/drivers/net/tap/tap_netlink.c\n@@ -14,6 +14,7 @@\n #include <rte_malloc.h>\n #include <tap_netlink.h>\n #include <rte_random.h>\n+#include <rte_errno.h>\n \n #include \"tap_log.h\"\n \n@@ -97,7 +98,7 @@ tap_nl_final(int nlsk_fd)\n {\n \tif (close(nlsk_fd)) {\n \t\tTAP_LOG(ERR, \"Failed to close netlink socket: %s (%d)\",\n-\t\t\tstrerror(errno), errno);\n+\t\t\trte_strerror(errno), errno);\n \t\treturn -1;\n \t}\n \treturn 0;\n@@ -129,7 +130,7 @@ tap_nl_send(int nlsk_fd, struct nlmsghdr *nh)\n \t\t\tgoto retry;\n \n \t\tTAP_LOG(ERR, \"Failed to send netlink message: %s (%d)\",\n-\t\t\tstrerror(errno), errno);\n+\t\t\trte_strerror(errno), errno);\n \t\treturn -1;\n \t}\n \treturn send_bytes;\ndiff --git a/drivers/net/tap/tap_tcmsgs.c b/drivers/net/tap/tap_tcmsgs.c\nindex a3aae3c814..28d4809360 100644\n--- a/drivers/net/tap/tap_tcmsgs.c\n+++ b/drivers/net/tap/tap_tcmsgs.c\n@@ -8,6 +8,8 @@\n #include <net/if.h>\n #include <string.h>\n \n+#include <rte_errno.h>\n+\n #include <rte_log.h>\n #include <tap_tcmsgs.h>\n #include \"tap_log.h\"\n@@ -263,7 +265,7 @@ qdisc_create_multiq(int nlsk_fd, unsigned int ifindex)\n \terr = qdisc_add_multiq(nlsk_fd, ifindex);\n \tif (err < 0 && errno != -EEXIST) {\n \t\tTAP_LOG(ERR, \"Could not add multiq qdisc (%d): %s\",\n-\t\t\terrno, strerror(errno));\n+\t\t\terrno, rte_strerror(errno));\n \t\treturn -1;\n \t}\n \treturn 0;\n@@ -289,7 +291,7 @@ qdisc_create_ingress(int nlsk_fd, unsigned int ifindex)\n \terr = qdisc_add_ingress(nlsk_fd, ifindex);\n \tif (err < 0 && errno != -EEXIST) {\n \t\tTAP_LOG(ERR, \"Could not add ingress qdisc (%d): %s\",\n-\t\t\terrno, strerror(errno));\n+\t\t\terrno, rte_strerror(errno));\n \t\treturn -1;\n \t}\n \treturn 0;\n",
    "prefixes": [
        "v3",
        "36/42"
    ]
}