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 C520DA04B5; Mon, 26 Oct 2020 11:40:44 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A48082BA3; Mon, 26 Oct 2020 11:40:43 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id DB7EB2BA2 for ; Mon, 26 Oct 2020 11:40:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1603708840; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8AvL9Jsi+d5GySgp6Vf11VLrvakO9fxbmNEXhUUQhj0=; b=WZBBg08eJuo7y5HNlreHzato/sXnXdswPuofZwuNdOb860TbA8YKVAAnNtagAx+0F2BLku AXSt2i/6OtN84jH8WmHvm62XKDnwo9CPvfnnLKQ785BGkrsBl9BZIUhRTMNzU0LujkkbY3 /htnOvvPdUpscNXoDZaz7xnPp01hTcc= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-GRNsce_LM3mAeoav-xCFHg-1; Mon, 26 Oct 2020 06:40:38 -0400 X-MC-Unique: GRNsce_LM3mAeoav-xCFHg-1 Received: by mail-ua1-f70.google.com with SMTP id l48so1150764uae.7 for ; Mon, 26 Oct 2020 03:40:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8AvL9Jsi+d5GySgp6Vf11VLrvakO9fxbmNEXhUUQhj0=; b=PSQznCrLWnBMuh6j0ElGBRYFDDJkHvE6ChwCgVN9TZgdFKokKnmva322KPr5r1V2q3 LYOzoctBVFgwGQ4hDy0AOCSJkJYXU1pCoE99DemnNY7AeOEQjfDqhmcn29foVgkTqYe9 6VlPUvr3AyWEIkxAFomk26V+X/5iyCW2imHHfQ/cJ8WJH82j6NDS5mYNOcH8aB/t/9cw J/6/zyFYH+7E234+PJGzJAS1wLKFSZhhUV38WOH4ilvtq4vLFEgZgaABvO3foS5jTIrV YqDUTk8vdLfyryoQabWqGVc9IFDLIjrXEbFLtetFONFvjQUl9QFSGEjW7RhJL5PIHysb FBaA== X-Gm-Message-State: AOAM531XvA1AYKEMv85OyFYeDpimc8dyT7911pvacvVpjgHOcTfbml9t ZgdYkH2bWDytjYjcw7BkhgB4p90mVGNT2uLN0ifjNHVBNLlKEGexylJz8gQsn0021Rc4Np+XSeZ DbMCKRpSppHgYwDLRjIU= X-Received: by 2002:ab0:784d:: with SMTP id y13mr18928111uaq.86.1603708838201; Mon, 26 Oct 2020 03:40:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4YgJt1oe71nT+p2GEGMA5SVFammrgmOwXDeNQC2EmgQgDDC74nuzUIc7wWdBUk/KLtedwAc2KmvbGOSD3maw= X-Received: by 2002:ab0:784d:: with SMTP id y13mr18928084uaq.86.1603708837919; Mon, 26 Oct 2020 03:40:37 -0700 (PDT) MIME-Version: 1.0 References: <20201026052105.1561859-1-thomas@monjalon.net> <20201026052105.1561859-5-thomas@monjalon.net> In-Reply-To: <20201026052105.1561859-5-thomas@monjalon.net> From: David Marchand Date: Mon, 26 Oct 2020 11:40:26 +0100 Message-ID: To: Thomas Monjalon Cc: dev , "Yigit, Ferruh" , Bruce Richardson , Olivier Matz , Andrew Rybchenko , Akhil Goyal , Nithin Dabilpuram , Pavan Nikhilesh Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 04/15] node: switch IPv4 metadata 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 Mon, Oct 26, 2020 at 6:21 AM Thomas Monjalon wrote: > > The node_mbuf_priv1 was stored in the deprecated mbuf field udata64. > It is moved to a dynamic field in order to allow removal of udata64. > > Signed-off-by: Thomas Monjalon > --- > lib/librte_node/ip4_lookup.c | 7 +++++++ > lib/librte_node/ip4_rewrite.c | 10 ++++++++++ > lib/librte_node/node_private.h | 12 ++++++++++-- > 3 files changed, 27 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_node/ip4_lookup.c b/lib/librte_node/ip4_lookup.c > index 8835aab9dd..2cc91c0c67 100644 > --- a/lib/librte_node/ip4_lookup.c > +++ b/lib/librte_node/ip4_lookup.c > @@ -21,6 +21,8 @@ > > #include "node_private.h" > > +int node_mbuf_priv1_dynfield_offset; > + > #define IPV4_L3FWD_LPM_MAX_RULES 1024 > #define IPV4_L3FWD_LPM_NUMBER_TBL8S (1 << 8) > > @@ -178,6 +180,11 @@ ip4_lookup_node_init(const struct rte_graph *graph, struct rte_node *node) > RTE_SET_USED(node); > > if (!init_once) { > + node_mbuf_priv1_dynfield_offset = rte_mbuf_dynfield_register( > + &node_mbuf_priv1_dynfield_desc); > + if (node_mbuf_priv1_dynfield_offset < 0) > + return -1; How about return -rte_errno like what is done in setup_lpm()? > + > /* Setup LPM tables for all sockets */ > RTE_LCORE_FOREACH(lcore_id) > { [snip] > diff --git a/lib/librte_node/node_private.h b/lib/librte_node/node_private.h > index ab7941c12b..bafea3704d 100644 > --- a/lib/librte_node/node_private.h > +++ b/lib/librte_node/node_private.h > @@ -8,6 +8,7 @@ > #include > #include > #include > +#include > > extern int rte_node_logtype; > #define NODE_LOG(level, node_name, ...) \ > @@ -21,7 +22,6 @@ extern int rte_node_logtype; > #define node_dbg(node_name, ...) NODE_LOG(DEBUG, node_name, __VA_ARGS__) > > /** > - * > * Node mbuf private data to store next hop, ttl and checksum. > */ > struct node_mbuf_priv1 { > @@ -37,6 +37,13 @@ struct node_mbuf_priv1 { > }; > }; > > +static const struct rte_mbuf_dynfield node_mbuf_priv1_dynfield_desc = { > + .name = "rte_node_dynfield_priv1", > + .size = sizeof(uint64_t), > + .align = __alignof__(uint64_t), s/uint64_t/struct node_mbuf_priv1/g ? > +}; > +extern int node_mbuf_priv1_dynfield_offset; > + > /** > * Node mbuf private area 2. > */ -- David Marchand