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 1820DA00BE; Sat, 13 Jun 2020 02:01:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E65481BFE8; Sat, 13 Jun 2020 02:01:14 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 240901BFB1 for ; Sat, 13 Jun 2020 02:01:10 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id g12so4377692pll.10 for ; Fri, 12 Jun 2020 17:01:09 -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=VcQgf8LoJH+mKzvU2T4GC/bjMaBCsG8L3YYQ+G1DdYA=; b=zpia78K1tLoqTA8b1iNS9whgybQrK/T2krHEEhdzEzEmHPiaNjIx6jPS/DBZ35e9Zm Kt8bVBgwl2Y56kBqJlVZtwXLiiLRiuw4+8U2VHaBJqLfFlBJK5FlsF0VH05C2ZAo3eq1 Awnp79Q81e4wqYLeVzbL3Nne+NfN6jGqxOOoOtHY6y3ALtePo9c6e0j2ktDIyRt1TSz4 w64Cm3lQHe0CM1Xqk6UObaIDFs5BszS/9yrhB2Lc2zeGU0G+yLXZYMW65AHESVeyFkGH FSHJDfs5O14Gf3cKit75lnQoDKLXff+2d+PpZIao0EyNSZ/09gCUvbie6xpHCfNo9jXz U6ag== 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=VcQgf8LoJH+mKzvU2T4GC/bjMaBCsG8L3YYQ+G1DdYA=; b=Tt2NUkf7/2qmJMMMo6B+U4C4LIp6knLE0BBMhqv/21zeyIGEu44aM0dRBYbIQ2pMMJ xEc1i7I+/tWXbxbdqwsMZk8iBBWrGMl89smZRzyL+n8ZvNcw5ElWAw0AHrf9k48s/4wq /QNrqy9keKF7YedIL032i9RwMODNIuDVlYRqfoe7uJ578fNWP2R0NiVu9O5p7/Aa//ui 8c0VWjHhJXVE5xa5KPzw/eGhlqqdMzR/SVV02hXW53DcjGUKH4i4KqqYtaDnI6/Cc/+G c6OsEQbDvLFJQCgB7KnY5LEqmYxyRGORwdKKtGuxSkahnFH7odr9+bU7oYvXQ9IrKj8l 0Ybw== X-Gm-Message-State: AOAM530HIL2qjsy8gKP1RS0ldHZRApVmx2vwqZZG5ie9wwkfT7TDF9xe CIOto6QJ4rgWW01vLjWk3xTC2j2GOq4= X-Google-Smtp-Source: ABdhPJwmJRgopla7JwwTRcYdX982eUpwCyvyr0lN50gdw5YmJWsd1myqLZ04H4XYHb3+09YqzS9ekA== X-Received: by 2002:a17:90a:7643:: with SMTP id s3mr1283175pjl.183.1592006468655; Fri, 12 Jun 2020 17:01:08 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 6sm7205921pfi.170.2020.06.12.17.01.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2020 17:01:07 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Luca Boccassi , Gaetan Rivet Date: Fri, 12 Jun 2020 17:00:49 -0700 Message-Id: <20200613000055.7909-5-stephen@networkplumber.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200613000055.7909-1-stephen@networkplumber.org> References: <20200613000055.7909-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v3 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" This patch renames the enum values in the EAL include files. As a backward compatible temporary migration tool, define a replacement mapping for old values. The old names relating to blacklist and whitelist are replaced by block list and allow list, but applications may be using the older compatibility macros. To help with conversion to new names cause a message when the compatibility names are used. Signed-off-by: Stephen Hemminger Acked-by: Luca Boccassi 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 in allowed list 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..19309ad2ddd7 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 compatibility will be deprecated */ +#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