From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C1E82A0521; Tue, 3 Nov 2020 13:28:26 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0864BCAA3; Tue, 3 Nov 2020 13:22:54 +0100 (CET) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id 41009CA95 for ; Tue, 3 Nov 2020 13:22:51 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id D0E7DC73; Tue, 3 Nov 2020 07:22:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 03 Nov 2020 07:22:49 -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=eRirW9lWZ82GO oXDuh09vSbgvma6PFjT1/CWZMd2vUY=; b=KNhZBi2nyQNIV+Tw8j7jGMPcl3Jex Ma1r7yqtNXRx9KYiUdKxYiyjJt3XAztLpb+nS12JFHgrg39BGWZN/cWW+KpyELVL 2NlQWZct3IuyyJVJbglNZ/hTtVp6C1lIbsd70ue7SvMMeVCCbV+UPV7LeSNyOaRm 7nMRfXkAkSs+vTmYNir5vxvXGdx5epGw36zv84RQeXO/QFkY5/tH9L1QHearyJq6 lQ9rF0doW/Ku1oDaoUWCtOpi6hjscFeZxkiX4PBvvhdShMt0GsnyP1aUizCI3T1Q nkbN5MlyGAgRGnk9jSdNe9umQhZt4br7PJwDiGlh8D0oIVpQ7Sac/AyVw== 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=eRirW9lWZ82GOoXDuh09vSbgvma6PFjT1/CWZMd2vUY=; b=Lgy234If mn4cicqqKVhABYQ5v/WTmsrhW6jAW80U41ZpmwN3hMKkKv+iWT8FJdfOl2RK6tN1 iFMmX3Lgq/PTWTAcisrBr5yljqnrQLF5ZtI1Rd62646KeaRzfx8xHt+kGSs4BSNF s57ZWxxwp+zWVarevwgLQJNgouVMOmO7y+YAum7MKGXfNL/XEnWd7ZICUoQW/nbO pKfi4u+ecVo4KUXZEJgcRWmkG6sTgbozbIm/ZcVn2ZhDrAbW4t9JW/mZwSM9tkVT JXCQgMLfU2zKPTKWvK2VSeFtxkT+F6vhqJ2CyZrupFCX94By4BfeEPPMyxfxk2dl HfKFT42ysvu3zQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtfedgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeduudenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 464FC3064682; Tue, 3 Nov 2020 07:22:47 -0500 (EST) From: Thomas Monjalon 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, Ray Kinsella , Neil Horman Date: Tue, 3 Nov 2020 13:22:04 +0100 Message-Id: <20201103122205.183472-16-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> <20201103122205.183472-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v4 15/16] mbuf: add Tx timestamp registration helper X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The function rte_mbuf_dyn_tx_timestamp_register() can be used to register the required field and flag. Signed-off-by: Thomas Monjalon Acked-by: David Marchand --- lib/librte_mbuf/rte_mbuf_dyn.c | 7 +++++++ lib/librte_mbuf/rte_mbuf_dyn.h | 22 ++++++++++++++++++++++ lib/librte_mbuf/version.map | 1 + 3 files changed, 30 insertions(+) diff --git a/lib/librte_mbuf/rte_mbuf_dyn.c b/lib/librte_mbuf/rte_mbuf_dyn.c index 4f50da09f3..101b5bd95f 100644 --- a/lib/librte_mbuf/rte_mbuf_dyn.c +++ b/lib/librte_mbuf/rte_mbuf_dyn.c @@ -613,3 +613,10 @@ rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag) return rte_mbuf_dyn_timestamp_register(field_offset, rx_flag, "Rx", RTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME); } + +int +rte_mbuf_dyn_tx_timestamp_register(int *field_offset, uint64_t *tx_flag) +{ + return rte_mbuf_dyn_timestamp_register(field_offset, tx_flag, + "Tx", RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME); +} diff --git a/lib/librte_mbuf/rte_mbuf_dyn.h b/lib/librte_mbuf/rte_mbuf_dyn.h index 2e729ddaca..d88e7bacc5 100644 --- a/lib/librte_mbuf/rte_mbuf_dyn.h +++ b/lib/librte_mbuf/rte_mbuf_dyn.h @@ -304,4 +304,26 @@ int rte_mbuf_dyn_rx_timestamp_register(int *field_offset, uint64_t *rx_flag); */ #define RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME "rte_dynflag_tx_timestamp" +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Register dynamic mbuf field and flag for Tx timestamp. + * + * @param field_offset + * Pointer to the offset of the registered mbuf field, can be NULL. + * The same field is shared for Rx and Tx timestamp. + * @param tx_flag + * Pointer to the mask of the registered offload flag, can be NULL. + * @return + * 0 on success, -1 otherwise. + * Possible values for rte_errno: + * - EEXIST: already registered with different parameters. + * - EPERM: called from a secondary process. + * - ENOENT: no more field or flag available. + * - ENOMEM: allocation failure. + */ +__rte_experimental +int rte_mbuf_dyn_tx_timestamp_register(int *field_offset, uint64_t *tx_flag); + #endif diff --git a/lib/librte_mbuf/version.map b/lib/librte_mbuf/version.map index 0b66668bff..b7d98e7eb1 100644 --- a/lib/librte_mbuf/version.map +++ b/lib/librte_mbuf/version.map @@ -43,6 +43,7 @@ EXPERIMENTAL { rte_mbuf_dynflag_register_bitnum; rte_mbuf_dyn_dump; rte_mbuf_dyn_rx_timestamp_register; + rte_mbuf_dyn_tx_timestamp_register; rte_pktmbuf_copy; rte_pktmbuf_free_bulk; rte_pktmbuf_pool_create_extbuf; -- 2.28.0