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 6CDEAA046B for ; Fri, 28 Jun 2019 15:34:24 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E606F4CAF; Fri, 28 Jun 2019 15:34:23 +0200 (CEST) Received: from mail-vs1-f65.google.com (mail-vs1-f65.google.com [209.85.217.65]) by dpdk.org (Postfix) with ESMTP id EC09137A2 for ; Fri, 28 Jun 2019 15:34:21 +0200 (CEST) Received: by mail-vs1-f65.google.com with SMTP id v129so4010592vsb.11 for ; Fri, 28 Jun 2019 06:34:21 -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=6s3tHGJXT9NFjUPogxpmJMVTg8fmD9i5JuItZVD9BHE=; b=tOT/9DlyDLsqg7GBosMyAwFh2wOyk+70KWfOLZ+IVsN0aEQE67jllgmY19YD+olQ7H dWYg5Yvfc5+HK8WJPOYS069xicQZtPUkVEXKNlOdjLogzgnnyN4daTlpaCjKQKilR4Ha NYaGIROXo9xRx/3nqGFQpXJ3nprqb3SxMlWcAge6VAdSywVOGFbH95urm8Oe+tR0jN6B UWNTnkdLe10qKlsXR5evEzdlHXfsXjZNbylR7zFLtF6Wb7yOv2EphIt5DqVZiz3rgiXQ EsaNwBujswbcvlgpKbLzQE8eqwAtiYJ8Os9CK1hfQHJo+uirpSSkZ5og6nA4yj8xXACr dWxg== X-Gm-Message-State: APjAAAUnoJ8xVO0lqYThIDFCs7Modxf0WtbDKegJVsIvPI78qehgrubZ wCAbjlupD4YuUi/lZzzr1JBk08OAOArSsRc6mn0iZea3 X-Google-Smtp-Source: APXvYqzd+f1v+1HDzGCm2hBwuJc7rkivHt13hC82Mrm9AD94CzXdM/bh3PgqUcG7Y4b1kGS/3RYtPYYoesSqCMs8cAI= X-Received: by 2002:a67:f998:: with SMTP id b24mr6349445vsq.180.1561728861309; Fri, 28 Jun 2019 06:34:21 -0700 (PDT) MIME-Version: 1.0 References: <20190529154132.49955-1-bruce.richardson@intel.com> <20190529154132.49955-4-bruce.richardson@intel.com> <20190628124035.GA347@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20190628124035.GA347@bricha3-MOBL.ger.corp.intel.com> From: David Marchand Date: Fri, 28 Jun 2019 15:34:10 +0200 Message-ID: To: Bruce Richardson Cc: dev Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH 3/4] eal: allow checking CPU flags by name 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 Fri, Jun 28, 2019 at 2:40 PM Bruce Richardson wrote: > On Thu, Jun 27, 2019 at 03:22:14PM +0200, David Marchand wrote: > > On Wed, May 29, 2019 at 5:42 PM Bruce Richardson > > <[1]bruce.richardson@intel.com> wrote: > > > > Rather than using enum values for CPU flags, which means the symbols > > don't > > exist on other architectures, provide a flag lookup by name, > > allowing us to > > unconditionally check for a CPU flag. > > > > Did you consider passing a string for the CPU architecture rather than > > an enum? > > It would have to be compared to RTE_ARCH in > > rte_cpu_get_flagname_enabled. > > Or to accomodate with x86_64/i686, this could be a cpu arch family. > > This avoids adding a new C type that seems quite limited wrt its uses. > > -- > > David Marchand > > > > I'm not sure I really see the value in having string names for the > architecture values, I think it would be a lot more clunky to manage rather > than having an enum value. The key difference vs the flags is that the > flags are only valid per-architecture while the architecture defines can be > globally valid, and secondly there is a finite, and small, number of > architectures compared to the number of flags supported. > > If you feel strongly about it I can investigate it, but I'm not sure I see > the value in doing so right now if the only benefit is avoiding the enum. > I suppose we won't have too much trouble handling ABI breakage (thinking about when we will remove x86 support). Ok, let's go with this. -- David Marchand