get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 45328,
    "url": "https://patches.dpdk.org/api/patches/45328/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1537887086-19960-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": "<1537887086-19960-1-git-send-email-reshma.pattan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1537887086-19960-1-git-send-email-reshma.pattan@intel.com",
    "date": "2018-09-25T14:51:26",
    "name": "[v3] latencystats: fix timestamp marking and latency calculation",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "d6477f1f68210ae1aca629864238e67cca071008",
    "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/1537887086-19960-1-git-send-email-reshma.pattan@intel.com/mbox/",
    "series": [
        {
            "id": 1497,
            "url": "https://patches.dpdk.org/api/series/1497/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=1497",
            "date": "2018-09-25T14:51:26",
            "name": "[v3] latencystats: fix timestamp marking and latency calculation",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/1497/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/45328/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/45328/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 200031B397;\n\tTue, 25 Sep 2018 16:54:11 +0200 (CEST)",
            "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n\tby dpdk.org (Postfix) with ESMTP id E0DC21B2B3;\n\tTue, 25 Sep 2018 16:54:08 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t25 Sep 2018 07:54:07 -0700",
            "from sivswdev02.ir.intel.com (HELO localhost.localdomain)\n\t([10.237.217.46])\n\tby orsmga006.jf.intel.com with ESMTP; 25 Sep 2018 07:51:28 -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=\"77155593\"",
        "From": "Reshma Pattan <reshma.pattan@intel.com>",
        "To": "longtb5@viettel.com.vn,\n\tkonstantin.ananyev@intel.com,\n\tdev@dpdk.org",
        "Cc": "stable@dpdk.org,\n\tReshma Pattan <reshma.pattan@intel.com>",
        "Date": "Tue, 25 Sep 2018 15:51:26 +0100",
        "Message-Id": "<1537887086-19960-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 v3] 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\nCC: stable@dpdk.org\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>\nAcked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n\n---\nv3: style related fix\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..5715549e4 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\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": [
        "v3"
    ]
}