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 91E0FA00C3; Sun, 7 Jun 2020 19:02:18 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 897DD1BFA6; Sun, 7 Jun 2020 19:01:45 +0200 (CEST) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 48ABE1BF95 for ; Sun, 7 Jun 2020 19:01:43 +0200 (CEST) Received: by mail-pg1-f196.google.com with SMTP id r18so1364299pgk.11 for ; Sun, 07 Jun 2020 10:01:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0FVrcDoJCCoBgIF6Ca54mVm+PuJ2Jii6BiSbv6sL1Ww=; b=pyVVaR+tNhi8BvTWAAi1ELybGsePHF/Iox+RgpmQOBfn5Jn7WaUjdx0hHxmTpCEUTY YHW4bjr+3ISvB99ixxfFKhivTeQte+Nmnf3hiZAKxHN9apkcusOz0inuN4Iiy7lph4wT GVNAzwBPXy5YHAdb+moxpGdOPFBqp1NsHhHYTmwIcuJHxupLjTN7HeEtk4FnuAe161g+ RT9aaf5Q+IzYyNdLPS8Wi0jj/qS111RcK5oz9uFefwneqi8QU7qPkBVAIChu7zjZawMA z2SVoIb/DOx8NrNqiwjmL2uaUeTm4gQgGoSWATkjCr93wowaZ+QMxB/N0n+eLTbeEUuc WO7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=0FVrcDoJCCoBgIF6Ca54mVm+PuJ2Jii6BiSbv6sL1Ww=; b=l1TJmhs4pb5yzTMa/bN7BD9xeF7NSE1j2G9jZjOd3Mgy5CvuWB+7Ep2cJg6IU9idnI B1QPVxCQRDNJrKGTskUSWVVlSJZXO5hxhChjON5onQojcbq1wEwqKU+q0LERYkyaWG2o eaihG0IVeTDKGAr5eq9EbZBWZZNZmgbsPqT6r86ZGlLuNYF0EKXJ+05cCiMN0dIN2QVy e+iN3QLjmN7HDrNfvvffNK9bEaEncQR6X9JPMliSNjTM25qfkDSIvsQmD5sX4MAxdEq3 2k45f12mo/l9azMKyISLqoPo5zxHZnABI9+7ExL1c1kTu+CE78u6y4cHHzo5yxX2J+Re QFPQ== X-Gm-Message-State: AOAM5310zVSZzMYfJe5Hr/OUUZNJq4IUeGPnwJB5d9QBClRA1dabwun2 YTUpU54dfO90Oy/4WoGGHt7FlAYloOU= X-Google-Smtp-Source: ABdhPJxnGmEL83gbb1zMF6YlFQVVk0UST/EWM/lAYZpsfq1z4WHldBTAAltBxpQ+NY1Ah+WC9yGmBw== X-Received: by 2002:a63:c407:: with SMTP id h7mr16886164pgd.174.1591549301985; Sun, 07 Jun 2020 10:01:41 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id y81sm4933458pfb.33.2020.06.07.10.01.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jun 2020 10:01:41 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Sun, 7 Jun 2020 10:01:22 -0700 Message-Id: <20200607170127.15694-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200607170127.15694-1-stephen@networkplumber.org> References: <20200607170127.15694-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 4/9] 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" 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 --- lib/librte_eal/common/eal_common_devargs.c | 14 +++++++------- lib/librte_eal/include/rte_bus.h | 12 ++++++++++-- lib/librte_eal/include/rte_dev.h | 12 ++++++++++-- lib/librte_eal/include/rte_devargs.h | 12 ++++++++++-- 4 files changed, 37 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..f5e09df267f2 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 a 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_BLOCKLIST_PCI) + devargs->policy = RTE_DEV_BLOCKLIST; 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_ALLOWLIST) + bus->conf.scan_mode = RTE_BUS_SCAN_ALLOWLIST; + else if (devargs->policy == RTE_DEV_BLOCKLIST) + 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..fcc18a118f44 100644 --- a/lib/librte_eal/include/rte_bus.h +++ b/lib/librte_eal/include/rte_bus.h @@ -215,10 +215,18 @@ 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, }; +#define RTE_BUS_SCAN_WHITELIST \ + _Pragma("GCC message \"RTE_BUS_SCAN_WHITELIST\" is deprecated\"") \ + RTE_BUS_SCAN_ALLOWLIST + +#define RTE_BUS_SCAN_BLACKLIST \ + _Pragma("GCC message \"RTE_BUS_SCAN_BLACKLIST\" is deprecated\"") \ + 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..e9184c4a98c1 100644 --- a/lib/librte_eal/include/rte_dev.h +++ b/lib/librte_eal/include/rte_dev.h @@ -70,10 +70,18 @@ enum rte_kernel_driver { * Device policies. */ enum rte_dev_policy { - RTE_DEV_WHITELISTED, - RTE_DEV_BLACKLISTED, + RTE_DEV_ALLOWLIST, + RTE_DEV_BLOCKLIST, }; +#define RTE_DEV_WHITELISTED \ + _Pragma("GCC message \"'RTE_DEV_WHITELISTED' is deprecated\"") \ + RTE_DEV_ALLOWLIST + +#define RTE_DEV_BLACKLISTED \ + _Pragma("GCC message \"'RTE_DEV_BLACKLISTED' is deprecated\"") \ + RTE_DEV_BLOCKLIST + /** * 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..a7c7e1e7962f 100644 --- a/lib/librte_eal/include/rte_devargs.h +++ b/lib/librte_eal/include/rte_devargs.h @@ -29,11 +29,19 @@ extern "C" { * Type of generic device */ enum rte_devtype { - RTE_DEVTYPE_WHITELISTED_PCI, - RTE_DEVTYPE_BLACKLISTED_PCI, + RTE_DEVTYPE_ALLOWLIST_PCI, + RTE_DEVTYPE_BLOCKLIST_PCI, RTE_DEVTYPE_VIRTUAL, }; +#define RTE_DEVTYPE_WHITELISTED_PCI \ + _Pragma("GCC message \"'RTE_DEVTYPE_WHITELISTED' is deprecated\"") \ + RTE_DEVTYPE_ALLOWLIST_PCI + +#define RTE_DEVTYPE_BLACKLISTED_PCI \ + _Pragma("GCC message \"'RTE_DEVTYPE_BLACKLISTED' is deprecated\"") \ + RTE_DEVTYPE_BLOCKLIST_PCI + /** * Structure that stores a device given by the user with its arguments * -- 2.26.2