From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f174.google.com (mail-wr0-f174.google.com [209.85.128.174]) by dpdk.org (Postfix) with ESMTP id E895837B7 for ; Wed, 21 Jun 2017 01:36:17 +0200 (CEST) Received: by mail-wr0-f174.google.com with SMTP id 77so111602731wrb.1 for ; Tue, 20 Jun 2017 16:36:17 -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=ucQdwwMX1VwjP04MwXZWbPc+wUoBE6mXak9P7nRFsT0=; b=i9ZJWtdbwnG2d0EbWRhbkW4fJ5OjcevqXyEI/QWonyXV93BuyE4KHZhfXt5cmPO0T2 BcJH+uCeJHBNOS3+3r7ZMWXhhrudNhUhm2O4iVSeKWkpWjVdRHijehRgID7UPLFPknar kkTe9WV29AYi7ssLLp1wMvYyllTp0FKpweBkR932lqjiJZkIXGHCxLUQqwNxiyny0F0O PSs7H+aYePEoTS0kUvoF9Xv/RSoKycj4x07yHyYX3vVemSet+L8IiU5j9ngP7CE/GyuI ky8JAnX1HxghbMQiTW2qETxEFkII5ei9lHyZ+3rfrmHkSJuvXtSZgA+rAbfD6z841pc0 PZPg== 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=ucQdwwMX1VwjP04MwXZWbPc+wUoBE6mXak9P7nRFsT0=; b=ZJAxta81BZ+tTLuVk5ynX7Xw+9O96ShARxy802AiKiTl26rYj0qi9q+oH7VrrugMDU 49LeviBVxwR9HrsyB2F4NwJrcXv0qtB3Em1QiewE3reMHJ3NNZcWqVd3Uka+UVv4URPf BkAFSCWe2JQNvBADiYmn0b5o47jYeqZThNLdM+fF+CAvchIsktaoLHC7+F2audECoCvp I0uxQJvtGeS8fAPkXtft1snL1QXHFyvIeTCJn9JLDzLfgIYXJDTa27IVIVNZSx/YNrMX wth2BmEIgZRGcJrEK2VXlrMb7MagF2u9YCPCfdajFHlydwHFoAWbBpMPdXFQEipilgPo hQlA== X-Gm-Message-State: AKS2vOy+c3LW1fn89C7cMLwpVbgZBEauQ1CAkQa/rCjTtq4aaoIxpXYy RnjjQxqtf7GRjj3AlN0= X-Received: by 10.223.139.211 with SMTP id w19mr6516969wra.146.1498001777277; Tue, 20 Jun 2017 16:36:17 -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 f45sm6463684wrf.2.2017.06.20.16.36.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 20 Jun 2017 16:36:16 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 21 Jun 2017 01:35:44 +0200 Message-Id: <7052a1a87238f7a1f184b4a853c4fb73c564d3ab.1498001626.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 v5 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: Tue, 20 Jun 2017 23:36:19 -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 61d9e6e..793a625 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