Show a patch.

GET /api/patches/73536/
Content-Type: application/json
Vary: Accept

    "id": 73536,
    "url": "",
    "web_url": "",
    "project": {
        "id": 1,
        "url": "",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "",
        "list_email": "",
        "web_url": "",
        "scm_url": "git://",
        "webscm_url": ""
    "msgid": "<>",
    "date": "2020-07-08T15:47:28",
    "name": "[v5,1/2] mbuf: introduce accurate packet Tx scheduling",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "eee6b480cf3179171842b13827a70fafd98d8947",
    "submitter": {
        "id": 1102,
        "url": "",
        "name": "Slava Ovsiienko",
        "email": ""
    "delegate": {
        "id": 319,
        "url": "",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": ""
    "mbox": "",
    "series": [
            "id": 10894,
            "url": "",
            "web_url": "",
            "date": "2020-07-08T15:47:28",
            "name": "[v5,1/2] mbuf: introduce accurate packet Tx scheduling",
            "version": 5,
            "mbox": ""
    "comments": "",
    "check": "success",
    "checks": "",
    "tags": {},
    "headers": {
        "List-Archive": "<>",
        "Return-Path": "<>",
        "In-Reply-To": "<>",
        "Message-Id": "<>",
        "X-Mailer": "git-send-email",
        "To": "",
        "List-Subscribe": "<>,\n <>",
        "X-BeenThere": "",
        "Received": [
            "from ( [])\n\tby (Postfix) with ESMTP id C7FA1A0527;\n\tWed,  8 Jul 2020 17:47:35 +0200 (CEST)",
            "from [] (localhost [])\n\tby (Postfix) with ESMTP id 5BFD01DEF3;\n\tWed,  8 Jul 2020 17:47:35 +0200 (CEST)",
            "from ( [])\n by (Postfix) with ESMTP id 1560C1DB32\n for <>; Wed,  8 Jul 2020 17:47:34 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n with SMTP; 8 Jul 2020 18:47:33 +0300",
            "from (\n [])\n by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id 068FlXTa016176;\n Wed, 8 Jul 2020 18:47:33 +0300",
            "from (localhost [])\n by (8.14.7/8.14.7) with ESMTP id 068FlX6L024687;\n Wed, 8 Jul 2020 15:47:33 GMT",
            "(from viacheslavo@localhost)\n by (8.14.7/8.14.7/Submit) id 068FlUBD024684;\n Wed, 8 Jul 2020 15:47:30 GMT"
        "Subject": "[dpdk-dev] [PATCH v5 1/2] mbuf: introduce accurate packet Tx\n\tscheduling",
        "List-Unsubscribe": "<>,\n <>",
        "List-Id": "DPDK patches and discussions <>",
        "List-Post": "<>",
        "Cc": ",,,\n,,",
        "Precedence": "list",
        "From": "Viacheslav Ovsiienko <>",
        "X-Authentication-Warning": " viacheslavo set sender to\n using -f",
        "References": "<>",
        "X-Original-To": "",
        "Sender": "\"dev\" <>",
        "Errors-To": "",
        "List-Help": "<>",
        "Delivered-To": "",
        "Date": "Wed,  8 Jul 2020 15:47:28 +0000",
        "X-Mailman-Version": "2.1.15"
    "content": "There is the requirement on some networks for precise traffic timing\nmanagement. The ability to send (and, generally speaking, receive)\nthe packets at the very precisely specified moment of time provides\nthe opportunity to support the connections with Time Division\nMultiplexing using the contemporary general purpose NIC without involving\nan auxiliary hardware. For example, the supporting of O-RAN Fronthaul\ninterface is one of the promising features for potentially usage of the\nprecise time management for the egress packets.\n\nThe main objective of this RFC is to specify the way how applications\ncan provide the moment of time at what the packet transmission must be\nstarted and to describe in preliminary the supporting this feature from\nmlx5 PMD side.\n\nThe new dynamic timestamp field is proposed, it provides some timing\ninformation, the units and time references (initial phase) are not\nexplicitly defined but are maintained always the same for a given port.\nSome devices allow to query rte_eth_read_clock() that will return\nthe current device timestamp. The dynamic timestamp flag tells whether\nthe field contains actual timestamp value. For the packets being sent\nthis value can be used by PMD to schedule packet sending.\n\nThe device clock is opaque entity, the units and frequency are\nvendor specific and might depend on hardware capabilities and\nconfigurations. If might (or not) be synchronized with real time\nvia PTP, might (or not) be synchronous with CPU clock (for example\nif NIC and CPU share the same clock source there might be no\nany drift between the NIC and CPU clocks), etc.\n\nAfter PKT_RX_TIMESTAMP flag and fixed timestamp field deprecation\nand obsoleting, these dynamic flag and field will be used to manage\nthe timestamps on receiving datapath as well. Having the dedicated\nflags for Rx/Tx timestamps allows applications not to perform explicit\nflags reset on forwarding and not to promote received timestamps\nto the transmitting datapath by default. The static PKT_RX_TIMESTAMP\nis considered as candidate to become the dynamic flag.\n\nWhen PMD sees the \"rte_dynfield_timestamp\" set on the packet being sent\nit tries to synchronize the time of packet appearing on the wire with\nthe specified packet timestamp. If the specified one is in the past it\nshould be ignored, if one is in the distant future it should be capped\nwith some reasonable value (in range of seconds). These specific cases\n(\"too late\" and \"distant future\") can be optionally reported via\ndevice xstats to assist applications to detect the time-related\nproblems.\n\nThere is no any packet reordering according timestamps is supposed,\nneither within packet burst, nor between packets, it is an entirely\napplication responsibility to generate packets and its timestamps\nin desired order. The timestamps can be put only in the first packet\nin the burst providing the entire burst scheduling.\n\nPMD reports the ability to synchronize packet sending on timestamp\nwith new offload flag:\n\nThis is palliative and is going to be replaced with new eth_dev API\nabout reporting/managing the supported dynamic flags and its related\nfeatures. This API would break ABI compatibility and can't be introduced\nat the moment, so is postponed to 20.11.\n\nFor testing purposes it is proposed to update testpmd \"txonly\"\nforwarding mode routine. With this update testpmd application generates\nthe packets and sets the dynamic timestamps according to specified time\npattern if it sees the \"rte_dynfield_timestamp\" is registered.\n\nThe new testpmd command is proposed to configure sending pattern:\n\nset tx_times <burst_gap>,<intra_gap>\n\n<intra_gap> - the delay between the packets within the burst\n              specified in the device clock units. The number\n              of packets in the burst is defined by txburst parameter\n\n<burst_gap> - the delay between the bursts in the device clock units\n\nAs the result the bursts of packet will be transmitted with specific\ndelays between the packets within the burst and specific delay between\nthe bursts. The rte_eth_get_clock is supposed to be engaged to get the\ncurrent device clock value and provide the reference for the timestamps.\n\nSigned-off-by: Viacheslav Ovsiienko <>\n\n---\n  v1->v4:\n     - dedicated dynamic Tx timestamp flag instead of shared with Rx\n  v4->v5:\n     - elaborated commit message\n     - more words about device clocks added,\n     - note about dedicated Rx/Tx timestamp flags added\n\n---\n lib/librte_ethdev/rte_ethdev.c |  1 +\n lib/librte_ethdev/rte_ethdev.h |  4 ++++\n lib/librte_mbuf/rte_mbuf_dyn.h | 31 +++++++++++++++++++++++++++++++\n 3 files changed, 36 insertions(+)",
    "diff": "diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c\nindex 8e10a6f..02157d5 100644\n--- a/lib/librte_ethdev/rte_ethdev.c\n+++ b/lib/librte_ethdev/rte_ethdev.c\n@@ -162,6 +162,7 @@ struct rte_eth_xstats_name_off {\n \tRTE_TX_OFFLOAD_BIT2STR(UDP_TNL_TSO),\n \tRTE_TX_OFFLOAD_BIT2STR(IP_TNL_TSO),\n \tRTE_TX_OFFLOAD_BIT2STR(OUTER_UDP_CKSUM),\n+\tRTE_TX_OFFLOAD_BIT2STR(SEND_ON_TIMESTAMP),\n };\n \n #undef RTE_TX_OFFLOAD_BIT2STR\ndiff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h\nindex a49242b..6f6454c 100644\n--- a/lib/librte_ethdev/rte_ethdev.h\n+++ b/lib/librte_ethdev/rte_ethdev.h\n@@ -1178,6 +1178,10 @@ struct rte_eth_conf {\n /** Device supports outer UDP checksum */\n #define DEV_TX_OFFLOAD_OUTER_UDP_CKSUM  0x00100000\n \n+/** Device supports send on timestamp */\n+#define DEV_TX_OFFLOAD_SEND_ON_TIMESTAMP 0x00200000\n+\n+\n #define RTE_ETH_DEV_CAPA_RUNTIME_RX_QUEUE_SETUP 0x00000001\n /**< Device supports Rx queue setup after device started*/\n #define RTE_ETH_DEV_CAPA_RUNTIME_TX_QUEUE_SETUP 0x00000002\ndiff --git a/lib/librte_mbuf/rte_mbuf_dyn.h b/lib/librte_mbuf/rte_mbuf_dyn.h\nindex 96c3631..8407230 100644\n--- a/lib/librte_mbuf/rte_mbuf_dyn.h\n+++ b/lib/librte_mbuf/rte_mbuf_dyn.h\n@@ -250,4 +250,35 @@ int rte_mbuf_dynflag_lookup(const char *name,\n #define RTE_MBUF_DYNFIELD_METADATA_NAME \"rte_flow_dynfield_metadata\"\n #define RTE_MBUF_DYNFLAG_METADATA_NAME \"rte_flow_dynflag_metadata\"\n \n+/**\n+ * The timestamp dynamic field provides some timing information, the\n+ * units and time references (initial phase) are not explicitly defined\n+ * but are maintained always the same for a given port. Some devices allow\n+ * to query rte_eth_read_clock() that will return the current device\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+\n+/**\n+ * When PMD sees the RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME flag set on the\n+ * packet being sent it tries to synchronize the time of packet appearing\n+ * on the wire with the specified packet timestamp. If the specified one\n+ * is in the past it should be ignored, if one is in the distant future\n+ * it should be capped with some reasonable value (in range of seconds).\n+ *\n+ * There is no any packet reordering according to timestamps is supposed,\n+ * neither for packet within the burst, nor for the whole bursts, it is\n+ * an entirely application responsibility to generate packets and its\n+ * timestamps in desired order. The timestamps might be put only in\n+ * the first packet in the burst providing the entire burst scheduling.\n+ */\n+#define RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME \"rte_dynflag_tx_timestamp\"\n+\n #endif\n",
    "prefixes": [