get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 91546,
    "url": "https://patches.dpdk.org/api/patches/91546/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1618470748-12369-1-git-send-email-humin29@huawei.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": "<1618470748-12369-1-git-send-email-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1618470748-12369-1-git-send-email-humin29@huawei.com",
    "date": "2021-04-15T07:12:28",
    "name": "examples/timer: fix incorrect time interval",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b476a6807b6d3e425a37d1bef7055c3c39d07be3",
    "submitter": {
        "id": 1944,
        "url": "https://patches.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@huawei.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1618470748-12369-1-git-send-email-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 16398,
            "url": "https://patches.dpdk.org/api/series/16398/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=16398",
            "date": "2021-04-15T07:12:28",
            "name": "examples/timer: fix incorrect time interval",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/16398/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/91546/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/91546/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 6F61FA0A0C;\n\tThu, 15 Apr 2021 09:12:21 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 26FE2162075;\n\tThu, 15 Apr 2021 09:12:21 +0200 (CEST)",
            "from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35])\n by mails.dpdk.org (Postfix) with ESMTP id 8FACA16206F\n for <dev@dpdk.org>; Thu, 15 Apr 2021 09:12:19 +0200 (CEST)",
            "from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60])\n by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FLVpb5CW7zB1GF;\n Thu, 15 Apr 2021 15:09:59 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id\n 14.3.498.0; Thu, 15 Apr 2021 15:12:12 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <rsanford@akamai.com>,\n <erik.g.carrillo@intel.com>",
        "Date": "Thu, 15 Apr 2021 15:12:28 +0800",
        "Message-ID": "<1618470748-12369-1-git-send-email-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH] examples/timer: fix incorrect time interval",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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": "From: Chengchang Tang <tangchengchang@huawei.com>\n\nTimer sample example assumes that the frequency of the timer is about\n2Ghz to control the period of calling rte_timer_manage(). But this\nassumption is easy to fail. For example. the frequency of tsc on ARM64\nis much less than 2Ghz.\n\nThis patch uses the frequency of the current timer to calculate the\ncorrect time interval to ensure consistent result on all platforms.\n\nIn addition, the rte_rdtsc() is replaced with the more recommended\nrte_get_timer_cycles function in this patch.\n\nFixes: af75078fece3 (\"first public release\")\nCc: stable@dpdk.org\n\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n examples/timer/main.c | 22 ++++++++++++----------\n 1 file changed, 12 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/examples/timer/main.c b/examples/timer/main.c\nindex 5a57e48..05f4a9f 100644\n--- a/examples/timer/main.c\n+++ b/examples/timer/main.c\n@@ -18,8 +18,7 @@\n #include <rte_timer.h>\n #include <rte_debug.h>\n \n-#define TIMER_RESOLUTION_CYCLES 20000000ULL /* around 10ms at 2 Ghz */\n-\n+static uint64_t timer_resolution_cycles;\n static struct rte_timer timer0;\n static struct rte_timer timer1;\n \n@@ -66,15 +65,16 @@ lcore_mainloop(__rte_unused void *arg)\n \n \twhile (1) {\n \t\t/*\n-\t\t * Call the timer handler on each core: as we don't\n-\t\t * need a very precise timer, so only call\n-\t\t * rte_timer_manage() every ~10ms (at 2Ghz). In a real\n-\t\t * application, this will enhance performances as\n-\t\t * reading the HPET timer is not efficient.\n+\t\t * Call the timer handler on each core: as we don't need a\n+\t\t * very precise timer, so only call rte_timer_manage()\n+\t\t * every ~10ms. since rte_eal_hpet_init() has not been\n+\t\t * called, the rte_rdtsc() will be used at runtime.\n+\t\t * In a real application, this will enhance performances\n+\t\t * as reading the HPET timer is not efficient.\n \t\t */\n-\t\tcur_tsc = rte_rdtsc();\n+\t\tcur_tsc = rte_get_timer_cycles();\n \t\tdiff_tsc = cur_tsc - prev_tsc;\n-\t\tif (diff_tsc > TIMER_RESOLUTION_CYCLES) {\n+\t\tif (diff_tsc > timer_resolution_cycles) {\n \t\t\trte_timer_manage();\n \t\t\tprev_tsc = cur_tsc;\n \t\t}\n@@ -100,8 +100,10 @@ main(int argc, char **argv)\n \trte_timer_init(&timer0);\n \trte_timer_init(&timer1);\n \n-\t/* load timer0, every second, on main lcore, reloaded automatically */\n \thz = rte_get_timer_hz();\n+\ttimer_resolution_cycles = hz * 10 / 1000; /* around 10ms */\n+\n+\t/* load timer0, every second, on main lcore, reloaded automatically */\n \tlcore_id = rte_lcore_id();\n \trte_timer_reset(&timer0, hz, PERIODICAL, lcore_id, timer0_cb, NULL);\n \n",
    "prefixes": []
}