get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74793,
    "url": "http://patches.dpdk.org/api/patches/74793/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200724202315.19533-5-patrick.keroulas@radio-canada.ca/",
    "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": "<20200724202315.19533-5-patrick.keroulas@radio-canada.ca>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200724202315.19533-5-patrick.keroulas@radio-canada.ca",
    "date": "2020-07-24T20:23:15",
    "name": "[[PATCH,v3,4/4] net/pcap: support hardware Tx timestamps",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "8e56eb8966b7afc71f450431244fee0df5814c42",
    "submitter": {
        "id": 1776,
        "url": "http://patches.dpdk.org/api/people/1776/?format=api",
        "name": "Patrick Keroulas",
        "email": "patrick.keroulas@radio-canada.ca"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200724202315.19533-5-patrick.keroulas@radio-canada.ca/mbox/",
    "series": [
        {
            "id": 11294,
            "url": "http://patches.dpdk.org/api/series/11294/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11294",
            "date": "2020-07-24T20:23:11",
            "name": "pdump HW Rx timestamps for mlx5",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/11294/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/74793/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/74793/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 465AAA0526;\n\tFri, 24 Jul 2020 22:24:10 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id C347D1C0B1;\n\tFri, 24 Jul 2020 22:23:42 +0200 (CEST)",
            "from mail-qv1-f68.google.com (mail-qv1-f68.google.com\n [209.85.219.68]) by dpdk.org (Postfix) with ESMTP id 509AA1C043\n for <dev@dpdk.org>; Fri, 24 Jul 2020 22:23:36 +0200 (CEST)",
            "by mail-qv1-f68.google.com with SMTP id ed14so4711558qvb.2\n for <dev@dpdk.org>; Fri, 24 Jul 2020 13:23:36 -0700 (PDT)",
            "from localhost.localdomain\n (modemcable246.10-73-45.static.videotron.ca. [45.73.10.246])\n by smtp.gmail.com with ESMTPSA id f7sm5216089qkj.32.2020.07.24.13.23.34\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 24 Jul 2020 13:23:34 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=radio-canada-ca.20150623.gappssmtp.com; s=20150623;\n h=from:to:cc:subject:date:message-id:in-reply-to:references;\n bh=IMmxATRmW+DN5TwZ77KMewfw+/X9d+omoIHifKJZ80E=;\n b=KA7D7ebBvmC4K0j5jpO/etAZCUb85lEahue4hH1VeBbNS6tF+3NXQgkubsx1NBRIgD\n GwxSreuHRf88xXoZcUZNhWYLT+o6lmdcEIW+tOCW4dGujpAEQZQxp+guMGJv9xpkDAt1\n WZUqw/USGhAu8Ula/vrsrQAFCsud6HGIkQnrZQ5P+RjQAKngzOrSOJO+XppbXR38qon9\n T8nPfgvhm1ciUnXhDUJiLmPAWV55rR7tzT+WZSfflyyC9LU6YqY1CBtko7bl/pxTEs76\n ZqVb2/cCyhy2OK0vbZtji2B9jy2JOVzS0wKWH4Qlacy8lEdq1twi3Gp15z8b1HQXKuci\n IIIA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references;\n bh=IMmxATRmW+DN5TwZ77KMewfw+/X9d+omoIHifKJZ80E=;\n b=V3awv6am9ycOR/C6vSq+a6A8bNIEktA3/N0EmD0tGQ7e1KbiWy9uVN2TM1wVH92c0J\n /I9JU88ggZyWY957sWTSSbE11u7hTQUkm0r1XaWtgCl+ljwirpBLF3QnJ006b0B1EwX+\n axIgSHWuaQxKaSOtXW9B0BizeclYbZLYxNYzMIa9xupiibjHGo/GoFRrMDdIuNPJogEC\n xcCH29U+adwtoSRLPnE1Mi/Nn2D3sDMs5KloNLyZd3HuPdM5YI5O8TtMdIQPPqg+w2MX\n 45GjYpGPnV5ZfemExBmfo18RBBp5Tl/AvGqhfWWWxFrXkd6uAdw3jEeRXPZE9XYbbdoO\n RF/g==",
        "X-Gm-Message-State": "AOAM533knO1TQSELgrk/S/M0GIBOVPmI9MaRS+wbYntaCcFKMZQkANGu\n 7Sq75kLX9sJokbSqAZH8HhsZkyJ4e0A=",
        "X-Google-Smtp-Source": "\n ABdhPJyfEUTR59+ujbRQzigPd1pze7Ydowg34cpm/6Rzapl1QMasPpY9chLTdssQ9jCKFdYq2SrpQg==",
        "X-Received": "by 2002:a0c:b2d9:: with SMTP id d25mr3617516qvf.147.1595622215314;\n Fri, 24 Jul 2020 13:23:35 -0700 (PDT)",
        "From": "Patrick Keroulas <patrick.keroulas@radio-canada.ca>",
        "To": "dev@dpdk.org",
        "Cc": "Vivien Didelot <vivien.didelot@gmail.com>,\n Patrick Keroulas <patrick.keroulas@radio-canada.ca>",
        "Date": "Fri, 24 Jul 2020 16:23:15 -0400",
        "Message-Id": "<20200724202315.19533-5-patrick.keroulas@radio-canada.ca>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200724202315.19533-1-patrick.keroulas@radio-canada.ca>",
        "References": "<20200724202315.19533-1-patrick.keroulas@radio-canada.ca>",
        "Subject": "[dpdk-dev] [[PATCH v3 4/4] net/pcap: support hardware Tx timestamps",
        "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 <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: Vivien Didelot <vivien.didelot@gmail.com>\n\nWhen hardware timestamping is enabled on Rx path, system time should\nno longer be used to calculate the timestamps when dumping packets.\n\nInstead, use the value stored by the driver in mbuf->timestamp\nand assume it is already converted to nanoseconds (otherwise the\napplication may edit the packet headers itself afterwards).\n\nSigned-off-by: Vivien Didelot <vivien.didelot@gmail.com>\nSigned-off-by: Patrick Keroulas <patrick.keroulas@radio-canada.ca>\n---\n doc/guides/rel_notes/release_20_08.rst |  1 +\n drivers/net/pcap/rte_eth_pcap.c        | 32 +++++++++++++-----------\n lib/librte_pdump/rte_pdump.c           | 34 ++++++++++++++------------\n 3 files changed, 37 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/release_20_08.rst b/doc/guides/rel_notes/release_20_08.rst\nindex 89822bcb8d..bda2f7567a 100644\n--- a/doc/guides/rel_notes/release_20_08.rst\n+++ b/doc/guides/rel_notes/release_20_08.rst\n@@ -105,6 +105,7 @@ New Features\n   Updated PCAP driver with new features and improvements, including:\n \n   * Support software Tx nanosecond timestamps precision.\n+  * Support hardware Tx timestamps.\n \n * **Updated Broadcom bnxt driver.**\n \ndiff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c\nindex 668cbd1fc7..45775951f7 100644\n--- a/drivers/net/pcap/rte_eth_pcap.c\n+++ b/drivers/net/pcap/rte_eth_pcap.c\n@@ -290,19 +290,23 @@ eth_null_rx(void *queue __rte_unused,\n #define NSEC_PER_SEC\t1000000000L\n \n static inline void\n-calculate_timestamp(struct timeval *ts) {\n-\tuint64_t cycles;\n-\tstruct timeval cur_time;\n-\n-\tcycles = rte_get_timer_cycles() - start_cycles;\n-\tcur_time.tv_sec = cycles / hz;\n-\tcur_time.tv_usec = (cycles % hz) * NSEC_PER_SEC / hz;\n-\n-\tts->tv_sec = start_time.tv_sec + cur_time.tv_sec;\n-\tts->tv_usec = start_time.tv_usec + cur_time.tv_usec;\n-\tif (ts->tv_usec >= NSEC_PER_SEC) {\n-\t\tts->tv_usec -= NSEC_PER_SEC;\n-\t\tts->tv_sec += 1;\n+calculate_timestamp(const struct rte_mbuf *mbuf, struct timeval *ts) {\n+\tif (mbuf->ol_flags & PKT_RX_TIMESTAMP) {\n+\t\tts->tv_sec = mbuf->timestamp / NSEC_PER_SEC;\n+\t\tts->tv_usec = mbuf->timestamp % NSEC_PER_SEC;\n+\t} else {\n+\t\tuint64_t cycles = rte_get_timer_cycles() - start_cycles;\n+\t\tstruct timeval cur_time = {\n+\t\t\t.tv_sec = cycles / hz,\n+\t\t\t.tv_usec = (cycles % hz) * NSEC_PER_SEC / hz,\n+\t\t};\n+\n+\t\tts->tv_sec = start_time.tv_sec + cur_time.tv_sec;\n+\t\tts->tv_usec = start_time.tv_usec + cur_time.tv_usec;\n+\t\tif (ts->tv_usec >= NSEC_PER_SEC) {\n+\t\t\tts->tv_usec -= NSEC_PER_SEC;\n+\t\t\tts->tv_sec += 1;\n+\t\t}\n \t}\n }\n \n@@ -339,7 +343,7 @@ eth_pcap_tx_dumper(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)\n \t\t\tcaplen = sizeof(temp_data);\n \t\t}\n \n-\t\tcalculate_timestamp(&header.ts);\n+\t\tcalculate_timestamp(mbuf, &header.ts);\n \t\theader.len = len;\n \t\theader.caplen = caplen;\n \t\t/* rte_pktmbuf_read() returns a pointer to the data directly\ndiff --git a/lib/librte_pdump/rte_pdump.c b/lib/librte_pdump/rte_pdump.c\nindex 8fd7e13af5..e8963e9dd8 100644\n--- a/lib/librte_pdump/rte_pdump.c\n+++ b/lib/librte_pdump/rte_pdump.c\n@@ -71,21 +71,6 @@ static struct pdump_rxtx_cbs {\n } rx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT],\n tx_cbs[RTE_MAX_ETHPORTS][RTE_MAX_QUEUES_PER_PORT];\n \n-static uint64_t hz;\n-static uint64_t start_time;\n-static uint64_t start_cycles;\n-\n-static inline void\n-pdump_ts_to_ns(struct rte_mbuf **pkts, uint16_t nb_pkts)\n-{\n-\tunsigned int i;\n-\n-\tfor (i = 0; i < nb_pkts; i++) {\n-\t\tif ((pkts[i]->ol_flags & PKT_RX_TIMESTAMP) && hz)\n-\t\t\tpkts[i]->timestamp = start_time +\n-\t\t\t\t (pkts[i]->timestamp - start_cycles) * NS_PER_S / hz;\n-\t}\n-}\n \n static inline void\n pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)\n@@ -118,6 +103,23 @@ pdump_copy(struct rte_mbuf **pkts, uint16_t nb_pkts, void *user_params)\n \t}\n }\n \n+#define NSEC_PER_SEC 1000000000L\n+static uint64_t hz;\n+static uint64_t start_time;\n+static uint64_t start_cycles;\n+\n+static inline void\n+pdump_ts_to_ns(struct rte_mbuf **pkts, uint16_t nb_pkts)\n+{\n+\tunsigned int i;\n+\n+\tfor (i = 0; i < nb_pkts; i++) {\n+\t\tif ((pkts[i]->ol_flags & PKT_RX_TIMESTAMP) && hz)\n+\t\t\tpkts[i]->timestamp = start_time +\n+\t\t\t\t (pkts[i]->timestamp - start_cycles) * NSEC_PER_SEC / hz;\n+\t}\n+}\n+\n static uint16_t\n pdump_rx(uint16_t port __rte_unused, uint16_t qidx __rte_unused,\n \tstruct rte_mbuf **pkts, uint16_t nb_pkts,\n@@ -154,7 +156,7 @@ pdump_register_rx_callbacks(uint16_t end_q, uint16_t port, uint16_t queue,\n \t\t\trte_eth_read_clock(port, &start_cycles);\n \t\t\trte_eth_get_clock_freq(port, &hz);\n \t\t\tgettimeofday(&now, NULL);\n-\t\t\tstart_time = now.tv_sec * NS_PER_S + now.tv_usec * 1000;\n+\t\t\tstart_time = now.tv_sec * NSEC_PER_SEC + now.tv_usec * 1000;\n \n \t\t\tif (cbs->cb) {\n \t\t\t\tPDUMP_LOG(ERR,\n",
    "prefixes": [
        "[PATCH",
        "v3",
        "4/4"
    ]
}