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 81703A00BE; Fri, 12 Jun 2020 11:28:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 6226C2A62; Fri, 12 Jun 2020 11:28:32 +0200 (CEST) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by dpdk.org (Postfix) with ESMTP id DB3C029CB for ; Fri, 12 Jun 2020 11:28:30 +0200 (CEST) Received: from u256.net (lfbn-idf2-1-566-132.w86-246.abo.wanadoo.fr [86.246.31.132]) (Authenticated sender: grive@u256.net) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 124A1240014; Fri, 12 Jun 2020 09:28:29 +0000 (UTC) Date: Fri, 12 Jun 2020 11:28:24 +0200 From: =?utf-8?Q?Ga=C3=ABtan?= Rivet To: Stephen Hemminger Cc: dev@dpdk.org Message-ID: <20200612092824.bs2wvcy5q7n7px6c@u256.net> References: <20200612002039.17450-1-stephen@networkplumber.org> <20200612002039.17450-5-stephen@networkplumber.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200612002039.17450-5-stephen@networkplumber.org> Subject: Re: [dpdk-dev] [PATCH v2 04/10] eal: replace usage of blacklist/whitelist in enum 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 11/06/20 17:20 -0700, Stephen Hemminger wrote: > The terms blacklist and whitelist are often seen as reminders > of the divisions in society. Instead, use more exact terms for > handling of which devices are used in DPDK. > > This patch renames the enum values in the EAL include files. > As a backward compatiable temporary migration tool, define > a replacement mapping for old values. > > The old names relating to blacklist and whitelist are replaced > by blocklist and allowlist, but applications may be using the > older compatiablity macros. To help with conversion to new names > cause a message when the compatabilty names are used. > > This will be upgraded to a warning in the future. > > Signed-off-by: Stephen Hemminger With the nit below, Acked-by: Gaetan Rivet > --- > lib/librte_eal/common/eal_common_devargs.c | 14 +++++++------- > lib/librte_eal/include/rte_bus.h | 8 ++++++-- > lib/librte_eal/include/rte_dev.h | 8 ++++++-- > lib/librte_eal/include/rte_devargs.h | 8 ++++++-- > 4 files changed, 25 insertions(+), 13 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c > index 2123773ef840..d0d58358fee1 100644 > --- a/lib/librte_eal/common/eal_common_devargs.c > +++ b/lib/librte_eal/common/eal_common_devargs.c > @@ -296,7 +296,7 @@ rte_devargs_insert(struct rte_devargs **da) > return 0; > } > > -/* store a whitelist parameter for later parsing */ > +/* store an allowlist parameter for later parsing */ > int > rte_devargs_add(enum rte_devtype devtype, const char *devargs_str) > { > @@ -313,13 +313,13 @@ rte_devargs_add(enum rte_devtype devtype, const char *devargs_str) > goto fail; > devargs->type = devtype; > bus = devargs->bus; > - if (devargs->type == RTE_DEVTYPE_BLACKLISTED_PCI) > - devargs->policy = RTE_DEV_BLACKLISTED; > + if (devargs->type == RTE_DEVTYPE_BLOCKED_PCI) > + devargs->policy = RTE_DEV_BLOCKED; > if (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) { > - if (devargs->policy == RTE_DEV_WHITELISTED) > - bus->conf.scan_mode = RTE_BUS_SCAN_WHITELIST; > - else if (devargs->policy == RTE_DEV_BLACKLISTED) > - bus->conf.scan_mode = RTE_BUS_SCAN_BLACKLIST; > + if (devargs->policy == RTE_DEV_ALLOWED) > + bus->conf.scan_mode = RTE_BUS_SCAN_ALLOWLIST; > + else if (devargs->policy == RTE_DEV_BLOCKED) > + bus->conf.scan_mode = RTE_BUS_SCAN_BLOCKLIST; > } > TAILQ_INSERT_TAIL(&devargs_list, devargs, next); > return 0; > diff --git a/lib/librte_eal/include/rte_bus.h b/lib/librte_eal/include/rte_bus.h > index d3034d0edf77..463f0224ff2b 100644 > --- a/lib/librte_eal/include/rte_bus.h > +++ b/lib/librte_eal/include/rte_bus.h > @@ -215,10 +215,14 @@ typedef int (*rte_bus_sigbus_handler_t)(const void *failure_addr); > */ > enum rte_bus_scan_mode { > RTE_BUS_SCAN_UNDEFINED, > - RTE_BUS_SCAN_WHITELIST, > - RTE_BUS_SCAN_BLACKLIST, > + RTE_BUS_SCAN_ALLOWLIST, > + RTE_BUS_SCAN_BLOCKLIST, > }; > > +/* Backwards compatiablity will be deprecated */ nit: typo in compatibility. > +#define RTE_BUS_SCAN_WHITELIST RTE_BUS_SCAN_ALLOWLIST > +#define RTE_BUS_SCAN_BLACKLIST RTE_BUS_SCAN_BLOCKLIST > + > /** > * A structure used to configure bus operations. > */ > diff --git a/lib/librte_eal/include/rte_dev.h b/lib/librte_eal/include/rte_dev.h > index c8d985fb5cf9..1208b1e99b05 100644 > --- a/lib/librte_eal/include/rte_dev.h > +++ b/lib/librte_eal/include/rte_dev.h > @@ -70,10 +70,14 @@ enum rte_kernel_driver { > * Device policies. > */ > enum rte_dev_policy { > - RTE_DEV_WHITELISTED, > - RTE_DEV_BLACKLISTED, > + RTE_DEV_ALLOWED, > + RTE_DEV_BLOCKED, > }; > > +/* Backwards compatiablity will be deprecated */ > +#define RTE_DEV_WHITELISTED RTE_DEV_ALLOWED > +#define RTE_DEV_BLACKLISTED RTE_DEV_BLOCKED > + > /** > * A generic memory resource representation. > */ > diff --git a/lib/librte_eal/include/rte_devargs.h b/lib/librte_eal/include/rte_devargs.h > index 898efa0d667b..e1a4277ff167 100644 > --- a/lib/librte_eal/include/rte_devargs.h > +++ b/lib/librte_eal/include/rte_devargs.h > @@ -29,11 +29,15 @@ extern "C" { > * Type of generic device > */ > enum rte_devtype { > - RTE_DEVTYPE_WHITELISTED_PCI, > - RTE_DEVTYPE_BLACKLISTED_PCI, > + RTE_DEVTYPE_ALLOWED_PCI, > + RTE_DEVTYPE_BLOCKED_PCI, > RTE_DEVTYPE_VIRTUAL, > }; > > +/* Backwards compatiablity will be removed later */ > +#define RTE_DEVTYPE_WHITELISTED_PCI RTE_DEVTYPE_ALLOWED_PCI > +#define RTE_DEVTYPE_BLACKLISTED_PCI RTE_DEVTYPE_BLOCKED_PCI > + > /** > * Structure that stores a device given by the user with its arguments > * > -- > 2.26.2 > -- Gaëtan