get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45311,
    "url": "https://patches.dpdk.org/api/patches/45311/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1537878252-21061-1-git-send-email-reshma.pattan@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": "<1537878252-21061-1-git-send-email-reshma.pattan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1537878252-21061-1-git-send-email-reshma.pattan@intel.com",
    "date": "2018-09-25T12:24:12",
    "name": "[v2] latencystats: fix timestamp marking and latency calculation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e4fe7912cc3e9ee02aa382252c79bb4b9abcc542",
    "submitter": {
        "id": 70,
        "url": "https://patches.dpdk.org/api/people/70/?format=api",
        "name": "Pattan, Reshma",
        "email": "reshma.pattan@intel.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/1537878252-21061-1-git-send-email-reshma.pattan@intel.com/mbox/",
    "series": [
        {
            "id": 1491,
            "url": "https://patches.dpdk.org/api/series/1491/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1491",
            "date": "2018-09-25T12:24:12",
            "name": "[v2] latencystats: fix timestamp marking and latency calculation",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/1491/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/45311/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/45311/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 8DBD71B122;\n\tTue, 25 Sep 2018 14:24:18 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n\tby dpdk.org (Postfix) with ESMTP id AAB0C1B11E\n\tfor <dev@dpdk.org>; Tue, 25 Sep 2018 14:24:16 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Sep 2018 05:24:15 -0700",
            "from sivswdev02.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.46])\n\tby fmsmga002.fm.intel.com with ESMTP; 25 Sep 2018 05:24:14 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.54,302,1534834800\"; d=\"scan'208\";a=\"89166309\"",
        "From": "Reshma Pattan <reshma.pattan@intel.com>",
        "To": "longtb5@viettel.com.vn,\n\tkonstantin.ananyev@intel.com,\n\tdev@dpdk.org",
        "Cc": "Reshma Pattan <reshma.pattan@intel.com>",
        "Date": "Tue, 25 Sep 2018 13:24:12 +0100",
        "Message-Id": "<1537878252-21061-1-git-send-email-reshma.pattan@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "In-Reply-To": "<1537545703-9599-1-git-send-email-reshma.pattan@intel.com>",
        "References": "<1537545703-9599-1-git-send-email-reshma.pattan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2] latencystats: fix timestamp marking and\n\tlatency calculation",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Latency calculation logic is not correct for the case where\npackets gets dropped before TX. As for the dropped packets,\nthe timestamp is not cleared, and such packets still gets\ncounted for latency calculation in next runs, that will result\nin inaccurate latency measurement.\n\nSo fix this issue as below,\n\nBefore setting timestamp in mbuf, check mbuf don't have\nany prior valid time stamp flag set and after marking\nthe timestamp, set mbuf flags to indicate timestamp is\nvalid.\n\nBefore calculating timestamp check mbuf flags are set to\nindicate timestamp is valid.\n\nWith the above logic it is guaranteed that correct timestamps\nhave been used.\n\nFixes: 5cd3cac9ed (\"latency: added new library for latency stats\")\n\nReported-by: Bao-Long Tran <longtb5@viettel.com.vn>\nSigned-off-by: Reshma Pattan <reshma.pattan@intel.com>\nTested-by: Bao-Long Tran <longtb5@viettel.com.vn>\n\n---\nv2: remove check for mbuf->timestamp\n---\n lib/librte_latencystats/rte_latencystats.c | 7 +++++--\n 1 file changed, 5 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c\nindex 1fdec68e3..0f702b722 100644\n--- a/lib/librte_latencystats/rte_latencystats.c\n+++ b/lib/librte_latencystats/rte_latencystats.c\n@@ -125,8 +125,11 @@ add_time_stamps(uint16_t pid __rte_unused,\n \tfor (i = 0; i < nb_pkts; i++) {\n \t\tdiff_tsc = now - prev_tsc;\n \t\ttimer_tsc += diff_tsc;\n-\t\tif (timer_tsc >= samp_intvl) {\n+\n+\t\tif ((pkts[i]->ol_flags & PKT_RX_TIMESTAMP) == 0\n+\t\t\t&& (timer_tsc >= samp_intvl)) {\n \t\t\tpkts[i]->timestamp = now;\n+\t\t\tpkts[i]->ol_flags |= PKT_RX_TIMESTAMP;\n \t\t\ttimer_tsc = 0;\n \t\t}\n \t\tprev_tsc = now;\n@@ -156,7 +159,7 @@ calc_latency(uint16_t pid __rte_unused,\n \n \tnow = rte_rdtsc();\n \tfor (i = 0; i < nb_pkts; i++) {\n-\t\tif (pkts[i]->timestamp)\n+\t\tif (pkts[i]->ol_flags & PKT_RX_TIMESTAMP)\n \t\t\tlatency[cnt++] = now - pkts[i]->timestamp;\n \t}\n \n",
    "prefixes": [
        "v2"
    ]
}