get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 139670,
    "url": "http://patches.dpdk.org/api/patches/139670/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240423030243.59895-1-wujianyue000@163.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": "<20240423030243.59895-1-wujianyue000@163.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240423030243.59895-1-wujianyue000@163.com",
    "date": "2024-04-23T03:02:43",
    "name": "eal/linux: enhanced error handling for affinity",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "ef4a90fd44bf2c7fe8eb682cf751b6eaceb7d26a",
    "submitter": {
        "id": 3318,
        "url": "http://patches.dpdk.org/api/people/3318/?format=api",
        "name": "Jianyue Wu",
        "email": "wujianyue000@163.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20240423030243.59895-1-wujianyue000@163.com/mbox/",
    "series": [
        {
            "id": 31816,
            "url": "http://patches.dpdk.org/api/series/31816/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31816",
            "date": "2024-04-23T03:02:43",
            "name": "eal/linux: enhanced error handling for affinity",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/31816/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/139670/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/139670/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 9889143EF7;\n\tWed, 24 Apr 2024 16:18:27 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6E81D434FA;\n\tWed, 24 Apr 2024 16:18:27 +0200 (CEST)",
            "from m16.mail.163.com (m16.mail.163.com [117.135.210.3])\n by mails.dpdk.org (Postfix) with ESMTP id 3EC9F40269\n for <dev@dpdk.org>; Tue, 23 Apr 2024 05:02:51 +0200 (CEST)",
            "from ubuntu2204.. (unknown [36.24.144.104])\n by gzga-smtp-mta-g1-5 (Coremail) with SMTP id\n _____wD3XxvWJCdm6yU5CA--.8084S2;\n Tue, 23 Apr 2024 11:02:46 +0800 (CST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com;\n s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=cEQiN\n xSsjbWYWzUiprQnnfeZdHUZaKTqvK7M6V4nS08=; b=cKINuEuNTaJI67WZCaaZc\n Re0ls03fPFKRNda0tb/XJlQsNgarxfzTPB5Lpx8D9jlGNLiSxCD3a7G7lGcPfOxN\n 7XvnuVaYQkhFFNTG9kdxDB4nwY5k0SHFsJrU81LqUNrfOedHpUOhqA9SE2mtaeta\n if0W4+Gtf8e1VpCiQskOoU=",
        "From": "Jianyue Wu <wujianyue000@163.com>",
        "To": "",
        "Cc": "dev@dpdk.org,\n\tJianyue Wu <wujianyue000@163.com>",
        "Subject": "[PATCH] eal/linux: enhanced error handling for affinity",
        "Date": "Tue, 23 Apr 2024 11:02:43 +0800",
        "Message-Id": "<20240423030243.59895-1-wujianyue000@163.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-CM-TRANSID": "_____wD3XxvWJCdm6yU5CA--.8084S2",
        "X-Coremail-Antispam": "1Uf129KBjvJXoW7WFW5ur47Gr1rKrW7Cr45ZFb_yoW8CF1DpF\n y0k3sFyrs5ArsFvw13t3W8JFyYyr4xXay7Jr97Aw1fA3y3Wa15Ary5KFy5Xr1rCr48W3s8\n JrW7uFWq9r4DJaUanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2\n 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pRqjgcUUUUU=",
        "X-Originating-IP": "[36.24.144.104]",
        "X-CM-SenderInfo": "5zxmxtpq1xviiqq6il2tof0z/1tbisBfJemV4JBBHlgAAss",
        "X-Mailman-Approved-At": "Wed, 24 Apr 2024 16:18:26 +0200",
        "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": "Improve the robustness of setting thread affinity in DPDK\nby adding detailed error logging.\n\nChanges:\n1. Check the return value of pthread_setaffinity_np() and log an error\nif the call fails.\n2. Include the current thread name, the intended CPU set, and a detailed\nerror message in the log.\n\nSample prints:\nEAL: Cannot set affinity for thread dpdk-test with cpus 0,\nret: 22, errno: 0, error description: Success\nEAL: Cannot set affinity for thread dpdk-worker1 with cpus 1,\nret: 22, errno: 0, error description: Success\n\nSigned-off-by: Jianyue Wu <wujianyue000@163.com>\n---\n lib/eal/unix/rte_thread.c | 22 ++++++++++++++++++++--\n 1 file changed, 20 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/eal/unix/rte_thread.c b/lib/eal/unix/rte_thread.c\nindex 1b4c73f58e..8f9eaf0dcf 100644\n--- a/lib/eal/unix/rte_thread.c\n+++ b/lib/eal/unix/rte_thread.c\n@@ -369,8 +369,26 @@ int\n rte_thread_set_affinity_by_id(rte_thread_t thread_id,\n \t\tconst rte_cpuset_t *cpuset)\n {\n-\treturn pthread_setaffinity_np((pthread_t)thread_id.opaque_id,\n-\t\tsizeof(*cpuset), cpuset);\n+\tint ret;\n+\tchar cpus_str[RTE_CPU_AFFINITY_STR_LEN] = {'\\0'};\n+\tchar thread_name[RTE_MAX_THREAD_NAME_LEN] = {'\\0'};\n+\n+\terrno = 0;\n+\tret = pthread_setaffinity_np((pthread_t)thread_id.opaque_id,\n+\t\t\t\tsizeof(*cpuset), cpuset);\n+\tif (ret != 0) {\n+\t\tif (pthread_getname_np((pthread_t)thread_id.opaque_id,\n+\t\t\t\t\tthread_name, sizeof(thread_name)) != 0)\n+\t\t\tEAL_LOG(ERR, \"pthread_getname_np failed!\");\n+\t\tif (eal_thread_dump_affinity(cpuset, cpus_str, RTE_CPU_AFFINITY_STR_LEN) != 0)\n+\t\t\tEAL_LOG(ERR, \"eal_thread_dump_affinity failed!\");\n+\t\tEAL_LOG(ERR, \"Cannot set affinity for thread %s with cpus %s, \"\n+\t\t\t\"ret: %d, errno: %d, error description: %s\",\n+\t\t\tthread_name, cpus_str,\n+\t\t\tret, errno, strerror(errno));\n+\t}\n+\n+\treturn ret;\n }\n \n int\n",
    "prefixes": []
}