get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 75240,
    "url": "http://patches.dpdk.org/api/patches/75240/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200805154601.19609-2-steven.lariau@arm.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": "<20200805154601.19609-2-steven.lariau@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200805154601.19609-2-steven.lariau@arm.com",
    "date": "2020-08-05T15:45:58",
    "name": "[1/4] test/stack: avoid trivial memory allocations",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0ea80223f5463be0e0c759b0bf121edaa08a49f6",
    "submitter": {
        "id": 1862,
        "url": "http://patches.dpdk.org/api/people/1862/?format=api",
        "name": "Steven Lariau",
        "email": "steven.lariau@arm.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200805154601.19609-2-steven.lariau@arm.com/mbox/",
    "series": [
        {
            "id": 11525,
            "url": "http://patches.dpdk.org/api/series/11525/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11525",
            "date": "2020-08-05T15:45:57",
            "name": "test/stack: improve multithreaded test",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/11525/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/75240/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/75240/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 56A21A0351;\n\tThu,  6 Aug 2020 12:27:41 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 478721C0C9;\n\tThu,  6 Aug 2020 12:27:36 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 6F54F2B98\n for <dev@dpdk.org>; Wed,  5 Aug 2020 17:46:23 +0200 (CEST)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D59981424;\n Wed,  5 Aug 2020 08:46:22 -0700 (PDT)",
            "from localhost.localdomain (unknown [10.57.38.158])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EAC023F7D7;\n Wed,  5 Aug 2020 08:46:21 -0700 (PDT)"
        ],
        "From": "Steven Lariau <steven.lariau@arm.com>",
        "To": "Gage Eads <gage.eads@intel.com>,\n\tOlivier Matz <olivier.matz@6wind.com>",
        "Cc": "dev@dpdk.org, honnappa.nagarahalli@arm.com, nd@arm.com,\n Steven Lariau <steven.lariau@arm.com>",
        "Date": "Wed,  5 Aug 2020 16:45:58 +0100",
        "Message-Id": "<20200805154601.19609-2-steven.lariau@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200805154601.19609-1-steven.lariau@arm.com>",
        "References": "<20200805154601.19609-1-steven.lariau@arm.com>",
        "X-Mailman-Approved-At": "Thu, 06 Aug 2020 12:27:33 +0200",
        "Subject": "[dpdk-dev] [PATCH 1/4] test/stack: avoid trivial memory allocations",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Replace the arguments array by one argument.\nAll objects in the args array have the same values, so there is no need\nto use an array, only one struct is enough.\nThe args object is a lot smaller, and the allocation can be replaced\nwith a stack variable.\n\nThe allocation of obj_table isn't needed either, because MAX_BULK is\nsmall. The allocation can instead be replaced with a static array.\n\nSigned-off-by: Steven Lariau <steven.lariau@arm.com>\nReviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\nReviewed-by: Phil Yang <phil.yang@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\n---\n app/test/test_stack.c | 39 ++++++---------------------------------\n 1 file changed, 6 insertions(+), 33 deletions(-)",
    "diff": "diff --git a/app/test/test_stack.c b/app/test/test_stack.c\nindex c8dac1f55..5a7273a7d 100644\n--- a/app/test/test_stack.c\n+++ b/app/test/test_stack.c\n@@ -280,16 +280,9 @@ static int\n stack_thread_push_pop(void *args)\n {\n \tstruct test_args *t = args;\n-\tvoid **obj_table;\n+\tvoid *obj_table[MAX_BULK];\n \tint i;\n \n-\tobj_table = rte_calloc(NULL, STACK_SIZE, sizeof(void *), 0);\n-\tif (obj_table == NULL) {\n-\t\tprintf(\"[%s():%u] failed to calloc %zu bytes\\n\",\n-\t\t       __func__, __LINE__, STACK_SIZE * sizeof(void *));\n-\t\treturn -1;\n-\t}\n-\n \tfor (i = 0; i < NUM_ITERS_PER_THREAD; i++) {\n \t\tunsigned int success, num;\n \n@@ -310,28 +303,25 @@ stack_thread_push_pop(void *args)\n \t\tif (rte_stack_push(t->s, obj_table, num) != num) {\n \t\t\tprintf(\"[%s():%u] Failed to push %u pointers\\n\",\n \t\t\t       __func__, __LINE__, num);\n-\t\t\trte_free(obj_table);\n \t\t\treturn -1;\n \t\t}\n \n \t\tif (rte_stack_pop(t->s, obj_table, num) != num) {\n \t\t\tprintf(\"[%s():%u] Failed to pop %u pointers\\n\",\n \t\t\t       __func__, __LINE__, num);\n-\t\t\trte_free(obj_table);\n \t\t\treturn -1;\n \t\t}\n \n \t\trte_atomic64_sub(t->sz, num);\n \t}\n \n-\trte_free(obj_table);\n \treturn 0;\n }\n \n static int\n test_stack_multithreaded(uint32_t flags)\n {\n-\tstruct test_args *args;\n+\tstruct test_args args;\n \tunsigned int lcore_id;\n \tstruct rte_stack *s;\n \trte_atomic64_t size;\n@@ -344,45 +334,28 @@ test_stack_multithreaded(uint32_t flags)\n \tprintf(\"[%s():%u] Running with %u lcores\\n\",\n \t       __func__, __LINE__, rte_lcore_count());\n \n-\targs = rte_malloc(NULL, sizeof(struct test_args) * RTE_MAX_LCORE, 0);\n-\tif (args == NULL) {\n-\t\tprintf(\"[%s():%u] failed to malloc %zu bytes\\n\",\n-\t\t       __func__, __LINE__,\n-\t\t       sizeof(struct test_args) * RTE_MAX_LCORE);\n-\t\treturn -1;\n-\t}\n-\n \ts = rte_stack_create(\"test\", STACK_SIZE, rte_socket_id(), flags);\n \tif (s == NULL) {\n \t\tprintf(\"[%s():%u] Failed to create a stack\\n\",\n \t\t       __func__, __LINE__);\n-\t\trte_free(args);\n \t\treturn -1;\n \t}\n \n \trte_atomic64_init(&size);\n+\targs.s = s;\n+\targs.sz = &size;\n \n \tRTE_LCORE_FOREACH_SLAVE(lcore_id) {\n-\t\targs[lcore_id].s = s;\n-\t\targs[lcore_id].sz = &size;\n-\n \t\tif (rte_eal_remote_launch(stack_thread_push_pop,\n-\t\t\t\t\t  &args[lcore_id], lcore_id))\n+\t\t\t\t\t  &args, lcore_id))\n \t\t\trte_panic(\"Failed to launch lcore %d\\n\", lcore_id);\n \t}\n \n-\tlcore_id = rte_lcore_id();\n-\n-\targs[lcore_id].s = s;\n-\targs[lcore_id].sz = &size;\n-\n-\tstack_thread_push_pop(&args[lcore_id]);\n+\tstack_thread_push_pop(&args);\n \n \trte_eal_mp_wait_lcore();\n \n \trte_stack_free(s);\n-\trte_free(args);\n-\n \treturn 0;\n }\n \n",
    "prefixes": [
        "1/4"
    ]
}