From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129]) by dpdk.org (Postfix) with ESMTP id 6CD6D6A73 for ; Thu, 13 Oct 2016 16:35:15 +0200 (CEST) Received: from Internal Mail-Server by MTLPINE1 (envelope-from olegk@mellanox.com) with ESMTPS (AES256-SHA encrypted); 13 Oct 2016 16:35:12 +0200 Received: from r-aa-zorro016.mtr.labs.mlnx (r-aa-zorro016.mtr.labs.mlnx [10.209.68.122]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id u9DEZCgn029473 for ; Thu, 13 Oct 2016 17:35:12 +0300 Received: from r-aa-zorro016.mtr.labs.mlnx (localhost [127.0.0.1]) by r-aa-zorro016.mtr.labs.mlnx (8.14.7/8.14.7) with ESMTP id u9DEZBYP017264 for ; Thu, 13 Oct 2016 14:35:12 GMT From: Oleg Kuporosov To: dev@dpdk.org Date: Thu, 13 Oct 2016 14:35:06 +0000 Message-Id: <1476369308-17021-2-git-send-email-olegk@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1476369308-17021-1-git-send-email-olegk@mellanox.com> References: <1476369308-17021-1-git-send-email-olegk@mellanox.com> Subject: [dpdk-dev] [PATCH 1/3] mbuf: embedding timestamp into the packet X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Oct 2016 14:35:15 -0000 The hard requirement of financial services industry is accurate timestamping aligned with the packet itself. This patch is to satisfy this requirement: - include uint64_t timestamp field into rte_mbuf with minimal impact to throughput/latency. Keep it just simple uint64_t in ns (more than 580 years) would be enough for immediate needs while using full struct timespec with twice bigger size would have much stronger performance impact as missed cacheline0. - it is possible as there is 6-bytes gap in 1st cacheline (fast path) and moving uint16_t vlan_tci_outer field to 2nd cacheline. - such move will only impact for pretty rare usable VLAN RX stripping mode for outer TCI (it used only for one NIC i40e from the whole set and allows to keep minimal performance impact for RX/TX timestamps. Signed-off-by: Oleg Kuporosov --- lib/librte_mbuf/rte_mbuf.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/librte_mbuf/rte_mbuf.h b/lib/librte_mbuf/rte_mbuf.h index 23b7bf8..1e1f2ed 100644 --- a/lib/librte_mbuf/rte_mbuf.h +++ b/lib/librte_mbuf/rte_mbuf.h @@ -851,8 +851,7 @@ struct rte_mbuf { uint32_t seqn; /**< Sequence number. See also rte_reorder_insert() */ - /** Outer VLAN TCI (CPU order), valid if PKT_RX_QINQ_STRIPPED is set. */ - uint16_t vlan_tci_outer; + uint64_t timestamp; /**< Packet's timestamp, usually in ns */ /* second cache line - fields only used in slow path or on TX */ MARKER cacheline1 __rte_cache_min_aligned; @@ -885,6 +884,9 @@ struct rte_mbuf { }; }; + /** Outer VLAN TCI (CPU order), valid if PKT_RX_QINQ_STRIPPED is set. */ + uint16_t vlan_tci_outer; + /** Size of the application private data. In case of an indirect * mbuf, it stores the direct mbuf private data size. */ uint16_t priv_size; -- 1.8.3.1