From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gaetan.rivet@6wind.com>
Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com
 [209.85.128.180]) by dpdk.org (Postfix) with ESMTP id F23187D43
 for <dev@dpdk.org>; Wed, 24 May 2017 17:15:19 +0200 (CEST)
Received: by mail-wr0-f180.google.com with SMTP id w50so57005438wrc.0
 for <dev@dpdk.org>; Wed, 24 May 2017 08:15:19 -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=YcBh2jx3gB2FDhX0dffsJgakZF6RwEYNEs6WHIs3pcI=;
 b=VZ5IQAcI/LtqSihKxkFFld53F4aU+U9lnPY6ZeyPF2+/xwhXyZxVr1gT8Kg+6qkUGS
 p/DUvJ5MQ8KEXfK5/Xh65FmIuJ8hvaDMN/+gK5yKM6ROiL9FA+g/FrRdi3wyNT4oHO+S
 TK7dY+OrfE49/sD+U5VmODNGcl1fzUOi84lLqOWy37ABYg0KIPmvuEKcD92mopQDOGeU
 9+mV3FQet9rA8MkbRS+zzRXtC/Dej9eCZVzqXjxRhYxXBTF1/M0dpPgT4HuxBtXv0/qE
 IG3alF4QKeYoIwH7Ac91Nwv9aA3NvuKKb0dcikuxsuNT/h3wls4uXb7w+O6vr7R6Gm6S
 Klxw==
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=YcBh2jx3gB2FDhX0dffsJgakZF6RwEYNEs6WHIs3pcI=;
 b=jase1aUfBGC3+t4mEKYklJFXtKAdmzQ6uOCpyDbRU73+QkRdFauYr/yjXBdakOUkIE
 eKvrQBi73v7gPBNmlmET029gQqwAY2GLnsXpCGKErj61RTIoXNMSuLMgJxSgW2k7bAxp
 inOxeqyxiLERQaXhGzc++RyPiNVVApjfVVesIUdJiqH56rrPTf/t/i8szTsriPpl/VZ5
 4/gj1+nwNNhL7/zebdhJa++milcJQ1wdfDmsVM7MaUgwmAGUapqGMw+i3y84MflB31vx
 5/rm7XbUit0+tfFyW5JU2dX24GN9oaUwji/ZLxe9LAGTi0Vyt5zBkrr7bH5zAhuG6RYn
 tuZQ==
X-Gm-Message-State: AODbwcCEnHnCnzuxlA67TKoeJRrQkGRkjCIPp+f9NfuBlAs6KCJbsH72
 IhGc+8kupAYEdbchHi8=
X-Received: by 10.223.135.84 with SMTP id 20mr22991780wrz.141.1495638919135;
 Wed, 24 May 2017 08:15:19 -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 a136sm4466145wme.26.2017.05.24.08.15.17
 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Wed, 24 May 2017 08:15:18 -0700 (PDT)
From: Gaetan Rivet <gaetan.rivet@6wind.com>
To: dev@dpdk.org
Cc: Gaetan Rivet <gaetan.rivet@6wind.com>, Jan Blunck <jblunck@infradead.org>,
 Stephen Hemminger <stephen@networkplumber.org>,
 Maxime Coquelin <maxime.coquelin@redhat.com>,
 Jerin Jacob <jerin.jacob@caviumnetworks.com>,
 David Marchand <david.marchand@6wind.com>
Date: Wed, 24 May 2017 17:14:53 +0200
Message-Id: <b3a9615d5c2dea137bd5b3bf4164c2280168e9e4.1495629181.git.gaetan.rivet@6wind.com>
X-Mailer: git-send-email 2.1.4
In-Reply-To: <cover.1495629181.git.gaetan.rivet@6wind.com>
References: <cover.1495629181.git.gaetan.rivet@6wind.com>
In-Reply-To: <cover.1495629181.git.gaetan.rivet@6wind.com>
References: <cover.1495629181.git.gaetan.rivet@6wind.com>
Subject: [dpdk-dev] [PATCH 09/14] bus: introduce bus scan policies
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Wed, 24 May 2017 15:15:20 -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 <gaetan.rivet@6wind.com>
---
 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 0b48e66..fa08454 100644
--- a/lib/librte_eal/common/include/rte_bus.h
+++ b/lib/librte_eal/common/include/rte_bus.h
@@ -123,6 +123,22 @@ typedef int (*rte_bus_detach_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 {
@@ -134,6 +150,7 @@ struct rte_bus {
 	rte_bus_attach_t attach;     /**< Probe single device for drivers */
 	rte_bus_detach_t detach;     /**< Remove single device from driver */
 	rte_bus_parse_t parse;       /**< Parse a device name */
+	struct rte_bus_conf conf;    /**< Bus configuration */
 };
 
 /**
-- 
2.1.4