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 5DFCFA04B5; Thu, 29 Oct 2020 11:08:28 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0748BC910; Thu, 29 Oct 2020 11:08:27 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by dpdk.org (Postfix) with ESMTP id 24588C90A for ; Thu, 29 Oct 2020 11:08:24 +0100 (CET) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id B114E7F4AC; Thu, 29 Oct 2020 13:08:22 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru B114E7F4AC DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1603966102; bh=eXYs142d3Z5JXGjvA9fjimpX191fcV/Y8F80Q7u23UU=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=AXwl0z1WdQkwZMFpQO5yzxTCBrhgq1lhJgJCYITfz/C943WztShX5B6Xv497/o9tr U4XNeILWvltgP1MCUf8MZO64S35T1w0N+egPUtqwLUIf/8EthmTwBHOYoQTVp1p3/c WLtTTh3vTYNZOslB1jWINT8jNHOVhWfsn4F9s9LQ= To: Thomas Monjalon , dev@dpdk.org Cc: 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 References: <20201029092751.3837177-1-thomas@monjalon.net> <20201029092751.3837177-4-thomas@monjalon.net> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <57314192-7c97-c0ac-7005-3cbac25b8a6d@oktetlabs.ru> Date: Thu, 29 Oct 2020 13:08:22 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20201029092751.3837177-4-thomas@monjalon.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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" 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 > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c > index b12bb3854d..7c9aadb461 100644 > --- a/lib/librte_ethdev/rte_ethdev.c > +++ b/lib/librte_ethdev/rte_ethdev.c [snip] > @@ -1232,6 +1233,59 @@ eth_dev_check_lro_pkt_size(uint16_t port_id, uint32_t config_size, > return ret; > } > > +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. [snip]