From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f47.google.com (mail-wm0-f47.google.com [74.125.82.47]) by dpdk.org (Postfix) with ESMTP id ED5637D18 for ; Thu, 1 Jun 2017 12:10:49 +0200 (CEST) Received: by mail-wm0-f47.google.com with SMTP id n195so25254700wmg.1 for ; Thu, 01 Jun 2017 03:10:49 -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=ZYyqxvisBFH3x9xbrf2W122IVr1IFL/yRNAfmB3VmjE=; b=TR7YA7Cq2iQOjX5WslgPIT7EdAoM0k8JC5sNCUqQ4NJfVE2krIeH3iNHHnv6Q8N+PI rT+solApaNB7X+RbYs6cG5m8R6Mz6wEibSX9SnHrwoHvZFcwRthdQNz1Q/Ub3e51nglt HXKDLRpsjJwIqlF/fY1FA8UQMait6hwvf0w3ywffaXRmsPa5fLfZhx2q7KwVHE+tGPW5 i7G4t6U/SeM7NkytYsI+m/po5STji+iOyMWzgzg36djk5bPrsiB2sZjy9mWkPc+78iH9 foLg7vHfis/wgXJAMPj1RmE5JigCE9CqHu9pS5Osid4z0+Imxp19/CZFJ+OMoi5oQBGd Xo7A== 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=ZYyqxvisBFH3x9xbrf2W122IVr1IFL/yRNAfmB3VmjE=; b=EbDGxTwiL6D3pU54Z9boOde7e7cOLHTgdH0x/mWrEMouvIuzXDv6OuzfuFqDOIQgWy u9/payEZaOSTdxsBqZaXOKMNqvnRHiGO0Ri27xElpUSG10G0Y+7jl5MtWxoQISpI7zS2 mywX1XPz5HMXk/Y/DzIRg2lUSh1oHY1lfTdU3I1j6y/+YiCyttQcnp83WQhXBJEZt0+d q3veVNo3oe2fdi1EiYuwNfVwXmiErZKDLFu+M1VQAbh+31cSEVXIki05+YnhSUzx4nya n33l+cIhmmm/byzc53+W0YFd4vJ8jDUK+YKia+J0jZ6SbxSLaWNhpcg6C6faKyW/IVo9 0gZQ== X-Gm-Message-State: AODbwcCwlbJISAejlg9cOy12NRaX+MadZA07sTqfAnzqZDfEXllA65jG /Y3ui2FktBXxrPp9J0Q= X-Received: by 10.223.136.48 with SMTP id d45mr664002wrd.160.1496311849359; Thu, 01 Jun 2017 03:10:49 -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 y19sm1022569wmh.21.2017.06.01.03.10.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 01 Jun 2017 03:10:48 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 1 Jun 2017 12:10:24 +0200 Message-Id: <4c3b5fb862d1f12267e7817495cec04460b03f49.1496309846.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 v3 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: , X-List-Received-Date: Thu, 01 Jun 2017 10:10:51 -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 4489d1d..b5d7a88 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h @@ -126,6 +126,22 @@ typedef int (*rte_bus_unplug_t)(struct rte_devargs *da); 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 { @@ -137,6 +153,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