From patchwork Wed May 24 15:14:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ga=C3=ABtan_Rivet?= X-Patchwork-Id: 24516 Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 9CCFC7D2C; Wed, 24 May 2017 17:15:41 +0200 (CEST) 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 ; Wed, 24 May 2017 17:15:19 +0200 (CEST) Received: by mail-wr0-f180.google.com with SMTP id w50so57005438wrc.0 for ; 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 To: dev@dpdk.org Cc: Gaetan Rivet , Jan Blunck , Stephen Hemminger , Maxime Coquelin , Jerin Jacob , David Marchand Date: Wed, 24 May 2017 17:14:53 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 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 */ }; /**