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 ECC30A04B5; Thu, 29 Oct 2020 11:46:47 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C44D8C9B2; Thu, 29 Oct 2020 11:46:46 +0100 (CET) Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by dpdk.org (Postfix) with ESMTP id 6908BC9AC for ; Thu, 29 Oct 2020 11:46:45 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id BCDE4972; Thu, 29 Oct 2020 06:46:42 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 29 Oct 2020 06:46:43 -0400 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= tF1ibCZ9JT23WZz324b7bsbAsBtK927x4BQOHRXm6TI=; b=k9NOCmOK9D5P2LFV tczEDtLrgV4N6jYaVHbxnVLVQ4AKJ1VAj3d3jx/49+pOFy8dWbzUAqzbfKfCq0Yg 1222dqVUDEHzclvzwVxt18gLGG1yUiMbqVpmkp9rH2Xdzr3R47rASt6Yh6XAb1vR 3wGbi5yXIgcBIklw2hQtez6GPNhPFIU88jdRi7EzTBaZbp1Kf4BGztofDmAqgl7x OI7q84EQyuPhOwmDoio1ut/d7MmNDBU6pn1j1uBBhozu2Xq0cfDIF2rrW4VjsxCo AzFpKE+w/QGEj0iRjXKE+ifb3x+TdLj4KTQFJmuJajF7ze3IdYdYDm+rLLpM8R0s Cgof4Q== 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=tF1ibCZ9JT23WZz324b7bsbAsBtK927x4BQOHRXm6 TI=; b=cuf79f9XjTRiKcdpmjmZjJoL2mvE3KONj3a9eptECPGrEEwyfIFCXKwa3 6jGAcfa2z5Um9wjViAy60W2sdB7z7BZrX5xCcEFXr2n9OAvDCBe32G0hQK4fmF1/ tuZ+6Tkuuxbjol0eLdX0peCJ0DVTMK7GS51JcjWkuLfZCXGQh9MZHeUmTeqI17db 6sSbqqCzyxe+VEn2C5D2UoykWgBXckBbx1QpcVgEiSysh1eNaTV5Kvd8AGI0WATp yCd55swKCTnkNBKY12ByNqNEydviUogEy88lCzuOFebM2ZbPlSY+AhRpnYW+v4LP bNykNiHMg1KP6WpVX5ta2f0RIUSBw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrleefgddvudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth 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 0F7E3306467D; Thu, 29 Oct 2020 06:46:39 -0400 (EDT) From: Thomas Monjalon To: Andrew Rybchenko Cc: dev@dpdk.org, ferruh.yigit@intel.com, david.marchand@redhat.com, bruce.richardson@intel.com, olivier.matz@6wind.com, jerinj@marvell.com, viacheslavo@nvidia.com, Wenzhuo Lu , Beilei Xing , Bernard Iremonger , Matan Azrad , Shahaf Shuler Date: Thu, 29 Oct 2020 11:46:38 +0100 Message-ID: <4359743.FE95t14JqS@thomas> In-Reply-To: <0cdb23c1-6876-1220-b4c1-54f075455f5c@oktetlabs.ru> References: <20201029092751.3837177-1-thomas@monjalon.net> <6442766.NTUsDM6ZgY@thomas> <0cdb23c1-6876-1220-b4c1-54f075455f5c@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 03/15] ethdev: register mbuf field and flags for timestamp 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" 29/10/2020 11:33, Andrew Rybchenko: > On 10/29/20 1:12 PM, Thomas Monjalon wrote: > > 29/10/2020 11:08, Andrew Rybchenko: > >> On 10/29/20 12:27 PM, Thomas Monjalon wrote: > >>> During port configure or queue setup, the offload flags > >>> DEV_RX_OFFLOAD_TIMESTAMP and DEV_TX_OFFLOAD_SEND_ON_TIMESTAMP > >>> trigger the registration of the related mbuf field and flags. > >>> > >>> Previously, the Tx timestamp field and flag were registered in testpmd, > >>> as described in mlx5 guide. > >>> For the general usage of Rx and Tx timestamps, > >>> managing registrations inside ethdev is simpler and properly documented. > >>> > >>> Signed-off-by: Thomas Monjalon > >> > >> A small note below, other than that > >> > >> Reviewed-by: Andrew Rybchenko > >> > >>> +static inline int > >>> +eth_dev_timestamp_mbuf_register(uint64_t rx_offloads, uint64_t tx_offloads) > >>> +{ > >>> + static const struct rte_mbuf_dynfield field_desc = { > >>> + .name = RTE_MBUF_DYNFIELD_TIMESTAMP_NAME, > >>> + .size = sizeof(rte_mbuf_timestamp_t), > >>> + .align = __alignof__(rte_mbuf_timestamp_t), > >>> + }; > >>> + static const struct rte_mbuf_dynflag rx_flag_desc = { > >>> + .name = RTE_MBUF_DYNFLAG_RX_TIMESTAMP_NAME, > >>> + }; > >>> + static const struct rte_mbuf_dynflag tx_flag_desc = { > >>> + .name = RTE_MBUF_DYNFLAG_TX_TIMESTAMP_NAME, > >>> + }; > >>> + static bool done_rx, done_tx; > >> > >> I think we don't need these static flags. We can just repeat > >> registeration request and it will simply lookup and return > >> the same offset/flagbit as before. > > > > Absolutely. > > I did it as a small optimization in control path. > > > > I hesitated. Given it is only 2 booleans, > > do you prefer with or without or no opinion? > > > I'd prefer without it. It is always better without > static variables if possible. I liked the naming of variables "todo" and "done" but I will do what is preferred. If nobody objects, I will remove this small (useless) optimization.