get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1164,
    "url": "https://patches.dpdk.org/api/patches/1164/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415282132-11056-1-git-send-email-bruce.richardson@intel.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": "<1415282132-11056-1-git-send-email-bruce.richardson@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415282132-11056-1-git-send-email-bruce.richardson@intel.com",
    "date": "2014-11-06T13:55:32",
    "name": "[dpdk-dev] distributor: add comments to make code more readable",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "3ef5a443021a073c1c17e9c5a24cfc5834ea5908",
    "submitter": {
        "id": 20,
        "url": "https://patches.dpdk.org/api/people/20/?format=api",
        "name": "Bruce Richardson",
        "email": "bruce.richardson@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415282132-11056-1-git-send-email-bruce.richardson@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1164/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1164/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 127C47F2C;\n\tThu,  6 Nov 2014 14:46:39 +0100 (CET)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id D4D187E75\n\tfor <dev@dpdk.org>; Thu,  6 Nov 2014 14:46:35 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga102.jf.intel.com with ESMTP; 06 Nov 2014 05:54:21 -0800",
            "from bricha3-mobl3.ger.corp.intel.com ([10.243.20.32])\n\tby orsmga001.jf.intel.com with SMTP; 06 Nov 2014 05:56:00 -0800",
            "by  (sSMTP sendmail emulation); Thu, 06 Nov 2014 13:55:59 +0025"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.07,326,1413270000\"; d=\"scan'208\";a=\"603453902\"",
        "From": "Bruce Richardson <bruce.richardson@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Thu,  6 Nov 2014 13:55:32 +0000",
        "Message-Id": "<1415282132-11056-1-git-send-email-bruce.richardson@intel.com>",
        "X-Mailer": "git-send-email 2.1.1",
        "In-Reply-To": "<9190772.1rnKUO3oNV@xps13>",
        "References": "<9190772.1rnKUO3oNV@xps13>",
        "Subject": "[dpdk-dev] [PATCH] distributor: add comments to make code more\n\treadable",
        "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": "From: \"Bruce Richardson\" <bruce.richardson@intel.com>\n\nAdd in some additional comments around more complex areas of the code\nso as to make the code easier to read and understand.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_distributor/rte_distributor.c | 13 +++++++++++++\n 1 file changed, 13 insertions(+)",
    "diff": "diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c\nindex 585ff88..656ee5c 100644\n--- a/lib/librte_distributor/rte_distributor.c\n+++ b/lib/librte_distributor/rte_distributor.c\n@@ -92,6 +92,7 @@ struct rte_distributor {\n \tunsigned num_workers;                 /**< Number of workers polling */\n \n \tuint32_t in_flight_tags[RTE_MAX_LCORE];\n+\t\t/**< Tracks the tag being processed per core, 0 == no pkt */\n \tstruct rte_distributor_backlog backlog[RTE_MAX_LCORE];\n \n \tunion rte_distributor_buffer bufs[RTE_MAX_LCORE];\n@@ -282,10 +283,22 @@ rte_distributor_process(struct rte_distributor *d,\n \t\t\tnext_mb = mbufs[next_idx++];\n \t\t\tnext_value = (((int64_t)(uintptr_t)next_mb)\n \t\t\t\t\t<< RTE_DISTRIB_FLAG_BITS);\n+\t\t\t/*\n+\t\t\t * Set the low bit on the tag, so we can guarantee that\n+\t\t\t * we never store a tag value of zero. That means we can\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 \n \t\t\tuint32_t match = 0;\n \t\t\tunsigned i;\n+\t\t\t/*\n+\t\t\t * to scan for a match use \"xor\" and \"not\" to get a 0/1\n+\t\t\t * value, then use shifting to merge to single \"match\"\n+\t\t\t * variable, where a one-bit indicates a match for the\n+\t\t\t * worker given by the bit-position\n+\t\t\t */\n \t\t\tfor (i = 0; i < d->num_workers; i++)\n \t\t\t\tmatch |= (!(d->in_flight_tags[i] ^ new_tag)\n \t\t\t\t\t<< i);\n",
    "prefixes": [
        "dpdk-dev"
    ]
}