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 5D1E0A04B5; Thu, 29 Oct 2020 11:13:07 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CE89EC912; Thu, 29 Oct 2020 11:13:04 +0100 (CET) Received: from wnew1-smtp.messagingengine.com (wnew1-smtp.messagingengine.com [64.147.123.26]) by dpdk.org (Postfix) with ESMTP id 40385C910 for ; Thu, 29 Oct 2020 11:13:02 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.west.internal (Postfix) with ESMTP id 331169FE; Thu, 29 Oct 2020 06:13:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 29 Oct 2020 06:13:01 -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= JjPhT7Okm2MeCNDWgSwel6ZW6n5nX1836mC/WT2R/w4=; b=H1uQewOMaT9MoZx2 p9ntYEW97sNMlqctaofnxQPqrUJOy3ODQ/XbA3MrWhmR1/0M1gWJBHlNn9tan70a q9lA5V4P210owPDHOH0cAsvClXWEdpnwHcXwK9CP4OnAFCEGzyhNKv9I8uQORhVn wMEwqtuIAjH35xdF4vMN1Pjo4/SvTnPGNxMNVdg2oXtKyA49D3KwXAxUHx0gyl1+ AYwFU+FfH0n789XpjUgtZCNTpen0Xl4H/Y3uIuiGaJxC8TTOjTXf9tLgdNRW/JdS EKvZ3Y3FyDZIfNyaKvjOrxnx+cyuz564sOwoCfgCKbWLSxZR5kWa2ccZG8ZfivfH RS5RcQ== 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=JjPhT7Okm2MeCNDWgSwel6ZW6n5nX1836mC/WT2R/ w4=; b=OkghuC3xFSjmdJI8f6g+YpCe+tQPJGUX/Mkor8Fjfxq5d5n2GIffgpKUL ZpWdChsNAlHdn0VmknvfpbIv6D3xapAYQPO0asido02FSNex5p9fVNisyYnK+upQ fzZjGDAcC/241q4fcxejGqjXgx3M5ya9E0x5YXqv1mvYvxXwEh5qWtor9OHyNmnR AslnEu/QyAZiQnXQRxEd3mk8kIYEvDYWsxR/xQMPcanmPAufjJvVfUD7i/PggBAB v5eqr5sgBbKTAbt16bDCF/d/rktf9TE5tmRV5zeiyYL0XhaxBf9HeqCnqV7Uvg2V zhHUHZdhduwWw5bJvh/WpG8M6G/tg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrleefgddugecutefuodetggdotefrodftvf 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 95AF53064688; Thu, 29 Oct 2020 06:12:57 -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:12:56 +0100 Message-ID: <6442766.NTUsDM6ZgY@thomas> In-Reply-To: <57314192-7c97-c0ac-7005-3cbac25b8a6d@oktetlabs.ru> References: <20201029092751.3837177-1-thomas@monjalon.net> <20201029092751.3837177-4-thomas@monjalon.net> <57314192-7c97-c0ac-7005-3cbac25b8a6d@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: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?