get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 15994,
    "url": "http://patches.dpdk.org/api/patches/15994/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1474437462-6955-1-git-send-email-nikhil.jagtap@gmail.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": "<1474437462-6955-1-git-send-email-nikhil.jagtap@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1474437462-6955-1-git-send-email-nikhil.jagtap@gmail.com",
    "date": "2016-09-21T05:57:42",
    "name": "[dpdk-dev,v2] meter: fix excess token bucket update in srtcm implementation",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b0a1db4e4ed1598059bbcd974afc8ff429cd1955",
    "submitter": {
        "id": 559,
        "url": "http://patches.dpdk.org/api/people/559/?format=api",
        "name": "Nikhil Jagtap",
        "email": "nikhil.jagtap@gmail.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/1474437462-6955-1-git-send-email-nikhil.jagtap@gmail.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/15994/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/15994/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 C6A6237B8;\n\tWed, 21 Sep 2016 07:58:52 +0200 (CEST)",
            "from mail-pf0-f193.google.com (mail-pf0-f193.google.com\n\t[209.85.192.193]) by dpdk.org (Postfix) with ESMTP id 0CE6637B2\n\tfor <dev@dpdk.org>; Wed, 21 Sep 2016 07:58:51 +0200 (CEST)",
            "by mail-pf0-f193.google.com with SMTP id n24so1900528pfb.3\n\tfor <dev@dpdk.org>; Tue, 20 Sep 2016 22:58:50 -0700 (PDT)",
            "from localhost.localdomain ([14.141.235.254])\n\tby smtp.gmail.com with ESMTPSA id\n\tx66sm83114321pfb.86.2016.09.20.22.58.48\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 20 Sep 2016 22:58:49 -0700 (PDT)"
        ],
        "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=woa5KfrHPhV84mfN9WQcS5myrb5WELgVViIu6VCuOH4=;\n\tb=EWFbICBcoHhyFZfk9P1uD377PeoP0awgb16tUBduogaH/GhggypSvZtPx4bSOzzNjJ\n\ttnh6xYQKuGbioFxT8kXzkBfMHq01r4QJHJZij8AxOTI9/6UMUCj66l1XhMHPyVGbXzXP\n\tjG+4uVptaFuG5p4hfNQHiXX6JkdmZm1RPTZXC/p1nIjGUYydZZ6Ac80qtkJCkw30Bol9\n\tpL45JlW0QEqM0BYJ5X65vIEtTszXQNL9YK5xZ5fjJttRN/bAVSrbfduoFIYg7QQym0eg\n\tElcuTn2zfz/gSrRozfU0Exz+GI0gl1Cyc8G5nLO+DuTCydkF3sw0HDTy1vCcZ/fgkxT/\n\t448Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=woa5KfrHPhV84mfN9WQcS5myrb5WELgVViIu6VCuOH4=;\n\tb=h+2Ou06ey7vZFOm5lnib6i9nhudj8jscWzf3/i670h9JKlvqdOHHFVIMgiQzDb4XAY\n\tvQSxWWR8BP8awmOk9AWp+UTVQr44GVF6EE2QBYsQuImw/wsaPnoWZ/Uz+FekNIg8jjnc\n\tmxgN500gKFvQTDrQ5GSIlLTiVomIhmfEgNPGpElG4BxmBDbRE824B5DzI0yU9DBHFr7C\n\tg+ykLCz/FcnVr9g9J+BSD2mwprYeRg6UHYzQ7sZ/nyXv1Z79W4lIJX9hI77UBuWXkKaq\n\tTznzhnjr6TytM48Bt4WHI8NhLz1tz9rhXwQBs44ZN9uu7HPMT5YrR4KO0cMMz2+q9OXv\n\tfgOA==",
        "X-Gm-Message-State": "AE9vXwNm7ybwZ/ny1ajb2w2Xdo12JM67Aun5nMu99uPwa8VKTjR4BvrK1uklh461OtQ0CQ==",
        "X-Received": "by 10.98.153.202 with SMTP id t71mr61536272pfk.114.1474437530352;\n\tTue, 20 Sep 2016 22:58:50 -0700 (PDT)",
        "From": "Nikhil Jagtap <nikhil.jagtap@gmail.com>",
        "To": "cristian.dumitrescu@intel.com",
        "Cc": "dev@dpdk.org, kannan.babu.ramia@intel.com,\n\tNikhil Jagtap <nikhil.jagtap@gmail.com>",
        "Date": "Wed, 21 Sep 2016 00:57:42 -0500",
        "Message-Id": "<1474437462-6955-1-git-send-email-nikhil.jagtap@gmail.com>",
        "X-Mailer": "git-send-email 1.7.1",
        "In-Reply-To": "<1473228910-10429-1-git-send-email-nikhil.jagtap@gmail.com>",
        "References": "<1473228910-10429-1-git-send-email-nikhil.jagtap@gmail.com>",
        "Subject": "[dpdk-dev] [PATCH v2] meter: fix excess token bucket update in\n\tsrtcm implementation",
        "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": "As per srTCM RFC 2697, we should be updating the E bucket only after the\nC bucket overflows. This patch fixes the current DPDK implementation,\nwhere we are updating both the buckets simultaneously at the same rate\n(CIR) which results in token accumulation rate of (2*CIR).\n\nSigned-off-by: Nikhil Jagtap <nikhil.jagtap@gmail.com>\n---\n\nv2:\nRemoved the else part and instead added a default initialization of te.\n\n---\n lib/librte_meter/rte_meter.h |   24 ++++++++++++++----------\n 1 files changed, 14 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/lib/librte_meter/rte_meter.h b/lib/librte_meter/rte_meter.h\nindex 2cd8d81..2ab7184 100644\n--- a/lib/librte_meter/rte_meter.h\n+++ b/lib/librte_meter/rte_meter.h\n@@ -232,13 +232,15 @@ rte_meter_srtcm_color_blind_check(struct rte_meter_srtcm *m,\n \tn_periods = time_diff / m->cir_period;\n \tm->time += n_periods * m->cir_period;\n \n+\t/* Put the tokens overflowing from tc into te bucket */\n \ttc = m->tc + n_periods * m->cir_bytes_per_period;\n-\tif (tc > m->cbs)\n+\tte = m->te;\n+\tif (tc > m->cbs) {\n+\t\tte += (tc - m->cbs);\n+\t\tif (te > m->ebs)\n+\t\t\tte = m->ebs;\n \t\ttc = m->cbs;\n-\n-\tte = m->te + n_periods * m->cir_bytes_per_period;\n-\tif (te > m->ebs)\n-\t\tte = m->ebs;\n+\t}\n \n \t/* Color logic */\n \tif (tc >= pkt_len) {\n@@ -271,13 +273,15 @@ rte_meter_srtcm_color_aware_check(struct rte_meter_srtcm *m,\n \tn_periods = time_diff / m->cir_period;\n \tm->time += n_periods * m->cir_period;\n \n+\t/* Put the tokens overflowing from tc into te bucket */\n \ttc = m->tc + n_periods * m->cir_bytes_per_period;\n-\tif (tc > m->cbs)\n+\tte = m->te;\n+\tif (tc > m->cbs) {\n+\t\tte += (tc - m->cbs);\n+\t\tif (te > m->ebs)\n+\t\t\tte = m->ebs;\n \t\ttc = m->cbs;\n-\n-\tte = m->te + n_periods * m->cir_bytes_per_period;\n-\tif (te > m->ebs)\n-\t\tte = m->ebs;\n+\t}\n \n \t/* Color logic */\n \tif ((pkt_color == e_RTE_METER_GREEN) && (tc >= pkt_len)) {\n",
    "prefixes": [
        "dpdk-dev",
        "v2"
    ]
}