get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1236,
    "url": "https://patches.dpdk.org/api/patches/1236/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415623967-52488-2-git-send-email-jigsaw@gmail.com/",
    "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": "<1415623967-52488-2-git-send-email-jigsaw@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415623967-52488-2-git-send-email-jigsaw@gmail.com",
    "date": "2014-11-10T12:52:46",
    "name": "[dpdk-dev,v2,1/2] Add new union field usr in mbuf->hash.",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "811e2872268722c2765dc0a0eff5aea0ee47c6e7",
    "submitter": {
        "id": 105,
        "url": "https://patches.dpdk.org/api/people/105/?format=api",
        "name": "Qinglai Xiao",
        "email": "jigsaw@gmail.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415623967-52488-2-git-send-email-jigsaw@gmail.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1236/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1236/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id B96A87F54;\n\tMon, 10 Nov 2014 13:43:12 +0100 (CET)",
            "from mail-la0-f41.google.com (mail-la0-f41.google.com\n\t[209.85.215.41]) by dpdk.org (Postfix) with ESMTP id 99AA97F34\n\tfor <dev@dpdk.org>; Mon, 10 Nov 2014 13:43:10 +0100 (CET)",
            "by mail-la0-f41.google.com with SMTP id s18so7601115lam.14\n\tfor <dev@dpdk.org>; Mon, 10 Nov 2014 04:52:55 -0800 (PST)",
            "from localhost.localdomain ([194.251.119.201])\n\tby mx.google.com with ESMTPSA id\n\tb4sm5263382lak.28.2014.11.10.04.52.54 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tMon, 10 Nov 2014 04:52:55 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=QQX493ayEXRWZaJEZy0g/PU8ZkXJPJxOiS6phY695WI=;\n\tb=PKi3DgMhXyNdeezFJoV3TPfYcBNzR3atWYU91E5lk849EX7XoJkJB7nYzII12RIMII\n\tSd6ck5Af6B8SDou6+q1imC3lciKWjCT7rvxF5SXmtkTFdHHWo9KKPF9R7mr/0ROQA7pJ\n\tS7J7y8x1RbsVukwdAhc/QkvPwzF7uJSLX0fpclKbwm/WEJO2GjyZU/esTue3pHvhwAr+\n\t5KUBNl8stgdfZQ1pmeckzZimWY729Y6x8aDJP93eaA3Qdo44XUV9oaiyQg59iGs1BSuU\n\tsOJIP9HK0Pf7xyfgBOqUId5kmsSQq5nPfC/U2hPo5cPWT2l9hRHg/BYtx5ltceYHHj6p\n\tVq9Q==",
        "X-Received": "by 10.152.88.1 with SMTP id bc1mr2001127lab.96.1415623975523;\n\tMon, 10 Nov 2014 04:52:55 -0800 (PST)",
        "From": "Qinglai Xiao <jigsaw@gmail.com>",
        "To": "dev@dpdk.org",
        "Date": "Mon, 10 Nov 2014 14:52:46 +0200",
        "Message-Id": "<1415623967-52488-2-git-send-email-jigsaw@gmail.com>",
        "X-Mailer": "git-send-email 1.7.1",
        "In-Reply-To": "<1415623967-52488-1-git-send-email-jigsaw@gmail.com>",
        "References": "<1415623967-52488-1-git-send-email-jigsaw@gmail.com>",
        "Cc": "Qinglai Xiao <jigsaw@gmail.com>",
        "Subject": "[dpdk-dev] [PATCH v2 1/2] Add new union field usr in mbuf->hash.",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This field is added for librte_distributor. User of librte_distributor\nis advocated to set value of mbuf->hash.usr before calling\nrte_distributor_process. The value of usr is the tag which stands as\nidentifier of flow.\n\nSigned-off-by: Qinglai Xiao <jigsaw@gmail.com>\n---\n app/test/test_distributor.c              |   18 +++++++++---------\n app/test/test_distributor_perf.c         |    4 ++--\n lib/librte_distributor/rte_distributor.c |    2 +-\n lib/librte_mbuf/rte_mbuf.h               |    1 +\n 4 files changed, 13 insertions(+), 12 deletions(-)",
    "diff": "diff --git a/app/test/test_distributor.c b/app/test/test_distributor.c\nindex ce06436..9e8c06d 100644\n--- a/app/test/test_distributor.c\n+++ b/app/test/test_distributor.c\n@@ -120,7 +120,7 @@ sanity_test(struct rte_distributor *d, struct rte_mempool *p)\n \t/* now set all hash values in all buffers to zero, so all pkts go to the\n \t * one worker thread */\n \tfor (i = 0; i < BURST; i++)\n-\t\tbufs[i]->hash.rss = 0;\n+\t\tbufs[i]->hash.usr = 0;\n \n \trte_distributor_process(d, bufs, BURST);\n \trte_distributor_flush(d);\n@@ -142,7 +142,7 @@ sanity_test(struct rte_distributor *d, struct rte_mempool *p)\n \tif (rte_lcore_count() >= 3) {\n \t\tclear_packet_count();\n \t\tfor (i = 0; i < BURST; i++)\n-\t\t\tbufs[i]->hash.rss = (i & 1) << 8;\n+\t\t\tbufs[i]->hash.usr = (i & 1) << 8;\n \n \t\trte_distributor_process(d, bufs, BURST);\n \t\trte_distributor_flush(d);\n@@ -167,7 +167,7 @@ sanity_test(struct rte_distributor *d, struct rte_mempool *p)\n \t * so load gets distributed */\n \tclear_packet_count();\n \tfor (i = 0; i < BURST; i++)\n-\t\tbufs[i]->hash.rss = i;\n+\t\tbufs[i]->hash.usr = i;\n \n \trte_distributor_process(d, bufs, BURST);\n \trte_distributor_flush(d);\n@@ -199,7 +199,7 @@ sanity_test(struct rte_distributor *d, struct rte_mempool *p)\n \t\treturn -1;\n \t}\n \tfor (i = 0; i < BIG_BATCH; i++)\n-\t\tmany_bufs[i]->hash.rss = i << 2;\n+\t\tmany_bufs[i]->hash.usr = i << 2;\n \n \tfor (i = 0; i < BIG_BATCH/BURST; i++) {\n \t\trte_distributor_process(d, &many_bufs[i*BURST], BURST);\n@@ -280,7 +280,7 @@ sanity_test_with_mbuf_alloc(struct rte_distributor *d, struct rte_mempool *p)\n \t\twhile (rte_mempool_get_bulk(p, (void *)bufs, BURST) < 0)\n \t\t\trte_distributor_process(d, NULL, 0);\n \t\tfor (j = 0; j < BURST; j++) {\n-\t\t\tbufs[j]->hash.rss = (i+j) << 1;\n+\t\t\tbufs[j]->hash.usr = (i+j) << 1;\n \t\t\trte_mbuf_refcnt_set(bufs[j], 1);\n \t\t}\n \n@@ -359,7 +359,7 @@ sanity_test_with_worker_shutdown(struct rte_distributor *d,\n \t/* now set all hash values in all buffers to zero, so all pkts go to the\n \t * one worker thread */\n \tfor (i = 0; i < BURST; i++)\n-\t\tbufs[i]->hash.rss = 0;\n+\t\tbufs[i]->hash.usr = 0;\n \n \trte_distributor_process(d, bufs, BURST);\n \t/* at this point, we will have processed some packets and have a full\n@@ -372,7 +372,7 @@ sanity_test_with_worker_shutdown(struct rte_distributor *d,\n \t\treturn -1;\n \t}\n \tfor (i = 0; i < BURST; i++)\n-\t\tbufs[i]->hash.rss = 0;\n+\t\tbufs[i]->hash.usr = 0;\n \n \t/* get worker zero to quit */\n \tzero_quit = 1;\n@@ -416,7 +416,7 @@ test_flush_with_worker_shutdown(struct rte_distributor *d,\n \t/* now set all hash values in all buffers to zero, so all pkts go to the\n \t * one worker thread */\n \tfor (i = 0; i < BURST; i++)\n-\t\tbufs[i]->hash.rss = 0;\n+\t\tbufs[i]->hash.usr = 0;\n \n \trte_distributor_process(d, bufs, BURST);\n \t/* at this point, we will have processed some packets and have a full\n@@ -488,7 +488,7 @@ quit_workers(struct rte_distributor *d, struct rte_mempool *p)\n \tzero_quit = 0;\n \tquit = 1;\n \tfor (i = 0; i < num_workers; i++)\n-\t\tbufs[i]->hash.rss = i << 1;\n+\t\tbufs[i]->hash.usr = i << 1;\n \trte_distributor_process(d, bufs, num_workers);\n \n \trte_mempool_put_bulk(p, (void *)bufs, num_workers);\ndiff --git a/app/test/test_distributor_perf.c b/app/test/test_distributor_perf.c\nindex b04864c..48ee344 100644\n--- a/app/test/test_distributor_perf.c\n+++ b/app/test/test_distributor_perf.c\n@@ -159,7 +159,7 @@ perf_test(struct rte_distributor *d, struct rte_mempool *p)\n \t}\n \t/* ensure we have different hash value for each pkt */\n \tfor (i = 0; i < BURST; i++)\n-\t\tbufs[i]->hash.rss = i;\n+\t\tbufs[i]->hash.usr = i;\n \n \tstart = rte_rdtsc();\n \tfor (i = 0; i < (1<<ITER_POWER); i++)\n@@ -198,7 +198,7 @@ quit_workers(struct rte_distributor *d, struct rte_mempool *p)\n \n \tquit = 1;\n \tfor (i = 0; i < num_workers; i++)\n-\t\tbufs[i]->hash.rss = i << 1;\n+\t\tbufs[i]->hash.usr = i << 1;\n \trte_distributor_process(d, bufs, num_workers);\n \n \trte_mempool_put_bulk(p, (void *)bufs, num_workers);\ndiff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c\nindex 656ee5c..3dfec4a 100644\n--- a/lib/librte_distributor/rte_distributor.c\n+++ b/lib/librte_distributor/rte_distributor.c\n@@ -289,7 +289,7 @@ rte_distributor_process(struct rte_distributor *d,\n \t\t\t * use the zero-value to indicate that no packet is\n \t\t\t * being processed by a worker.\n \t\t\t */\n-\t\t\tnew_tag = (next_mb->hash.rss | 1);\n+\t\t\tnew_tag = (next_mb->hash.usr | 1);\n \n \t\t\tuint32_t match = 0;\n \t\t\tunsigned i;\ndiff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h\nindex e8f9bfc..f5f8658 100644\n--- a/lib/librte_mbuf/rte_mbuf.h\n+++ b/lib/librte_mbuf/rte_mbuf.h\n@@ -185,6 +185,7 @@ struct rte_mbuf {\n \t\t\tuint16_t id;\n \t\t} fdir;           /**< Filter identifier if FDIR enabled */\n \t\tuint32_t sched;   /**< Hierarchical scheduler */\n+\t\tuint32_t usr;\t  /**< User defined tags. See @rte_distributor_process */\n \t} hash;                   /**< hash information */\n \n \t/* second cache line - fields only used in slow path or on TX */\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "1/2"
    ]
}