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 1FFA0A04E7; Mon, 2 Nov 2020 10:38:45 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F35F9BE41; Mon, 2 Nov 2020 10:38:43 +0100 (CET) Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by dpdk.org (Postfix) with ESMTP id 51240AC90 for ; Mon, 2 Nov 2020 10:38:41 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 479BFE22; Mon, 2 Nov 2020 04:38:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 02 Nov 2020 04:38:39 -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:content-type; s=fm2; bh= 0O+NVPworws1z3cjzuCTzkRWf8PjaP+7dMKK0hAJL80=; b=DnDTOnoDvpIy7hcf WoX7B94rQw4Iy6Bni7rajO0LAaxuaVEmpAbpnElDi78kP8BgQLFRWaOLWI/fUese I8r/VQ84VT5vPazczN6a/TJI7cZbde13NFm3LHHpq4L8kALJV8pAQ5X7b2s2eiV8 gbFWvQqwYTgTR6pRBPvEfksTSmbTjhu7eAyK9e4OjP/p6y38ikbfw8zE9DvYLgJG +RsVQ9op9Mwg1RAL2hBZxZxoDuj3OzHyTYUQOcZA9e8REkag5YOrql1bBBrBwK8y SkvgDyMt52CY+ciM/bwf5n7A1jkL884Ky3O6xViirAWjWOprs6NZo3NUh8xbX1py euoWKQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :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=0O+NVPworws1z3cjzuCTzkRWf8PjaP+7dMKK0hAJL 80=; b=DC+3sWgf/139tr9kGLHawLZQt7UOy/GWhnfmnUSnqqUlYvDBDGErP3stx HtYPEKecJHWslpbMAIWPQBfThgRioKX7jphXSw7mEvEyGmbzBOY/UCuu5DUvEINF wyR7obOTFZJjpdErAMgwpkOIf9qFNCZgz6cCPuwQzcpdhLlfU6bVUIgBSnMY0Roi EsdqtlBjEiwBCFiztbN5oLnzVRbwnQMjEX0pjKNKQva6FrOItBaa8v7TvdHtxJG+ ACrZzr3+kKX0KLnyxhjxtwUjrR/CFgoHOZF8rsrYAdumYh8103QrbaQIId/7S7oA yRakPYrjLXFaEBOjeHZ55jRs+Nmqg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddtuddgtdeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6DD263064610; Mon, 2 Nov 2020 04:38:34 -0500 (EST) From: Thomas Monjalon To: Jerin Jacob , Jerin Jacob Cc: dev@dpdk.org, Ferruh Yigit , David Marchand , "Richardson, Bruce" , Olivier Matz , Andrew Rybchenko , Viacheslav Ovsiienko , Nithin Dabilpuram , Kiran Kumar K , Ray Kinsella , Neil Horman Date: Mon, 02 Nov 2020 10:38:33 +0100 Message-ID: <5457970.OX1LmiOAXX@thomas> In-Reply-To: References: <20201029092751.3837177-1-thomas@monjalon.net> <20201101180626.2198868-11-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2 10/14] net/octeontx2: switch 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" 01/11/2020 19:28, Jerin Jacob: > On Sun, Nov 1, 2020 at 11:40 PM Thomas Monjalon wrote: > > > > The mbuf timestamp is moved to a dynamic field > > in order to allow removal of the deprecated static field. > > The related mbuf flag is also replaced. > > > > Signed-off-by: Thomas Monjalon > > --- [...] > > +uint64_t rte_pmd_octeontx2_timestamp_rx_dynflag; > > +int rte_pmd_octeontx2_timestamp_dynfield_offset = -1; > > Instead of the global variable, please move the offset to struct > otx2_timesync_info(which is used in fastpath) and accessible in slow > path. This structure is initialized in otx2_nix_dev_start(). otx2_rx_timestamp_setup() is called earlier in otx2_nix_configure(). One of the two has to change. Which one? > > +static int > > +otx2_rx_timestamp_setup(uint16_t flags) > > +{ > > + int timestamp_rx_dynflag_offset; > > + > > + if ((flags & NIX_RX_OFFLOAD_TSTAMP_F) == 0) > > + return 0; > > + > > + rte_pmd_octeontx2_timestamp_dynfield_offset = rte_mbuf_dynfield_lookup( > > + RTE_MBUF_DYNFIELD_TIMESTAMP_NAME, NULL); > > + if (rte_pmd_octeontx2_timestamp_dynfield_offset < 0) { > > + otx2_err("Failed to lookup timestamp field"); > > + return -rte_errno; > > + } > > + timestamp_rx_dynflag_offset = rte_mbuf_dynflag_lookup( > > + RTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME, NULL); > > + if (timestamp_rx_dynflag_offset < 0) { > > + otx2_err("Failed to lookup Rx timestamp flag"); > > + return -rte_errno; > > + } > > + rte_pmd_octeontx2_timestamp_rx_dynflag = > > + RTE_BIT64(timestamp_rx_dynflag_offset); > > + > > + return 0; > > +} > > @@ -1874,6 +1904,9 @@ otx2_nix_configure(struct rte_eth_dev *eth_dev) > > dev->tx_offload_flags |= nix_tx_offload_flags(eth_dev); > > dev->rss_info.rss_grps = NIX_RSS_GRPS; > > > > + if (otx2_rx_timestamp_setup(dev->rx_offload_flags) != 0) > > + goto fail_offloads; > > + > > nb_rxq = RTE_MAX(data->nb_rx_queues, 1); > > nb_txq = RTE_MAX(data->nb_tx_queues, 1);