get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 3961,
    "url": "http://patches.dpdk.org/api/patches/3961/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1426004018-25948-7-git-send-email-stephen@networkplumber.org/",
    "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": "<1426004018-25948-7-git-send-email-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1426004018-25948-7-git-send-email-stephen@networkplumber.org",
    "date": "2015-03-10T16:13:38",
    "name": "[dpdk-dev,v2,6/6] rte_sched: eliminate floating point in calculating byte clock",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0b810d5141337b233ef33baefaa3452018d45a4b",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1426004018-25948-7-git-send-email-stephen@networkplumber.org/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/3961/comments/",
    "check": "pending",
    "checks": "http://patches.dpdk.org/api/patches/3961/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 0E6939AC1;\n\tTue, 10 Mar 2015 17:13:55 +0100 (CET)",
            "from mail-pd0-f173.google.com (mail-pd0-f173.google.com\n\t[209.85.192.173]) by dpdk.org (Postfix) with ESMTP id 7D40D9AB5\n\tfor <dev@dpdk.org>; Tue, 10 Mar 2015 17:13:52 +0100 (CET)",
            "by pdno5 with SMTP id o5so3434895pdn.1\n\tfor <dev@dpdk.org>; Tue, 10 Mar 2015 09:13:51 -0700 (PDT)",
            "from urahara.brocade.com\n\t(static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155])\n\tby mx.google.com with ESMTPSA id c8sm1836209pds.5.2015.03.10.09.13.50\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tTue, 10 Mar 2015 09:13:50 -0700 (PDT)"
        ],
        "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=lmQNrlgmWDpgKOcCkoCt4Tj+CcANC+jDVODQh4nFvtc=;\n\tb=U/dKFdEk87Jrx0RZkHb/xosIFjjnv3I4wqm4TKcl4TSdQu73yaWEiRUhxjWMXzksdK\n\tGIHmtyY3znvZMnIMjwtlCyfvEEA1QnEUVk2CBohlNNf/WR1RVmUjy+znF/ep+eASkEiw\n\tvZB/jRBFUiv2DmhBHscd9PVnZVbhdsjcAQvBlbWU3tZ+vzVYZLiXj0FkVbtaDUJtvEYE\n\tSGjNWiN2J86pALtgmE/2PljsUQR8JfaSoeJnj3lOlxGmy98Spb3hdjOssRY9JD8f2AmZ\n\tb0QQcgIYJsLA16o3vnUN0GiHenoJhrt2hC8zJlEoyQBHD/t1+nfuwrKyL7E/FKhCMqgy\n\tg4Dg==",
        "X-Gm-Message-State": "ALoCoQkPpVdF1h67+PRUat1n6lrrFw4Mfk7I57xfIM7ew/MfQQJYTJYngMxlPSv2myrGO1ziBVzU",
        "X-Received": "by 10.66.221.135 with SMTP id qe7mr66186355pac.97.1426004031725; \n\tTue, 10 Mar 2015 09:13:51 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "cristian.dumitrescu@intel.com",
        "Date": "Tue, 10 Mar 2015 09:13:38 -0700",
        "Message-Id": "<1426004018-25948-7-git-send-email-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1426004018-25948-1-git-send-email-stephen@networkplumber.org>",
        "References": "<1426004018-25948-1-git-send-email-stephen@networkplumber.org>",
        "Cc": "dev@dpdk.org, Stephen Hemminger <shemming@brocade.com>",
        "Subject": "[dpdk-dev] [PATCH v2 6/6] rte_sched: eliminate floating point in\n\tcalculating byte clock",
        "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: Stephen Hemminger <shemming@brocade.com>\n\nThe old code was doing a floating point divide for each rte_dequeue()\nwhich is very expensive. Change to using fixed point scaled math instead.\nThis improved performance from 5Gbit/sec to 10 Gbit/sec\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\nv2 -- no changes\n      despite objections, the performance observation is real\n      on Intel(R) Core(TM) i7-3770 CPU\n\n lib/librte_sched/rte_sched.c | 14 ++++++++++----\n 1 file changed, 10 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c\nindex 74d0e0a..522a647 100644\n--- a/lib/librte_sched/rte_sched.c\n+++ b/lib/librte_sched/rte_sched.c\n@@ -102,6 +102,9 @@\n \n #define RTE_SCHED_BMP_POS_INVALID             UINT32_MAX\n \n+/* For cycles_per_byte calculation */\n+#define RTE_SCHED_TIME_SHIFT\t\t      20\n+\n struct rte_sched_subport {\n \t/* Token bucket (TB) */\n \tuint64_t tb_time; /* time of last update */\n@@ -239,7 +242,7 @@ struct rte_sched_port {\n \tuint64_t time_cpu_cycles;     /* Current CPU time measured in CPU cyles */\n \tuint64_t time_cpu_bytes;      /* Current CPU time measured in bytes */\n \tuint64_t time;                /* Current NIC TX time measured in bytes */\n-\tdouble cycles_per_byte;       /* CPU cycles per byte */\n+\tuint32_t cycles_per_byte;       /* CPU cycles per byte (scaled) */\n \n \t/* Scheduling loop detection */\n \tuint32_t pipe_loop;\n@@ -657,7 +660,9 @@ rte_sched_port_config(struct rte_sched_port_params *params)\n \tport->time_cpu_cycles = rte_get_tsc_cycles();\n \tport->time_cpu_bytes = 0;\n \tport->time = 0;\n-\tport->cycles_per_byte = ((double) rte_get_tsc_hz()) / ((double) params->rate);\n+\n+\tport->cycles_per_byte = (rte_get_tsc_hz() << RTE_SCHED_TIME_SHIFT)\n+\t\t/ params->rate;\n \n \t/* Scheduling loop detection */\n \tport->pipe_loop = RTE_SCHED_PIPE_INVALID;\n@@ -2126,11 +2131,12 @@ rte_sched_port_time_resync(struct rte_sched_port *port)\n {\n \tuint64_t cycles = rte_get_tsc_cycles();\n \tuint64_t cycles_diff = cycles - port->time_cpu_cycles;\n-\tdouble bytes_diff = ((double) cycles_diff) / port->cycles_per_byte;\n+\tuint64_t bytes_diff = (cycles_diff << RTE_SCHED_TIME_SHIFT)\n+\t\t/ port->cycles_per_byte;\n \n \t/* Advance port time */\n \tport->time_cpu_cycles = cycles;\n-\tport->time_cpu_bytes += (uint64_t) bytes_diff;\n+\tport->time_cpu_bytes += bytes_diff;\n \tif (port->time < port->time_cpu_bytes) {\n \t\tport->time = port->time_cpu_bytes;\n \t}\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "6/6"
    ]
}