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 1B8CDA0521; Tue, 3 Nov 2020 15:15:33 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B4574CCAD; Tue, 3 Nov 2020 15:10:16 +0100 (CET) Received: from wout1-smtp.messagingengine.com (wout1-smtp.messagingengine.com [64.147.123.24]) by dpdk.org (Postfix) with ESMTP id C52B8CCA4 for ; Tue, 3 Nov 2020 15:10:14 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 66947C8F; Tue, 3 Nov 2020 09:10:12 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 03 Nov 2020 09:10:13 -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=VTN/JE9FiMr6x 7ULpEi0iGVR/A2VTjz8ZmeEiMBn0DY=; b=nEdjjvtbQVAjWAoSCmnuM3KCBmmja uMP/xLLZOZrTZbYLEiufwdy4QLcwFqtesfooPsN7o+yhdXGTgQ6hRVQ4bmKzzDVy Hib9QS8ZsAGTyBlUwK9VKDDtsZFMvv1lHvDTtgosIoU+Auu78qM9tghWjEAohoXn nycW6UuxDe7vlXEXrZtxN8P96TT3CwqunuOqKAL69XEUzGhTerACjDYlzD/vStvS ZZdwh2QZA/Mjd2YDc+GSOll6ClqbrqCF1XpnSa2CoicvQmws9cgBjrQDT/0Ky7Gi X3/Bx68ssht+daucRb/gMqYC/b0T/24Lm4Ic37JQeqVY1B44m6x+KNQBA== 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=VTN/JE9FiMr6x7ULpEi0iGVR/A2VTjz8ZmeEiMBn0DY=; b=jwJ0+8Bq zMdLXXV+nAZ2jqKcjakeX7hacVm2n/WDKdNfIOzUrTphX4N55qDKAXDQ/TYpRrO9 mmz6m7m+raB7J0WZKZQ98QqBlCwprrnHgllntP3m0t9fw2LHWjEyOfR8bkamhMP5 qfbNXZRvF8BENThKTkFR8aPY+Uc/YjvRhTaBw1FeMEAPLVnXeM/4sn3YGz7RI7sk goBW0uAyzGlV/73EDYTSGxDfPFlWOiwRIOnL/wQ0yXDMHoyq55BYmsCn4QOQ9EA3 M3bBAOkquCJfQMuCcz4CwWVocuvcPgNdptdzwJyW2iIvRXhSuPCE5T48URrFFXKE 2mcz83j3XVazZA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtfedgheekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeduvdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr 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 CCAC73280060; Tue, 3 Nov 2020 09:10:10 -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 15:09:30 +0100 Message-Id: <20201103140931.488700-16-thomas@monjalon.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201103140931.488700-1-thomas@monjalon.net> References: <20201029092751.3837177-1-thomas@monjalon.net> <20201103140931.488700-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v5 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 Acked-by: Andrew Rybchenko --- 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