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 CB1F0A0521; Tue, 3 Nov 2020 11:21:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 8B910C92C; Tue, 3 Nov 2020 11:20:45 +0100 (CET) Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by dpdk.org (Postfix) with ESMTP id 516D5C8DC for ; Tue, 3 Nov 2020 11:20:43 +0100 (CET) Received: by mail-wm1-f67.google.com with SMTP id v5so12143418wmh.1 for ; Tue, 03 Nov 2020 02:20:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=amzsA9dmvhazmV7L1AWE3kiIxR0nj6TRXagUEz42n4c=; b=RAUUYgq9DanuulsGhjBMMv3+rbcb366HrbMZcH43hnKXBDj97VtJWkdIZTZKjQu/pM ZwZ6lqo2xvg+V7qZtzYUT+/lqXKruv/H1HU1QiOsh5DN+nlCbVTZx8R0SrjheuVX9Wok 9qnH4PXF37PB/ucGMUSan+VLS28OMcPQDaA0jsPZiWBLUYv/OdvaDDLiJQ+SBTvUdWu5 6hCEBA0+j9bZmuoAufLIVLeoP2GJre/4jn+vzUw0IxVucuDgUD3f5Ki0+EFSGGFtzCqY U7wK0ecWBsrM7+FhpUKkqG+Ka/Jx2ieJfDdBW2fRfyZCfiQVbETMOzBCdIXqjdKuPAib HifQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=amzsA9dmvhazmV7L1AWE3kiIxR0nj6TRXagUEz42n4c=; b=l+b7i8kN4VRaBLJbtYn1TYGNrSDnQizSc/FU5V5uhJ6wGWNUuzIz2/JIw6Z19zWGBg mWkFkDcMEwP9BuuhZxi+qg+gPq7Awdm2jJr3OqlItVQ9Rn4vaPJBGqyXfZT26dKEfVWO lk0N6S0AeQEOYVkZv1zK5ZV3vHg30TCoLiSSPdqYTo49fp1M3oNMHbwzrvDDzfkPahnS PIcQIqCy8vmf84mRnBKmW1/cSxbS4kSSoJIW51bGIOnj9jFuiI0nt86N8/x6j+yM4oPL j+1DuWFSmyn2j+5JyJaSlKWQk8AXC+AyPTKBuWzsjkHSZiJ6DbOYaJmO+AEB9KaH4rG+ SaHg== X-Gm-Message-State: AOAM533e9+49IBwag2a/nD8Vk5ZeNwzDUaNoTEfCOi+m5YmC4uz57DxA GF7QBTmWl6WsjPNt2az8K4O0Sw== X-Google-Smtp-Source: ABdhPJz/VRDwjzcz/9vFgm7gByJ0X5edmrUHlM8bwDy7RTp+cVMO9/9rEMuJjngV0TQssH/l/g9D1w== X-Received: by 2002:a7b:c00a:: with SMTP id c10mr2725156wmb.119.1604398842025; Tue, 03 Nov 2020 02:20:42 -0800 (PST) Received: from 6wind.com (2a01cb0c0005a600345636f7e65ed1a0.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:3456:36f7:e65e:d1a0]) by smtp.gmail.com with ESMTPSA id l16sm24932129wrx.5.2020.11.03.02.20.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2020 02:20:41 -0800 (PST) Date: Tue, 3 Nov 2020 11:20:40 +0100 From: Olivier Matz To: Thomas Monjalon Cc: dev@dpdk.org, ferruh.yigit@intel.com, david.marchand@redhat.com, bruce.richardson@intel.com, andrew.rybchenko@oktetlabs.ru, jerinj@marvell.com, viacheslavo@nvidia.com, Martin Spinler Message-ID: <20201103102040.GC1898@platinum> References: <20201029092751.3837177-1-thomas@monjalon.net> <20201103001407.2931963-1-thomas@monjalon.net> <20201103001407.2931963-9-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201103001407.2931963-9-thomas@monjalon.net> User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [dpdk-dev] [PATCH v3 08/16] net/nfb: switch Rx 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" On Tue, Nov 03, 2020 at 01:13:59AM +0100, 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 > --- > drivers/net/nfb/nfb_rx.c | 15 ++++++++++++++- > drivers/net/nfb/nfb_rx.h | 18 ++++++++++++++---- > 2 files changed, 28 insertions(+), 5 deletions(-) <...> > index cf3899b2fb..e548226e0f 100644 > --- a/drivers/net/nfb/nfb_rx.h > +++ b/drivers/net/nfb/nfb_rx.h > @@ -15,6 +15,16 @@ > > #define NFB_TIMESTAMP_FLAG (1 << 0) > > +extern uint64_t nfb_timestamp_rx_dynflag; > +extern int nfb_timestamp_dynfield_offset; > + > +static inline rte_mbuf_timestamp_t * > +nfb_timestamp_dynfield(struct rte_mbuf *mbuf) > +{ > + return RTE_MBUF_DYNFIELD(mbuf, > + nfb_timestamp_dynfield_offset, rte_mbuf_timestamp_t *); > +} > + > struct ndp_rx_queue { > struct nfb_device *nfb; /* nfb dev structure */ > struct ndp_queue *queue; /* rx queue */ > @@ -191,15 +201,15 @@ nfb_eth_ndp_rx(void *queue, > > if (timestamping_enabled) { > /* nanoseconds */ > - mbuf->timestamp = > + *nfb_timestamp_dynfield(mbuf) = > rte_le_to_cpu_32(*((uint32_t *) > (packets[i].header + 4))); > - mbuf->timestamp <<= 32; > + *nfb_timestamp_dynfield(mbuf) <<= 32; > /* seconds */ > - mbuf->timestamp |= > + *nfb_timestamp_dynfield(mbuf) |= > rte_le_to_cpu_32(*((uint32_t *) > (packets[i].header + 8))); > - mbuf->ol_flags |= PKT_RX_TIMESTAMP; > + mbuf->ol_flags |= nfb_timestamp_rx_dynflag; > } > > bufs[num_rx++] = mbuf; I think it would be better with a local variable.