get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45124,
    "url": "https://patches.dpdk.org/api/patches/45124/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1537545703-9599-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": "<1537545703-9599-1-git-send-email-reshma.pattan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1537545703-9599-1-git-send-email-reshma.pattan@intel.com",
    "date": "2018-09-21T16:01:43",
    "name": "latencystats: fix timestamp marking and latency calculation",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "69cf277a5a593927ca6e72ea6dd03de6fff55987",
    "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/1537545703-9599-1-git-send-email-reshma.pattan@intel.com/mbox/",
    "series": [
        {
            "id": 1445,
            "url": "https://patches.dpdk.org/api/series/1445/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1445",
            "date": "2018-09-21T16:01:43",
            "name": "latencystats: fix timestamp marking and latency calculation",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/1445/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/45124/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/45124/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 B61C15398;\n\tFri, 21 Sep 2018 18:02:19 +0200 (CEST)",
            "from mga12.intel.com (mga12.intel.com [192.55.52.136])\n\tby dpdk.org (Postfix) with ESMTP id EF9485323\n\tfor <dev@dpdk.org>; Fri, 21 Sep 2018 18:02:17 +0200 (CEST)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n\tby fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t21 Sep 2018 09:02:17 -0700",
            "from sivswdev02.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.46])\n\tby fmsmga006.fm.intel.com with ESMTP; 21 Sep 2018 09:01:48 -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,285,1534834800\"; d=\"scan'208\";a=\"265591898\"",
        "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": "Fri, 21 Sep 2018 17:01:43 +0100",
        "Message-Id": "<1537545703-9599-1-git-send-email-reshma.pattan@intel.com>",
        "X-Mailer": "git-send-email 1.7.0.7",
        "Subject": "[dpdk-dev] [PATCH] latencystats: fix timestamp marking and latency\n\tcalculation",
        "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>\n---\n lib/librte_latencystats/rte_latencystats.c | 8 ++++++--\n 1 file changed, 6 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/lib/librte_latencystats/rte_latencystats.c b/lib/librte_latencystats/rte_latencystats.c\nindex 1fdec68e3..8870226bb 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,8 @@ 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\t\tpkts[i]->timestamp)\n \t\t\tlatency[cnt++] = now - pkts[i]->timestamp;\n \t}\n \n",
    "prefixes": []
}