From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id B187EA04E7;
	Tue,  3 Nov 2020 01:19:00 +0100 (CET)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id C22A4BE7D;
	Tue,  3 Nov 2020 01:14:57 +0100 (CET)
Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com
 [64.147.123.17]) by dpdk.org (Postfix) with ESMTP id 43BE2BE71
 for <dev@dpdk.org>; Tue,  3 Nov 2020 01:14:56 +0100 (CET)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailnew.west.internal (Postfix) with ESMTP id BD7C5B3D;
 Mon,  2 Nov 2020 19:14:53 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163])
 by compute2.internal (MEProxy); Mon, 02 Nov 2020 19:14:54 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding; s=fm2; bh=5LDZ6cztVFSV4
 vepZU2rlEfYjPlyN9lQsslykwGw7og=; b=coOTBiNID6QW8MnJmXV8PM+h9TH/B
 N5iEINJ91p0TUFGNPQhhfMNtp1czOXogftWBIphi+cjjJaSavI6YqdGCcBrUOpic
 NdEYdR8m1QGNSiJZyVfxpRW0MGX8bXLMP/rMgF3dWIbdViFJqkWkhYhk0OCWrarR
 +0Zs6C7EuozYSU22TiwOXaSl1UNYMv+A4hq5zQQexhUiu2VP3B7hrckvyBE6JTA0
 19SRa5+dqbvrtD4hpvWn0PcrDC2i9frhj+EduocIYgVrIYXABcKsUuZidDcesy6D
 PADixsqVmQJ36BxHjeSmrShnN2wCJWYkY5XBXsQxx3FLrNZHFfGvvaGKw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:date:from
 :in-reply-to:message-id:mime-version:references:subject:to
 :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; bh=5LDZ6cztVFSV4vepZU2rlEfYjPlyN9lQsslykwGw7og=; b=rG9Ziy/y
 k7S7bt8AZXN3TpbiqNuuadqFb60KkgWapqHKsFzd/vK9cQdOKAjCsoHWlvnoEgqQ
 GcWLaKcHWMczpfuZDSgfgfbGUIHA5+lCfKU3m48iF6c6ospwinZ53XYCgsOYVKTI
 PobNzoEgJ1UQ04O6qOx1mi5SuabzeIK65EkZw1d7zJIMvs6YS6GsRdTnfztqSO2Y
 Q268XBoRVjfoKvDphcIQGsGAxuaDG/BU4QzzQwFIEdZl6GrjJe1NKPDVc/Yl6Shj
 EkSSl5nRnVd1BIonJgUMNcAMEnQPhoDSXxVp4i66q6g+IKNdaQV41tXmgYUfCfK8
 pepcewA4N2nVHw==
X-ME-Sender: <xms:_aCgXzFkvIdo3djrZL7yp3xSS_D0liCFgRRUEPlSXI5P4NocRuluzw>
 <xme:_aCgXwXLXDCz3vMVIko_GE4NFdvUQK_WmR7qR0BPAJixmODscnvIkunvEX6-10Zi4
 2_q23kDIfuWyquhLA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtvddgudejucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen
 uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne
 cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr
 shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg
 ftrfgrthhtvghrnhephfduieeggfdvkefgheegjeelieffhfdtteffffduvefgtdefgffh
 tedtudejheeinecuffhomhgrihhnpeihohhuthhusggvrdgtohhmnecukfhppeejjedrud
 efgedrvddtfedrudekgeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr
 ihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhnrdhnvght
X-ME-Proxy: <xmx:_aCgX1JH5WsdhNasDZZI_zD4T6Xz8Q5qOITrTOygnauN01gtX8FAoA>
 <xmx:_aCgXxF2Lg_QR1krj66yGXQH5aMmZ0FkkDwHrGoMyZLLRgwvDQK_ww>
 <xmx:_aCgX5VPywaD9RH6LbZvnOgA6JQKqlJRkF934qSGduo0gWECKCOVaA>
 <xmx:_aCgX1qonHh-q0cvypbcqOzl6y2SLjtJ8O3HlyrFRqaJ7iB4hu6wcQeUiFY>
Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 1511C3064680;
 Mon,  2 Nov 2020 19:14:52 -0500 (EST)
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, david.marchand@redhat.com,
 bruce.richardson@intel.com, olivier.matz@6wind.com,
 andrew.rybchenko@oktetlabs.ru, jerinj@marvell.com, viacheslavo@nvidia.com,
 Ajit Khaparde <ajit.khaparde@broadcom.com>, Ray Kinsella <mdr@ashroe.eu>,
 Neil Horman <nhorman@tuxdriver.com>
Date: Tue,  3 Nov 2020 01:14:05 +0100
Message-Id: <20201103001407.2931963-15-thomas@monjalon.net>
X-Mailer: git-send-email 2.28.0
In-Reply-To: <20201103001407.2931963-1-thomas@monjalon.net>
References: <20201029092751.3837177-1-thomas@monjalon.net>
 <20201103001407.2931963-1-thomas@monjalon.net>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v3 14/16] mbuf: remove deprecated timestamp 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>,
 <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>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

