get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 83563,
    "url": "https://patches.dpdk.org/api/patches/83563/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201103122205.183472-3-thomas@monjalon.net/",
    "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": "<20201103122205.183472-3-thomas@monjalon.net>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201103122205.183472-3-thomas@monjalon.net",
    "date": "2020-11-03T12:21:51",
    "name": "[v4,02/16] mbuf: add Rx timestamp flag and helpers",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "128b81affc8c8a1033eb401d3f790f94b6f1a8f8",
    "submitter": {
        "id": 685,
        "url": "https://patches.dpdk.org/api/people/685/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas@monjalon.net"
    },
    "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/20201103122205.183472-3-thomas@monjalon.net/mbox/",
    "series": [
        {
            "id": 13616,
            "url": "https://patches.dpdk.org/api/series/13616/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=13616",
            "date": "2020-11-03T12:21:49",
            "name": "remove mbuf timestamp",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/13616/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/83563/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/83563/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 8BE76A0521;\n\tTue,  3 Nov 2020 13:22:59 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2043BC9CC;\n\tTue,  3 Nov 2020 13:22:26 +0100 (CET)",
            "from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com\n [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id 577CAC9CA\n for <dev@dpdk.org>; Tue,  3 Nov 2020 13:22:25 +0100 (CET)",
            "from compute2.internal (compute2.nyi.internal [10.202.2.42])\n by mailout.west.internal (Postfix) with ESMTP id EE361B55;\n Tue,  3 Nov 2020 07:22:22 -0500 (EST)",
            "from mailfrontend2 ([10.202.2.163])\n by compute2.internal (MEProxy); Tue, 03 Nov 2020 07:22:23 -0500",
            "from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])\n by mail.messagingengine.com (Postfix) with ESMTPA id 5939B3064683;\n Tue,  3 Nov 2020 07:22:20 -0500 (EST)"
        ],
        "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=hOTFRuzwV0V16\n gYThHGH8LRGL01ovBSMKZ6CA4EGVdo=; b=hRldnOjcQGBP7IRMYU7PgHYRZKEFN\n XywiINrdnofnk7DUf0njGnbh7d+VAmvVyQcH74uJVq1f8s/1DaPN6npW1nJt/9De\n C5D5uGL9VbpHiroY3VbvKxqncQEyC5VGzLfd3nIiac6Ho5laXjJI6xx/ZydR/ivI\n nXZsSthxieJ9uTOZl68dPUz0WQnvsWXeWk3sYML74t1KfzNgMZjAwC93zgZ/9Aha\n nauDEF5UYhOqAJ36yRuZmAYmWwHdkj9dPpjKPiqwlGH+mXgGveoxoUV9IoC8oNsr\n mX1S98zyaPDejkqwEDAdoiZ5f4LpQNb3S7E8MSGgTG3L1smyVRLdMphPw==",
            "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=hOTFRuzwV0V16gYThHGH8LRGL01ovBSMKZ6CA4EGVdo=; b=YH7fEReh\n y0T0Ntni9uUvQwKthx5XbFnP4gqnSlkKZq/VU3mkxrKevuR95rxCTfYtUEPNABLt\n xHbtQSgnA+ilbn+T+pwq4Q0dTaWctCBBoQucVIska8Lr6nlZKF+gCliw9NO1BYAF\n qn2xSVM0J1gMAeVoYO9HHVGEQ3+r/Y7gadHM3PD3XVzpqae+OcWbj2L/8S2vFGhn\n nAjH3X2TG15xEKyc4yOW4uRcY571KBs2Ca3vMuJ3W0MlJpDTCmk8Q3zoeDJ8QLp5\n wm54qyDSeqsu1yFtgEzLDj6HNhbJmumUEhWDA85KvNqe0mUQLRfqzrvq9kMxC0MU\n W4ii8HBNi+sDkg=="
        ],
        "X-ME-Sender": "<xms:fUuhX9RlT7fgeo4xOWX2lAXH6pJQ7vWKpfBDDiwBHkznn9gVM3o3ww>\n <xme:fUuhX2zvsGGBaSnteKR2WOen1eg2EgTVUiOWw1fvIkcaoNJjmhNZ5D96mXLIYuV1W\n FBxnhxCookALBBpMA>",
        "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgedujedruddtfedgfeelucetufdoteggodetrfdotf\n fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen\n uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne\n cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr\n shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg\n ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg\n uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf\n hiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl\n ohhnrdhnvght",
        "X-ME-Proxy": "<xmx:fUuhXy1RYeYJEk9y8g_if7niFTlRqRSV-qUBiow27aH7yXHyf-EGgw>\n <xmx:fUuhX1Bqvaa9QrG5z88K74tyPMMtEQfyVqtYjfSWrtepB6x8pzX7Aw>\n <xmx:fUuhX2joLcq2iJuUsITEI4crAVsVC-k_pY84buqcfn4iP_cvMHgsmw>\n <xmx:fkuhX6gsJR8KpDwjdWgIawRsO9JU1Maed5KWkFchVi-1dH911Y4Mdg>",
        "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 Ray Kinsella <mdr@ashroe.eu>, Neil Horman <nhorman@tuxdriver.com>",
        "Date": "Tue,  3 Nov 2020 13:21:51 +0100",
        "Message-Id": "<20201103122205.183472-3-thomas@monjalon.net>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20201103122205.183472-1-thomas@monjalon.net>",
        "References": "<20201029092751.3837177-1-thomas@monjalon.net>\n <20201103122205.183472-1-thomas@monjalon.net>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v4 02/16] mbuf: add Rx timestamp flag and helpers",
        "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": "There is already a dynamic field for timestamp,\nused only for Tx scheduling with the dedicated Tx offload flag.\nThe same field can be used for Rx timestamp filled by drivers.\n\nA new dynamic flag is defined for Rx usage.\nA new function wraps the registration of both field and Rx flag.\nThe type rte_mbuf_timestamp_t is defined for the API users.\n\nAfter migrating all Rx timestamp usages, it will be possible\nto remove the deprecated timestamp field.\n\nSigned-off-by: Thomas Monjalon <thomas@monjalon.net>\nAcked-by: David Marchand <david.marchand@redhat.com>\n---\n lib/librte_mbuf/rte_mbuf_dyn.c | 43 ++++++++++++++++++++++++++++++++++\n lib/librte_mbuf/rte_mbuf_dyn.h | 33 ++++++++++++++++++++++----\n lib/librte_mbuf/version.map    |  1 +\n 3 files changed, 72 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c\nindex 538a43f695..5b608a27d7 100644\n--- a/lib/librte_mbuf/rte_mbuf_dyn.c\n+++ b/lib/librte_mbuf/rte_mbuf_dyn.c\n@@ -13,6 +13,7 @@\n #include <rte_errno.h>\n #include <rte_malloc.h>\n #include <rte_string_fns.h>\n+#include <rte_bitops.h>\n #include <rte_mbuf.h>\n #include <rte_mbuf_dyn.h>\n \n@@ -569,3 +570,45 @@ void rte_mbuf_dyn_dump(FILE *out)\n \n \trte_mcfg_tailq_write_unlock();\n }\n+\n+static int\n+rte_mbuf_dyn_timestamp_register(int *field_offset, uint64_t *flag,\n+\t\tconst char *direction, const char *flag_name)\n+{\n+\tstatic const struct rte_mbuf_dynfield field_desc = {\n+\t\t.name = RTE_MBUF_DYNFIELD_TIMESTAMP_NAME,\n+\t\t.size = sizeof(rte_mbuf_timestamp_t),\n+\t\t.align = __alignof__(rte_mbuf_timestamp_t),\n+\t};\n+\tstruct rte_mbuf_dynflag flag_desc = { 0 };\n+\tint offset;\n+\n+\toffset = rte_mbuf_dynfield_register(&field_desc);\n+\tif (offset < 0) {\n+\t\tRTE_LOG(ERR, MBUF,\n+\t\t\t\"Failed to register mbuf field for timestamp\\n\");\n+\t\treturn -1;\n+\t}\n+\tif (field_offset != NULL)\n+\t\t*field_offset = offset;\n+\n+\tstrlcpy(flag_desc.name, flag_name, sizeof(flag_desc.name));\n+\toffset = rte_mbuf_dynflag_register(&flag_desc);\n+\tif (offset < 0) {\n+\t\tRTE_LOG(ERR, MBUF,\n+\t\t\t\"Failed to register mbuf flag for %s timestamp\\n\",\n+\t\t\tdirection);\n+\t\treturn -1;\n+\t}\n+\tif (flag != NULL)\n+\t\t*flag = RTE_BIT64(offset);\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag)\n+{\n+\treturn rte_mbuf_dyn_timestamp_register(field_offset, rx_flag,\n+\t\t\t\"Rx\", RTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME);\n+}\ndiff --git a/lib/librte_mbuf/rte_mbuf_dyn.h b/lib/librte_mbuf/rte_mbuf_dyn.h\nindex 0ebac88b83..2e729ddaca 100644\n--- a/lib/librte_mbuf/rte_mbuf_dyn.h\n+++ b/lib/librte_mbuf/rte_mbuf_dyn.h\n@@ -258,13 +258,36 @@ void rte_mbuf_dyn_dump(FILE *out);\n  * timestamp. The dynamic Tx timestamp flag tells whether the field contains\n  * actual timestamp value for the packets being sent, this value can be\n  * used by PMD to schedule packet sending.\n- *\n- * After PKT_RX_TIMESTAMP flag and fixed timestamp field deprecation\n- * and obsoleting, the dedicated Rx timestamp flag is supposed to be\n- * introduced and the shared dynamic timestamp field will be used\n- * to handle the timestamps on receiving datapath as well.\n  */\n #define RTE_MBUF_DYNFIELD_TIMESTAMP_NAME \"rte_dynfield_timestamp\"\n+typedef uint64_t rte_mbuf_timestamp_t;\n+\n+/**\n+ * Indicate that the timestamp field in the mbuf was filled by the driver.\n+ */\n+#define RTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME \"rte_dynflag_rx_timestamp\"\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice.\n+ *\n+ * Register dynamic mbuf field and flag for Rx timestamp.\n+ *\n+ * @param field_offset\n+ *   Pointer to the offset of the registered mbuf field, can be NULL.\n+ *   The same field is shared for Rx and Tx timestamp.\n+ * @param rx_flag\n+ *   Pointer to the mask of the registered offload flag, can be NULL.\n+ * @return\n+ *   0 on success, -1 otherwise.\n+ *   Possible values for rte_errno:\n+ *   - EEXIST: already registered with different parameters.\n+ *   - EPERM: called from a secondary process.\n+ *   - ENOENT: no more field or flag available.\n+ *   - ENOMEM: allocation failure.\n+ */\n+__rte_experimental\n+int rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag);\n \n /**\n  * When PMD sees the RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME flag set on the\ndiff --git a/lib/librte_mbuf/version.map b/lib/librte_mbuf/version.map\nindex a011aaead3..0b66668bff 100644\n--- a/lib/librte_mbuf/version.map\n+++ b/lib/librte_mbuf/version.map\n@@ -42,6 +42,7 @@ EXPERIMENTAL {\n \trte_mbuf_dynflag_register;\n \trte_mbuf_dynflag_register_bitnum;\n \trte_mbuf_dyn_dump;\n+\trte_mbuf_dyn_rx_timestamp_register;\n \trte_pktmbuf_copy;\n \trte_pktmbuf_free_bulk;\n \trte_pktmbuf_pool_create_extbuf;\n",
    "prefixes": [
        "v4",
        "02/16"
    ]
}