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 D1D91A04E7; Tue, 3 Nov 2020 01:19:17 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 39764BE89; Tue, 3 Nov 2020 01:14:59 +0100 (CET) Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by dpdk.org (Postfix) with ESMTP id 2017ABE85 for ; Tue, 3 Nov 2020 01:14:58 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id BD063B54; Mon, 2 Nov 2020 19:14:55 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 02 Nov 2020 19:14:56 -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=xEARymGfGYsPR eFaEDBsRjSsHeepr82TqiV3+ygYG3I=; b=KScZFBceDbsier630vq5+KwKP6ZYe T3462/iGQG3z38VSAnXkaHdY/GkMGtPxTFClHRzYhP9nmDCbLMVSBHIAv6zQvvzd mqmNjfLlhP4p2qeyQTijubyiTHuoBXTZrGhAa2+qFUtdbbk13FotgjSA2zQsOOZ0 UpVqV26hOHpE6XnIzxDJgWtMuyG8LiiNsiZEMNiJQF/Ebfp0yuAfR5mK6VACVXJk 3CkaCPVf3MD6sxfBUP4DCSClD/P1yRAnfLyhkRTyE+yJeHN3XhQePsXjuoB6/0Pr lMRyLq6XoiTLXcvRe2LubwK/nSSsSqVptXIQoSKcjbeoo2easivxeRG8g== 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=xEARymGfGYsPReFaEDBsRjSsHeepr82TqiV3+ygYG3I=; b=pBQPgqZh kqf76bZRxzxQYXpORVIlBullB5KIcdoA1So8a2RaRTUCZzsGtn5oA8ZO+JDZqtZG NVALqrjIdvblDNCUj735WxHhdDRaUa8eUvUwQPeU5thFgiu4ZoScCOcfE1dy2gQ4 3AunZxICgUwags5ZHNibtpWpoSjMy+/zjdqANQ3VSjL5GEfew4SGPkWd0AF0g5Pu 7VlqmSTjfBbKsRZa9U5CAbCL58ojhQNBgqlGCaisluEjHZa8tqrD66f3kYydmcpO Kacj1kagJbxkoyWQGliroz4qoL+6kNR7xjXPvbK+vo4Hwl8WrsrjD7n+aA5AYTIO tIZrp6WKRHyMqw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtvddgudejucetufdoteggodetrfdotf 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 2FD243064683; Mon, 2 Nov 2020 19:14:54 -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 01:14:06 +0100 Message-Id: <20201103001407.2931963-16-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 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 --- 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 8168271951..ba083853e4 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