As announced in the deprecation note, the field timestamp
is removed to give more space to the dynamic fields.
The related offload flag PKT_RX_TIMESTAMP is also removed.

This is how the mbuf layout looks like (pahole-style):

word  type                              name                byte  size
 0    void *                            buf_addr;         /*   0 +  8 */
 1    rte_iova_t                        buf_iova          /*   8 +  8 */
      /* --- RTE_MARKER64               rearm_data;                   */
 2    uint16_t                          data_off;         /*  16 +  2 */
      uint16_t                          refcnt;           /*  18 +  2 */
      uint16_t                          nb_segs;          /*  20 +  2 */
      uint16_t                          port;             /*  22 +  2 */
 3    uint64_t                          ol_flags;         /*  24 +  8 */
      /* --- RTE_MARKER                 rx_descriptor_fields1;        */
 4    uint32_t             union        packet_type;      /*  32 +  4 */
      uint32_t                          pkt_len;          /*  36 +  4 */
 5    uint16_t                          data_len;         /*  40 +  2 */
      uint16_t                          vlan_tci;         /*  42 +  2 */
 5.5  uint64_t             union        hash;             /*  44 +  8 */
 6.5  uint16_t                          vlan_tci_outer;   /*  52 +  2 */
      uint16_t                          buf_len;          /*  54 +  2 */
 7    uint64_t                          dynfield0[1];     /*  56 +  8 */
      /* --- RTE_MARKER                 cacheline1;                   */
 8    struct rte_mempool *              pool;             /*  64 +  8 */
 9    struct rte_mbuf *                 next;             /*  72 +  8 */
10    uint64_t             union        tx_offload;       /*  80 +  8 */
11    struct rte_mbuf_ext_shared_info * shinfo;           /*  88 +  8 */
12    uint16_t                          priv_size;        /*  96 +  2 */
      uint16_t                          timesync;         /*  98 +  2 */
12.5  uint32_t                          dynfield1[7];     /* 100 + 28 */
16    /* --- END                                             128      */

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Acked-by: Ray Kinsella <mdr@ashroe.eu>
---
 app/test/test_mbuf.c                   |  1 -
 doc/guides/rel_notes/deprecation.rst   |  4 ----
 doc/guides/rel_notes/release_20_11.rst |  4 ++++
 lib/librte_mbuf/rte_mbuf.c             |  2 --
 lib/librte_mbuf/rte_mbuf.h             |  2 +-
 lib/librte_mbuf/rte_mbuf_core.h        | 12 ++----------
 lib/librte_mbuf/rte_mbuf_dyn.c         |  1 +
 7 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index 3a13cf4e1f..a40f7d4883 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -1621,7 +1621,6 @@ test_get_rx_ol_flag_name(void)
 		VAL_NAME(PKT_RX_FDIR_FLX),
 		VAL_NAME(PKT_RX_QINQ_STRIPPED),
 		VAL_NAME(PKT_RX_LRO),
-		VAL_NAME(PKT_RX_TIMESTAMP),
 		VAL_NAME(PKT_RX_SEC_OFFLOAD),
 		VAL_NAME(PKT_RX_SEC_OFFLOAD_FAILED),
 		VAL_NAME(PKT_RX_OUTER_L4_CKSUM_BAD),
diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index fe3fd3956c..22aecf0bab 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -84,10 +84,6 @@ Deprecation Notices
 * mbuf: Some fields will be converted to dynamic API in DPDK 20.11
   in order to reserve more space for the dynamic fields, as explained in
   `this presentation <https://www.youtube.com/watch?v=Ttl6MlhmzWY>`_.
-  The following static fields will be moved as dynamic:
-
-  - ``timestamp``
-
   As a consequence, the layout of the ``struct rte_mbuf`` will be re-arranged,
   avoiding impact on vectorized implementation of the driver datapaths,
   while evaluating performance gains of a better use of the first cache line.
diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst
index 88b9086390..6455022169 100644
--- a/doc/guides/rel_notes/release_20_11.rst
+++ b/doc/guides/rel_notes/release_20_11.rst
@@ -448,6 +448,10 @@ API Changes
 * mbuf: Removed the field ``seqn`` from the structure ``rte_mbuf``.
   It is replaced with dynamic fields.
 
+* mbuf: Removed the field ``timestamp`` from the structure ``rte_mbuf``.
+  It is replaced with the dynamic field RTE_MBUF_DYNFIELD_TIMESTAMP_NAME
+  which was previously used only for Tx.
+
 * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and
   replaced with a private enum in the PCI subsystem.
 
