From patchwork Tue Jul 4 23:56:40 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: 26463 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 8AE0E7CEC; Wed, 5 Jul 2017 01:57:26 +0200 (CEST) Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by dpdk.org (Postfix) with ESMTP id F19A27CBE for ; Wed, 5 Jul 2017 01:57:15 +0200 (CEST) Received: by mail-wr0-f172.google.com with SMTP id r103so255217701wrb.0 for ; Tue, 04 Jul 2017 16:57:15 -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=sSAXrLcm8mNwATNGT4umNa0nN/5O6NaKDx4yYcs3DFA=; b=gW7I/0xtaQnha9lckJc+OPxopxPBT+6rNYliTk4NwMP9UI+Z/bxcJR0LnsuAQrgHHd wHBlbn6dVxLP9XwM0O1oSTsV62e2VXvQW2bMupVxdU6IxY4XneryzSB56MN0khHMdWN7 nxg9yestx7CzzGfL2Xjdn6uiSE8r8modB2hJNM0YcioQAdW58KMS2pZK5Cr3/KvDlKjb nJdCAvEkpviGqUTATRM/GBNa6tD7LQeuoDS/4JCTcscYRHtH/TezyONgnjIjx2+cY590 IjBlo+MLH0UOerR5M8yILVSeEKa1RZcFH4SeJ/AtM69GwWVIlpzaPyAz6m7kMrOg1Smv Bw/w== 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=sSAXrLcm8mNwATNGT4umNa0nN/5O6NaKDx4yYcs3DFA=; b=hx0gXBPTnpUYEp1O7+LVJolZstqnjHmkh2i0QyrJARzb7pq3dHXJcfGt/bf1owazmc JK3S160CmE+IcZjLonGllPE4P6b60Q31zxV+wi1dHy72qYrKAYsMZq8YUFsLT/Qxw6eq LHb1d6TuEuxqOzc0nEii3mdBGzsZt7sTWYgAgvuwn7YgSjWY0nTE2DT6kRZRByqtcrX5 JAtfwDk3CjrQqCxRqwpP9wDQYEgajCPksxl1YUtZr3rU1CocV5QSpB/6DErEXYQydfvZ sgFncgICBLkrHYQ2LB4Le1/LB+ugqi3Qs/00w7to5I7f2UDFOTnYVJzbXS3+5WUwZYIf 2qUg== X-Gm-Message-State: AKS2vOwqxSMTBaWX7Aj4C+vdzn2bquYKadJmDKd3KI3UZ7YhlbCkKfpI wLYjQRlzYO0X7sCqr7c= X-Received: by 10.223.148.226 with SMTP id 89mr38597905wrr.169.1499212635181; Tue, 04 Jul 2017 16:57:15 -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 w197sm27273899wme.20.2017.07.04.16.57.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Jul 2017 16:57:14 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 5 Jul 2017 01:56:40 +0200 Message-Id: <72304cacfa8361f07837b3ec808bea26ed11243e.1499211959.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 v6 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: , 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 aebf57e..37cc230 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h @@ -158,6 +158,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 { @@ -169,6 +185,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 */ }; /**