Show a patch.

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

{
    "id": 355,
    "url": "https://patches.dpdk.org/api/patches/355/",
    "web_url": "https://patches.dpdk.org/patch/355/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1410445387-4849-2-git-send-email-bruce.richardson@intel.com>",
    "date": "2014-09-11T14:23:05",
    "name": "[dpdk-dev,1/3] eal: add core id param to eal_thread_set_affinity",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "4f4208c2e82a16e8792ddb001370e1abdfcb6a45",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/patch/355/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/355/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/355/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "References": "<1410445387-4849-1-git-send-email-bruce.richardson@intel.com>",
        "X-Mailman-Version": "2.1.15",
        "X-IronPort-AV": "E=Sophos;i=\"5.04,506,1406617200\"; d=\"scan'208\";a=\"476889860\"",
        "Date": "Thu, 11 Sep 2014 15:23:05 +0100",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<1410445387-4849-2-git-send-email-bruce.richardson@intel.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id EA514B3A2;\n\tThu, 11 Sep 2014 16:18:22 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 92CCAB3A1\n\tfor <dev@dpdk.org>; Thu, 11 Sep 2014 16:18:19 +0200 (CEST)",
            "from azsmga001.ch.intel.com ([10.2.17.19])\n\tby orsmga101.jf.intel.com with ESMTP; 11 Sep 2014 07:23:30 -0700",
            "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby azsmga001.ch.intel.com with ESMTP; 11 Sep 2014 07:23:08 -0700",
            "from sivswdev02.ir.intel.com (sivswdev02.ir.intel.com\n\t[10.237.217.46])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\ts8BEN7YA013312; Thu, 11 Sep 2014 15:23:07 +0100",
            "from sivswdev02.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev02.ir.intel.com with ESMTP id s8BEN7Ht004896;\n\tThu, 11 Sep 2014 15:23:07 +0100",
            "(from bricha3@localhost)\n\tby sivswdev02.ir.intel.com with  id s8BEN7cL004892;\n\tThu, 11 Sep 2014 15:23:07 +0100"
        ],
        "List-Post": "<mailto:dev@dpdk.org>",
        "Subject": "[dpdk-dev] [PATCH 1/3] eal: add core id param to\n\teal_thread_set_affinity",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "Precedence": "list",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "X-ExtLoop1": "1",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "Delivered-To": "patchwork@dpdk.org",
        "In-Reply-To": "<1410445387-4849-1-git-send-email-bruce.richardson@intel.com>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "To": "dev@dpdk.org",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "the function eal_thread_set_affinity always sets the affinity of the\nthread to the lcore_id of the thread as given by the thread-local\nvariable. To allow this function to be used by arbitrary threads\n(e.g. eal utility threads such as those for interrupts, timers, etc.),\nadd a parameter to specify the core id to be used for the affinity.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_eal/bsdapp/eal/eal_thread.c   | 10 +++++-----\n lib/librte_eal/linuxapp/eal/eal_thread.c | 10 +++++-----\n 2 files changed, 10 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/bsdapp/eal/eal_thread.c b/lib/librte_eal/bsdapp/eal/eal_thread.c\nindex ab05368..18df2a3 100644\n--- a/lib/librte_eal/bsdapp/eal/eal_thread.c\n+++ b/lib/librte_eal/bsdapp/eal/eal_thread.c\n@@ -96,7 +96,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)\n \n /* set affinity for current thread */\n static int\n-eal_thread_set_affinity(void)\n+eal_thread_set_affinity(unsigned lcore_id)\n {\n \tint s;\n \tpthread_t thread;\n@@ -126,7 +126,7 @@ eal_thread_set_affinity(void)\n \n \tsize = CPU_ALLOC_SIZE(RTE_MAX_LCORE);\n \tCPU_ZERO_S(size, cpusetp);\n-\tCPU_SET_S(rte_lcore_id(), size, cpusetp);\n+\tCPU_SET_S(lcore_id, size, cpusetp);\n \n \tthread = pthread_self();\n \ts = pthread_setaffinity_np(thread, size, cpusetp);\n@@ -140,7 +140,7 @@ eal_thread_set_affinity(void)\n #else /* CPU_ALLOC */\n \tcpuset_t cpuset;\n \tCPU_ZERO( &cpuset );\n-\tCPU_SET( rte_lcore_id(), &cpuset );\n+\tCPU_SET(lcore_id, &cpuset );\n \n \tthread = pthread_self();\n \ts = pthread_setaffinity_np(thread, sizeof( cpuset ), &cpuset);\n@@ -158,7 +158,7 @@ void eal_thread_init_master(unsigned lcore_id)\n \tRTE_PER_LCORE(_lcore_id) = lcore_id;\n \n \t/* set CPU affinity */\n-\tif (eal_thread_set_affinity() < 0)\n+\tif (eal_thread_set_affinity(lcore_id) < 0)\n \t\trte_panic(\"cannot set affinity\\n\");\n }\n \n@@ -192,7 +192,7 @@ eal_thread_loop(__attribute__((unused)) void *arg)\n \tRTE_PER_LCORE(_lcore_id) = lcore_id;\n \n \t/* set CPU affinity */\n-\tif (eal_thread_set_affinity() < 0)\n+\tif (eal_thread_set_affinity(lcore_id) < 0)\n \t\trte_panic(\"cannot set affinity\\n\");\n \n \t/* read on our pipe to get commands */\ndiff --git a/lib/librte_eal/linuxapp/eal/eal_thread.c b/lib/librte_eal/linuxapp/eal/eal_thread.c\nindex 80a985f..9dc3f98 100644\n--- a/lib/librte_eal/linuxapp/eal/eal_thread.c\n+++ b/lib/librte_eal/linuxapp/eal/eal_thread.c\n@@ -96,7 +96,7 @@ rte_eal_remote_launch(int (*f)(void *), void *arg, unsigned slave_id)\n \n /* set affinity for current thread */\n static int\n-eal_thread_set_affinity(void)\n+eal_thread_set_affinity(unsigned lcore_id)\n {\n \tint s;\n \tpthread_t thread;\n@@ -126,7 +126,7 @@ eal_thread_set_affinity(void)\n \n \tsize = CPU_ALLOC_SIZE(RTE_MAX_LCORE);\n \tCPU_ZERO_S(size, cpusetp);\n-\tCPU_SET_S(rte_lcore_id(), size, cpusetp);\n+\tCPU_SET_S(lcore_id, size, cpusetp);\n \n \tthread = pthread_self();\n \ts = pthread_setaffinity_np(thread, size, cpusetp);\n@@ -140,7 +140,7 @@ eal_thread_set_affinity(void)\n #else /* CPU_ALLOC */\n \tcpu_set_t cpuset;\n \tCPU_ZERO( &cpuset );\n-\tCPU_SET( rte_lcore_id(), &cpuset );\n+\tCPU_SET(lcore_id, &cpuset);\n \n \tthread = pthread_self();\n \ts = pthread_setaffinity_np(thread, sizeof( cpuset ), &cpuset);\n@@ -158,7 +158,7 @@ void eal_thread_init_master(unsigned lcore_id)\n \tRTE_PER_LCORE(_lcore_id) = lcore_id;\n \n \t/* set CPU affinity */\n-\tif (eal_thread_set_affinity() < 0)\n+\tif (eal_thread_set_affinity(lcore_id) < 0)\n \t\trte_panic(\"cannot set affinity\\n\");\n }\n \n@@ -192,7 +192,7 @@ eal_thread_loop(__attribute__((unused)) void *arg)\n \tRTE_PER_LCORE(_lcore_id) = lcore_id;\n \n \t/* set CPU affinity */\n-\tif (eal_thread_set_affinity() < 0)\n+\tif (eal_thread_set_affinity(lcore_id) < 0)\n \t\trte_panic(\"cannot set affinity\\n\");\n \n \t/* read on our pipe to get commands */\n",
    "prefixes": [
        "dpdk-dev",
        "1/3"
    ]
}