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 3D38EA0521; Thu, 5 Nov 2020 23:36:34 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2019629C6; Thu, 5 Nov 2020 23:36:16 +0100 (CET) Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by dpdk.org (Postfix) with ESMTP id 8E4FA137D for ; Thu, 5 Nov 2020 23:36:14 +0100 (CET) Received: by mail-pg1-f196.google.com with SMTP id 62so2344620pgg.12 for ; Thu, 05 Nov 2020 14:36:14 -0800 (PST) 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=zwXAYdSR0PegyLNlzdwjLJFaS4AjUpddhtWdSetsrtM=; b=W7jxLw4s+rYhlZf37sD47JqP5GcbCbMRpURB3zZnblYyc/2AGYjGACVwVXr823nfz5 S5dmjjq7p3TulKOqAivFnXU4OadMjpVQgMxokFh+E5kVEu+0YqRtIb6QMlIYI+0X03pj sxhykp1Pu1Ep4DMhitCYVCed364jLOHBT1awnPrT3KSC6Npx+vnWpp3+EO6r0fXKfHyi sL6X87vjyeFxaJqB8KR6NeLmHrnsr0gwVFDHYHpNpiErPWOtWiWUu8MXTe5FK5EI7tP9 ctNElDCT099Pc46uXvU3ud8mREoSy7yz3pzc8CkHDpveClzVQ6ykMcBppCz7AeSvLHC/ A81w== 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=zwXAYdSR0PegyLNlzdwjLJFaS4AjUpddhtWdSetsrtM=; b=BXNWfJgAHPaSIpb1OsZidvaA7Ye789wkx5ZticXBcshrJnyo6SEs5aOsvvd/X67n13 2fJtBBlEYc5s2sbXb8PpOn98mfkV4R4tqBZBty8iBnRJqChHYd7AyuipnFoA5sSxvLJi g4pKIX7yaWSc/qrSnjIl4iVqzn1JFS2i75bl+ugNNF78ElgIIqZ1yVlHTpetvCkaG0Td xIOiKH8SfQhA0/8V/oLyql7W/Q4talR7fSSujCbu3Fti6Vghh1z5e7jHwDPQariY0R15 9675y0//RL2tVdp3IXMhyil9j6N3SilFjwuObGCq2WZefNxZr7rFIB89tdOt33DUVZTi NByA== X-Gm-Message-State: AOAM530MaDSf+0Q0Nc6f2Idn6lYl29ucY1Jy4xp2XYD7QcjLOH2ur+ip hK+K2YM/w3Ii3Dd+mRyFDN1fSNbS1gOFyb+7 X-Google-Smtp-Source: ABdhPJyKSxzA9TNPRYCdHZyvbKqkGqowL3HsV5vzCNOkcdT+C1aMbgfxEuW7Vn2yWn3+eOu4RkCxqA== X-Received: by 2002:a63:3403:: with SMTP id b3mr4429935pga.391.1604615772101; Thu, 05 Nov 2020 14:36:12 -0800 (PST) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id u5sm1026756pgj.28.2020.11.05.14.36.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Nov 2020 14:36:10 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Luca Boccassi , Gaetan Rivet Date: Thu, 5 Nov 2020 14:35:57 -0800 Message-Id: <20201105223602.5965-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201105223602.5965-1-stephen@networkplumber.org> References: <20200922143202.8755-1-stephen@networkplumber.org> <20201105223602.5965-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v9 1/6] 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 | 10 ++++++++-- lib/librte_eal/include/rte_dev.h | 10 ++++++++-- lib/librte_eal/include/rte_devargs.h | 10 ++++++++-- 4 files changed, 31 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..fcf3d9a3ccb2 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) + 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..80b154fb982c 100644 --- a/lib/librte_eal/include/rte_bus.h +++ b/lib/librte_eal/include/rte_bus.h @@ -215,10 +215,16 @@ 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 removed */ +#define RTE_BUS_SCAN_WHITELIST \ + RTE_DEPRECATED(RTE_BUS_SCAN_WHITELIST) RTE_BUS_SCAN_ALLOWLIST +#define RTE_BUS_SCAN_BLACKLIST \ + RTE_DEPRECATED(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 81905b3ae35f..6dd72c11a14a 100644 --- a/lib/librte_eal/include/rte_dev.h +++ b/lib/librte_eal/include/rte_dev.h @@ -52,10 +52,16 @@ typedef void (*rte_dev_event_cb_fn)(const char *device_name, * Device policies. */ enum rte_dev_policy { - RTE_DEV_WHITELISTED, - RTE_DEV_BLACKLISTED, + RTE_DEV_ALLOWED, + RTE_DEV_BLOCKED, }; +/* Backwards compatibility will be removed */ +#define RTE_DEV_WHITELISTED \ + RTE_DEPRECATED(RTE_DEV_WHITELISTED) RTE_DEV_ALLOWED +#define RTE_DEV_BLACKLISTED \ + RTE_DEPRECATED(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..296f19324fae 100644 --- a/lib/librte_eal/include/rte_devargs.h +++ b/lib/librte_eal/include/rte_devargs.h @@ -29,11 +29,17 @@ extern "C" { * Type of generic device */ enum rte_devtype { - RTE_DEVTYPE_WHITELISTED_PCI, - RTE_DEVTYPE_BLACKLISTED_PCI, + RTE_DEVTYPE_ALLOWED, + RTE_DEVTYPE_BLOCKED, RTE_DEVTYPE_VIRTUAL, }; +/* Backwards compatibility will be removed later */ +#define RTE_DEVTYPE_WHITELISTED_PCI \ + RTE_DEPRECATED(RTE_DEVTYPE_WHITELISTED_PCI) RTE_DEVTYPE_ALLOWED +#define RTE_DEVTYPE_BLACKLISTED_PCI \ + RTE_DEPRECATED(RTE_DEVTYPE_BLACKLISTED_PCI) RTE_DEVTYPE_BLOCKED + /** * Structure that stores a device given by the user with its arguments * -- 2.27.0