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 EA3EFA0521; Tue, 3 Nov 2020 13:23:48 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B3790C9F0; Tue, 3 Nov 2020 13:22:30 +0100 (CET) Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by dpdk.org (Postfix) with ESMTP id D2CFAC9E4 for ; Tue, 3 Nov 2020 13:22:28 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 424A1C71; Tue, 3 Nov 2020 07:22:26 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 03 Nov 2020 07:22:27 -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=NA5G46SInbJX0 9Xj88gnNgwJB9hzrco6zsd6l7fc9XQ=; b=exBnqgMHdxFD/ft6spJRLUZ1m7/ve 2GDLzgxV7MT27CEocnPF7RWK+PB+Y5dJWW/0Wz+GmmhBL1fpfcAAuF6YKC0JR0dg wr9LjvXsX+NBuWKRJO1bJLxRR8ort6UVZ4dBvJqifneGrH6O5uxHK/9ZIRoEowZK fdMljrkC/rCxiulXax1pNd2dJH2+/IncNLWPx/DH29UROsqOpWtD5PFpghWmoICv IYOTvO26eEMA6O6R7G+KKRs48LqtetEVTe09HZL1//cmaYc8rlkV6rnQoipRzYKD 6RCV7qSMzCJ4TlBBvq3ZxZZvx8O23U1ARNmXy4UBaTS5jjSCnFRP3wA7Q== 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=NA5G46SInbJX09Xj88gnNgwJB9hzrco6zsd6l7fc9XQ=; b=ONFFybN+ 5KobGamuRF/G0fw874k8OSCbkRYRDz2GFsj+TTLp0RJN+BJnnbxMoCc6IkiqEV8V zDIkwXETy/tSzyeSFQeVKfPkJiPjnr9dwQ4cPm0rFRsca3JF7Qs9GvzBl10knmeW rKS+odwO9FCFvZwWdKfc3pTwAzvogc6/+RQqgHvbo5oiENJtbzYUbXZPABOFuQEZ LbP+U31/Cdr36443T5JmuqE3LArTYMGG1if1u4Eg20xxVC91mRu6voF1RjfwbEXG lyR71I0oq5DZjX959gvXH+7HO3r0RPzc/PdEQVBq4fuURXU+K0iecWB7asLSnTIK oG3w93HyRxHHsQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtfedgfeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght 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 80E123064680; Tue, 3 Nov 2020 07:22:24 -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, Shepard Siegel , Ed Czeck , John Miller Date: Tue, 3 Nov 2020 13:21:53 +0100 Message-Id: <20201103122205.183472-5-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 04/16] net/ark: switch Rx timestamp to dynamic mbuf field 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 mbuf timestamp is moved to a dynamic field in order to allow removal of the deprecated static field. The related dynamic mbuf flag is set, although was missing previously. The timestamp is set if configured for at least one device. Signed-off-by: Thomas Monjalon Acked-by: David Marchand --- drivers/net/ark/ark_ethdev.c | 16 ++++++++++++++++ drivers/net/ark/ark_ethdev_rx.c | 7 ++++++- drivers/net/ark/ark_ethdev_rx.h | 2 ++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index fa343999a1..a34dcc5291 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -79,6 +79,8 @@ static int eth_ark_set_mtu(struct rte_eth_dev *dev, uint16_t size); #define ARK_TX_MAX_QUEUE (4096 * 4) #define ARK_TX_MIN_QUEUE (256) +uint64_t ark_timestamp_rx_dynflag; +int ark_timestamp_dynfield_offset = -1; int rte_pmd_ark_rx_userdata_dynfield_offset = -1; int rte_pmd_ark_tx_userdata_dynfield_offset = -1; @@ -552,6 +554,18 @@ static int eth_ark_dev_configure(struct rte_eth_dev *dev) { struct ark_adapter *ark = dev->data->dev_private; + int ret; + + if (dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_TIMESTAMP) { + ret = rte_mbuf_dyn_rx_timestamp_register( + &ark_timestamp_dynfield_offset, + &ark_timestamp_rx_dynflag); + if (ret != 0) { + ARK_PMD_LOG(ERR, + "Failed to register Rx timestamp field/flag\n"); + return -rte_errno; + } + } eth_ark_dev_set_link_up(dev); if (ark->user_ext.dev_configure) @@ -782,6 +796,8 @@ eth_ark_dev_info_get(struct rte_eth_dev *dev, ETH_LINK_SPEED_50G | ETH_LINK_SPEED_100G); + dev_info->rx_offload_capa = DEV_RX_OFFLOAD_TIMESTAMP; + return 0; } diff --git a/drivers/net/ark/ark_ethdev_rx.c b/drivers/net/ark/ark_ethdev_rx.c index c24cc00e2f..d29d3db783 100644 --- a/drivers/net/ark/ark_ethdev_rx.c +++ b/drivers/net/ark/ark_ethdev_rx.c @@ -272,7 +272,12 @@ eth_ark_recv_pkts(void *rx_queue, mbuf->port = meta->port; mbuf->pkt_len = meta->pkt_len; mbuf->data_len = meta->pkt_len; - mbuf->timestamp = meta->timestamp; + /* set timestamp if enabled at least on one device */ + if (ark_timestamp_rx_dynflag > 0) { + *RTE_MBUF_DYNFIELD(mbuf, ark_timestamp_dynfield_offset, + rte_mbuf_timestamp_t *) = meta->timestamp; + mbuf->ol_flags |= ark_timestamp_rx_dynflag; + } rte_pmd_ark_mbuf_rx_userdata_set(mbuf, meta->user_data); if (ARK_DEBUG_CORE) { /* debug sanity checks */ diff --git a/drivers/net/ark/ark_ethdev_rx.h b/drivers/net/ark/ark_ethdev_rx.h index 0fdd29b1ab..001fa9bdfa 100644 --- a/drivers/net/ark/ark_ethdev_rx.h +++ b/drivers/net/ark/ark_ethdev_rx.h @@ -11,6 +11,8 @@ #include #include +extern uint64_t ark_timestamp_rx_dynflag; +extern int ark_timestamp_dynfield_offset; int eth_ark_dev_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx, -- 2.28.0