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 9C4F4A04B5; Thu, 29 Oct 2020 11:33:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7A0CAC974; Thu, 29 Oct 2020 11:33:40 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by dpdk.org (Postfix) with ESMTP id 01F5BC964 for ; Thu, 29 Oct 2020 11:33:38 +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 8C1877F483; Thu, 29 Oct 2020 13:33:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 8C1877F483 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1603967617; bh=qsKLOce7T12fl43wuXwsrCCrmJX/GRBxWbmOGxo1dgE=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=lQnIIgeC+NLuya/BmaxsVyuQ/AwoEMK1NKOd15kMbRgmkS1eNuKtj76nMYjsPH5or OemgRfZN3MrtliNCp05yqzhW+rJs5v13Kn3vdlHWJTHUrHucRezSH4oSSJq5Q8v6qL NmPUIzTWLvqb0lCGq0pQ8sJmoFUaeQrv+XoGLdhU= To: Thomas Monjalon 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 References: <20201029092751.3837177-1-thomas@monjalon.net> <20201029092751.3837177-4-thomas@monjalon.net> <57314192-7c97-c0ac-7005-3cbac25b8a6d@oktetlabs.ru> <6442766.NTUsDM6ZgY@thomas> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <0cdb23c1-6876-1220-b4c1-54f075455f5c@oktetlabs.ru> Date: Thu, 29 Oct 2020 13:33:37 +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: <6442766.NTUsDM6ZgY@thomas> 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 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.