From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id 504992C02 for ; Thu, 8 Jun 2017 01:57:31 +0200 (CEST) Received: by mail-wm0-f54.google.com with SMTP id 7so127764934wmo.1 for ; Wed, 07 Jun 2017 16:57:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=pm8/VYjV5AfBOMuuDxobmdNwK6pGKtPE3NHJQegU1kQ=; b=RhW7HKKr2U40zgyG9D3PcNdwL38ER3lMF+0KElZF8tRKwPzlk9uq6+jU0NOlr83AeK PqTtG8Mu7mVbg208VTIgS5Q8aA4VhlfCydt7fDUD1Dl4iaQY02b9DKnb12q8tgL4RvkY y6xZOVhCqKFeJvuqLZt2wLoshPQcwWxroGaZqP343fkzpZ4ElB8i10VK0l0zWVorB/5x EfcOEhL/NFBTkcZ1ClWmf09UzmMLTLT7r5AtFQw0XdLTsx+cJDpcYC2+EhutxWqUi4P7 NBWiehuBmIvhb51EdEk6oY/mVsgh+MHzxCzYi9m+ECoMSf2mjBLb0ToMvNisSqDxTGVP wOlg== 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:in-reply-to:references; bh=pm8/VYjV5AfBOMuuDxobmdNwK6pGKtPE3NHJQegU1kQ=; b=JXuOlE8WK+ZMf1joT9UHwXUwLV5A0++yjJmoIwt1QXZ8u3wnqgAYNnZgC9Ipqcxcof HwW5VJfHfsrjkhqWQLiqP2+BtMUmBfMJvz1tQvA5cMcMLofo8aah9U501y2TA2STCVsl oaQre+hboRAzW+wTUHwr3TbRt2Tw5CAV1Ucu3Vvt8w3mUuH6EVjl4xgI8jN6Kp8o0ruX xLtA2FuWlwyqodxAse0a3MKRRjoqWn9iU0cvoeoz6lv1OQMCCziFJeHj16dnulRywn2V EwtxNe3c+sJ8QhkLKFqLSaxJICirnxR/yuT954Q6zObKdx2spGVNKuHWkmY2WiqLSpr7 iusA== X-Gm-Message-State: AODbwcBDGcJftTZr+o03LigibRVlCXsn9VL8Fj3HH6zqdvY2ydsH0M/t 2kTbdHbjd5KpcnJINvU= X-Received: by 10.28.100.68 with SMTP id y65mr1421281wmb.40.1496879850705; Wed, 07 Jun 2017 16:57:30 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 185sm22397056wmp.1.2017.06.07.16.57.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jun 2017 16:57:29 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 8 Jun 2017 01:56:56 +0200 Message-Id: <1875dd45ea6c0637c0159ccf2953b73c4e453e0a.1496876859.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v4 10/19] bus: introduce bus scan policies 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: , X-List-Received-Date: Wed, 07 Jun 2017 23:57:31 -0000 Scan policies describe the way a bus should scan the system to search for possible devices. Three flags are introduced: RTE_BUS_SCAN_UNDEFINED: Configuration is irrelevant for this bus RTE_BUS_SCAN_WHITELIST: Scanning should be limited to declared devices RTE_BUS_SCAN_BLACKLIST: Scanning should exclude only declared devices Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/include/rte_bus.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h index 4bed780..fd94755 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h @@ -137,6 +137,22 @@ typedef int (*rte_bus_unplug_t)(struct rte_device *dev); typedef int (*rte_bus_parse_t)(const char *name, void *addr); /** + * Bus scan policies + */ +enum rte_bus_scan_mode { + RTE_BUS_SCAN_UNDEFINED, + RTE_BUS_SCAN_WHITELIST, + RTE_BUS_SCAN_BLACKLIST, +}; + +/** + * A structure used to configure bus operations. + */ +struct rte_bus_conf { + enum rte_bus_scan_mode scan_mode; /**< Scan policy. */ +}; + +/** * A structure describing a generic bus. */ struct rte_bus { @@ -148,6 +164,7 @@ struct rte_bus { rte_bus_plug_t plug; /**< Probe single device for drivers */ rte_bus_unplug_t unplug; /**< Remove single device from driver */ rte_bus_parse_t parse; /**< Parse a device name */ + struct rte_bus_conf conf; /**< Bus configuration */ }; /** -- 2.1.4