diff --git a/lib/librte_mbuf/rte_mbuf.c b/lib/librte_mbuf/rte_mbuf.c
index 8a456e5e64..09d93e6899 100644
--- a/lib/librte_mbuf/rte_mbuf.c
+++ b/lib/librte_mbuf/rte_mbuf.c
@@ -764,7 +764,6 @@ const char *rte_get_rx_ol_flag_name(uint64_t mask)
 	case PKT_RX_QINQ_STRIPPED: return "PKT_RX_QINQ_STRIPPED";
 	case PKT_RX_QINQ: return "PKT_RX_QINQ";
 	case PKT_RX_LRO: return "PKT_RX_LRO";
-	case PKT_RX_TIMESTAMP: return "PKT_RX_TIMESTAMP";
 	case PKT_RX_SEC_OFFLOAD: return "PKT_RX_SEC_OFFLOAD";
 	case PKT_RX_SEC_OFFLOAD_FAILED: return "PKT_RX_SEC_OFFLOAD_FAILED";
 	case PKT_RX_OUTER_L4_CKSUM_BAD: return "PKT_RX_OUTER_L4_CKSUM_BAD";
@@ -808,7 +807,6 @@ rte_get_rx_ol_flag_list(uint64_t mask, char *buf, size_t buflen)
 		{ PKT_RX_FDIR_FLX, PKT_RX_FDIR_FLX, NULL },
 		{ PKT_RX_QINQ_STRIPPED, PKT_RX_QINQ_STRIPPED, NULL },
 		{ PKT_RX_LRO, PKT_RX_LRO, NULL },
-		{ PKT_RX_TIMESTAMP, PKT_RX_TIMESTAMP, NULL },
 		{ PKT_RX_SEC_OFFLOAD, PKT_RX_SEC_OFFLOAD, NULL },
 		{ PKT_RX_SEC_OFFLOAD_FAILED, PKT_RX_SEC_OFFLOAD_FAILED, NULL },
 		{ PKT_RX_QINQ, PKT_RX_QINQ, NULL },
diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h
index a1414ed7cd..17e0b205c0 100644
--- a/lib/librte_mbuf/rte_mbuf.h
+++ b/lib/librte_mbuf/rte_mbuf.h
@@ -1095,6 +1095,7 @@ rte_pktmbuf_attach_extbuf(struct rte_mbuf *m, void *buf_addr,
 static inline void
 rte_mbuf_dynfield_copy(struct rte_mbuf *mdst, const struct rte_mbuf *msrc)
 {
+	memcpy(&mdst->dynfield0, msrc->dynfield0, sizeof(mdst->dynfield0));
 	memcpy(&mdst->dynfield1, msrc->dynfield1, sizeof(mdst->dynfield1));
 }
 
@@ -1108,7 +1109,6 @@ __rte_pktmbuf_copy_hdr(struct rte_mbuf *mdst, const struct rte_mbuf *msrc)
 	mdst->tx_offload = msrc->tx_offload;
 	mdst->hash = msrc->hash;
 	mdst->packet_type = msrc->packet_type;
-	mdst->timestamp = msrc->timestamp;
 	rte_mbuf_dynfield_copy(mdst, msrc);
 }
 
diff --git a/lib/librte_mbuf/rte_mbuf_core.h b/lib/librte_mbuf/rte_mbuf_core.h
index 3fb5abda3c..38e24a580d 100644
--- a/lib/librte_mbuf/rte_mbuf_core.h
+++ b/lib/librte_mbuf/rte_mbuf_core.h
@@ -149,10 +149,7 @@ extern "C" {
  */
 #define PKT_RX_LRO           (1ULL << 16)
 
-/**
- * Indicate that the timestamp field in the mbuf is valid.
- */
-#define PKT_RX_TIMESTAMP     (1ULL << 17)
+/* There is no flag defined at offset 17. It is free for any future use. */
 
 /**
  * Indicate that security offload processing was applied on the RX packet.
@@ -589,12 +586,7 @@ struct rte_mbuf {
 
 	uint16_t buf_len;         /**< Length of segment buffer. */
 
-	/** Valid if PKT_RX_TIMESTAMP is set. The unit and time reference
-	 * are not normalized but are always the same for a given port.
-	 * Some devices allow to query rte_eth_read_clock that will return the
-	 * current device timestamp.
-	 */
-	uint64_t timestamp;
+	uint64_t dynfield0[1]; /**< Reserved for dynamic fields. */
 
 	/* second cache line - fields only used in slow path or on TX */
 	RTE_MARKER cacheline1 __rte_cache_min_aligned;
diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c
index e279b23aea..8168271951 100644
--- a/lib/librte_mbuf/rte_mbuf_dyn.c
+++ b/lib/librte_mbuf/rte_mbuf_dyn.c
@@ -125,6 +125,7 @@ init_shared_mem(void)
 		 * rte_mbuf_dynfield_copy().
 		 */
 		memset(shm, 0, sizeof(*shm));
+		mark_free(dynfield0);
 		mark_free(dynfield1);
 
 		/* init free_flags */
-- 
2.28.0