get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 82724,
    "url": "http://patches.dpdk.org/api/patches/82724/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201029092751.3837177-13-thomas@monjalon.net/",
    "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": "<20201029092751.3837177-13-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201029092751.3837177-13-thomas@monjalon.net",
    "date": "2020-10-29T09:27:47",
    "name": "[12/15] app/testpmd: switch timestamp to dynamic mbuf field",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1c1bd2fc75a85eef568fdfa919d456cd15cfb70f",
    "submitter": {
        "id": 685,
        "url": "http://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20201029092751.3837177-13-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 13454,
            "url": "http://patches.dpdk.org/api/series/13454/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13454",
            "date": "2020-10-29T09:27:35",
            "name": "remove mbuf timestamp",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/13454/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/82724/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/82724/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 0ADDDA04DD;\n\tThu, 29 Oct 2020 10:32:10 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 9BE01C99C;\n\tThu, 29 Oct 2020 10:28:36 +0100 (CET)",
            "from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com\n [64.147.123.17]) by dpdk.org (Postfix) with ESMTP id 733A1C900\n for <dev@dpdk.org>; Thu, 29 Oct 2020 10:28:30 +0100 (CET)",
            "from compute2.internal (compute2.nyi.internal [10.202.2.42])\n by mailnew.west.internal (Postfix) with ESMTP id 06B03952;\n Thu, 29 Oct 2020 05:28:27 -0400 (EDT)",
            "from mailfrontend1 ([10.202.2.162])\n by compute2.internal (MEProxy); Thu, 29 Oct 2020 05:28:28 -0400",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n by mail.messagingengine.com (Postfix) with ESMTPA id 556CF328005A;\n Thu, 29 Oct 2020 05:28:26 -0400 (EDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding; s=fm2; bh=Ov0I/SIS+DHYz\n 5Y9S4XZq7X4a/eTgLt/knF0/zSbz0E=; b=vuw9zYJZ5wGCPrREgE3k34kFga7fH\n u4c0LesGdoePsTmnyYCHVLbbAQa5uHsVC+axT1pSYjSSVoVhrE3CgFiZoN6/InRn\n 0Mz2BWqp177cfKqnLapg3Pon2vHN9LT6f0YOaCh84BYviD5cTGJJlgvs929uh7cF\n 4k+dn7wHymfbh0l5cMGF1TfgDVGqebnyq13pbZ1p117hW/pLVSOKcrQU/77SXkty\n R4z27NdL6S5g2khQfktKoPEZTkoNE76qxSjjnZZR40jxszfPz99PoSJKWvXSPb/x\n IGCi18nMTDs6giNxwa8qjt8uKhSXVYs/8YKaNOhrtA2vrFnVmnmPhhgXA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:date:from\n :in-reply-to:message-id:mime-version:references:subject:to\n :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=\n fm1; bh=Ov0I/SIS+DHYz5Y9S4XZq7X4a/eTgLt/knF0/zSbz0E=; b=Bf/KN0I3\n Fm6lPf8GWh8XZuwX2xoWYUsv+q7gggZckuYmQ2pApEJHNiMSeF9qzcdIpJ+Rk5a6\n zFrLIV5ZGoY0cig5CEoJOr5kLSvwsF/mT94d7qAYcTMpQqBmFj/N0KWc02nMpwyK\n 7PIg+jIoo/rPp8ODPZruNyV2CejfrBm+IKcWBR2pw0DeSCtMW1MnIyq8jP00FYwP\n w2CWUPR6Ar68qAzST8Cjs1FtPeb6717IXd/lMjMxt2fXovxGuAtFBQVsYr5KSTah\n DP/9FMzXCduop1+yu84PU5P73+F5bjw2IIPDa2+UBYZwP2hfTdHULMDsPtMWLeQO\n F2kf/YCrxNUA1A=="
        ],
        "X-ME-Sender": "<xms:O4uaX6GI9Fo2AQBY2l3Q97PE_KmxvR9-mqo2n8YDveqog8cmPuCPHQ>\n <xme:O4uaX7XuQEdJkcOKCoq70N0sODVhhmclYlDKKZ3zz_3oCE0sj8CnvczO1nsNxvvzd\n vSAahvL9ekl6hCTUQ>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedujedrleefgddthecutefuodetggdotefrodftvf\n curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu\n uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc\n fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs\n ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf\n frrghtthgvrhhnpeehgfejgefgueevgfevvdekgefffedtkeehgeffjeeigeefueffudff\n hfelffffudenucffohhmrghinhepfhguihhrrdhiugenucfkphepjeejrddufeegrddvtd\n efrddukeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhho\n mhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth",
        "X-ME-Proxy": "<xmx:O4uaX0KZWKldLhjfIIUP-TvelsLw3u9MTtkayHq9ApipAfmseQv5mQ>\n <xmx:O4uaX0H5JX5fe7TC_NCoTFYWQdMGMxNdHZrrwkR_NPFtk1QE_suhhw>\n <xmx:O4uaXwVLSzYvjizRjvzDazg1yUueOZSoTM_EveOR1TMnh2-ve-0xFA>\n <xmx:O4uaX0pWSBrlHm53jtO531o5rXPB0dWvVVWEC83M-nEEGtcQTERYAnFlClQ>",
        "From": "Thomas Monjalon <thomas@monjalon.net>",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com, david.marchand@redhat.com,\n bruce.richardson@intel.com, olivier.matz@6wind.com,\n andrew.rybchenko@oktetlabs.ru, jerinj@marvell.com, viacheslavo@nvidia.com,\n Wenzhuo Lu <wenzhuo.lu@intel.com>, Beilei Xing <beilei.xing@intel.com>,\n Bernard Iremonger <bernard.iremonger@intel.com>",
        "Date": "Thu, 29 Oct 2020 10:27:47 +0100",
        "Message-Id": "<20201029092751.3837177-13-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20201029092751.3837177-1-thomas@monjalon.net>",
        "References": "<20201029092751.3837177-1-thomas@monjalon.net>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 12/15] app/testpmd: switch timestamp to dynamic\n\tmbuf field",
        "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": "The mbuf timestamp is moved to a dynamic field\nin order to allow removal of the deprecated static field.\nThe related mbuf flag is also replaced.\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\n---\n app/test-pmd/util.c | 39 +++++++++++++++++++++++++++++++++++++--\n 1 file changed, 37 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c\nindex 781a813759..eebb5166ad 100644\n--- a/app/test-pmd/util.c\n+++ b/app/test-pmd/util.c\n@@ -5,6 +5,7 @@\n \n #include <stdio.h>\n \n+#include <rte_bitops.h>\n #include <rte_net.h>\n #include <rte_mbuf.h>\n #include <rte_ether.h>\n@@ -22,6 +23,40 @@ print_ether_addr(const char *what, const struct rte_ether_addr *eth_addr)\n \tprintf(\"%s%s\", what, buf);\n }\n \n+static inline bool\n+is_timestamp_enabled(const struct rte_mbuf *mbuf)\n+{\n+\tstatic uint64_t timestamp_rx_dynflag;\n+\n+\tint timestamp_rx_dynflag_offset;\n+\n+\tif (timestamp_rx_dynflag == 0) {\n+\t\ttimestamp_rx_dynflag_offset = rte_mbuf_dynflag_lookup(\n+\t\t\t\tRTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME, NULL);\n+\t\tif (timestamp_rx_dynflag_offset < 0)\n+\t\t\treturn false;\n+\t\ttimestamp_rx_dynflag = RTE_BIT64(timestamp_rx_dynflag_offset);\n+\t}\n+\n+\treturn (mbuf->ol_flags & timestamp_rx_dynflag) != 0;\n+}\n+\n+static inline rte_mbuf_timestamp_t\n+get_timestamp(const struct rte_mbuf *mbuf)\n+{\n+\tstatic int timestamp_dynfield_offset = -1;\n+\n+\tif (timestamp_dynfield_offset < 0) {\n+\t\ttimestamp_dynfield_offset = rte_mbuf_dynfield_lookup(\n+\t\t\t\tRTE_MBUF_DYNFIELD_TIMESTAMP_NAME, NULL);\n+\t\tif (timestamp_dynfield_offset < 0)\n+\t\t\treturn 0;\n+\t}\n+\n+\treturn *RTE_MBUF_DYNFIELD(mbuf,\n+\t\t\ttimestamp_dynfield_offset, rte_mbuf_timestamp_t *);\n+}\n+\n static inline void\n dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],\n \t      uint16_t nb_pkts, int is_rx)\n@@ -107,8 +142,8 @@ dump_pkt_burst(uint16_t port_id, uint16_t queue, struct rte_mbuf *pkts[],\n \t\t\t\tprintf(\"hash=0x%x ID=0x%x \",\n \t\t\t\t       mb->hash.fdir.hash, mb->hash.fdir.id);\n \t\t}\n-\t\tif (ol_flags & PKT_RX_TIMESTAMP)\n-\t\t\tprintf(\" - timestamp %\"PRIu64\" \", mb->timestamp);\n+\t\tif (is_timestamp_enabled(mb))\n+\t\t\tprintf(\" - timestamp %\"PRIu64\" \", get_timestamp(mb));\n \t\tif (ol_flags & PKT_RX_QINQ)\n \t\t\tprintf(\" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x\",\n \t\t\t       mb->vlan_tci, mb->vlan_tci_outer);\n",
    "prefixes": [
        "12/15"
    ]
}