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 71835A00BE; Wed, 30 Oct 2019 16:49:15 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C934C1BFF5; Wed, 30 Oct 2019 16:49:13 +0100 (CET) Received: from mail-wr1-f68.google.com (mail-wr1-f68.google.com [209.85.221.68]) by dpdk.org (Postfix) with ESMTP id A01E61BF71 for ; Wed, 30 Oct 2019 16:49:12 +0100 (CET) Received: by mail-wr1-f68.google.com with SMTP id s1so2909772wro.0 for ; Wed, 30 Oct 2019 08:49:12 -0700 (PDT) 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=obDs3PaSJWwwLf2ZLH8hyjGXXpVIRxE8hDA7zev0H+o=; b=aZ8uGIqQbnU5X8bNuNHpO5qDlQM1JDsWxaxDJgXR6+pUpLI1x1qqOXjL3bpVrvZ67a 8zAmtq4AVDDU+25sWsf3gfc3dfQeedoUlXMpvbpmtENM3A2oqceb2AtiCIXoVrtEirF3 NNQe5RG6t4IGS+TRzVv2o2XQLq6LKLE7vA7r4hzPXfG5ze28dhbKWE+WLuNzMeDRxHok MDtN08eMH97RHlMICdzEUtA2jPA/VCHrQVkykMiJl+GTgITMXWZfNHEHyuMklAhjFoAR PyskFKyUhNKCf16p1ZHmdY1lLwFPf3JYYGt0XvREi8GkY3qS0PHFkFQwfB8y5hU+nhh9 gLsg== 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=obDs3PaSJWwwLf2ZLH8hyjGXXpVIRxE8hDA7zev0H+o=; b=JOHCIphEqT0m2YppZCP+FmYmrkgl95YpluNdsFnmrARhv8IqNDl+Yujim3Den32zc9 E2anWTrZcbbOLgehbyuzopMt0Xa49F/7CpUSwPbbogtqYR0VH5bRZ5vV5DlkKl8t2K5j +4kXMyy/QYftK9uENjNVNZlWQPss+vi7Vnzi+7t4LJvmiafVIpRD/n6dLJO4FFTT+J3d Yui5KPaUB1intzRS+tdRRwiQqweTXYkARV+dX3mqFi+sgbgjiT4WDG+8vqwLGA+5fbvL qqZhU7kODrSW87AkbS7aAmUQWuauwkjzzC8/j1tkGmO3EzFNTDL05BgGDYAquAJykKhg efbg== X-Gm-Message-State: APjAAAWmi5On1yYgFmNfCYBV75+g9yqlPA0dlqmJoBgQ0pyyn5gWRmeU sLxDiLLnsVvpITaWeCl2Z0l4kA== X-Google-Smtp-Source: APXvYqzXI9BT9DYewdV9MIpQXcnWKrgniqVFf9aXwDrUA4biEliyARzZMMrIX6SmaCrZmiuanQetqw== X-Received: by 2002:adf:e585:: with SMTP id l5mr520037wrm.156.1572450552307; Wed, 30 Oct 2019 08:49:12 -0700 (PDT) Received: from 6wind.com (2a01cb0c0005a6000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:5:a600:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id f204sm408629wmf.32.2019.10.30.08.49.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Oct 2019 08:49:11 -0700 (PDT) Date: Wed, 30 Oct 2019 16:49:10 +0100 From: Olivier Matz To: Andrew Rybchenko Cc: Slava Ovsiienko , Thomas Monjalon , "dev@dpdk.org" , Matan Azrad , Ori Kam , Yongseok Koh Message-ID: <20191030154910.d4lcerz3hpbvj6le@platinum> References: <1571922495-4588-1-git-send-email-viacheslavo@mellanox.com> <1572201636-16374-1-git-send-email-viacheslavo@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Subject: Re: [dpdk-dev] [PATCH v4] ethdev: extend flow metadata 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" Hi, On Wed, Oct 30, 2019 at 10:35:16AM +0300, Andrew Rybchenko wrote: > @Olivier, please, take a look at the end of the mail. > (...) > On 10/29/19 8:19 PM, Slava Ovsiienko wrote: > > > > +}; > > > > + > > > > +/* Mbuf dynamic field offset for metadata. */ extern int > > > > +rte_flow_dynf_metadata_offs; > > > > + > > > > +/* Mbuf dynamic field flag mask for metadata. */ extern uint64_t > > > > +rte_flow_dynf_metadata_mask; > > > These two global variables look frightening to me. > > > It does not look good to me. > > For me too. But we need the performance, these ones are > > intended for usage in datapath, any overhead is painful. > > @Olivier, could you share your thoughts, please. Having a global variable looks unavoidable to me, if we want performance. An alternative can be to use static global variables in every file that use this dynamic field, and call the register method from it. But I don't think it would scale if a dynamic field is widely used. Why does it look frigthening to you? The constraint is that before using this variable, the register function has to be called. I don't think there are race conditions, because the field/flag registration is lock protected and always return the same value.