From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f175.google.com (mail-wr0-f175.google.com [209.85.128.175]) by dpdk.org (Postfix) with ESMTP id 38CFC7CBE for ; Fri, 7 Jul 2017 02:04:59 +0200 (CEST) Received: by mail-wr0-f175.google.com with SMTP id c11so24182511wrc.3 for ; Thu, 06 Jul 2017 17:04:59 -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=S4sTNJFJB944G0Sqhzzwq+f3AIvwf4wKdw/NBQRXMAlCDG7+dWlJoj/kkzFUP8DVXr PjgYzS9YlqBUrpa8+ezXShob1TJbTVDyvHMo4jVNyyTjg5H2wqxzDA71wYv5C/iLA9Hs rgPFGkT7diBc9fVLXV91HVuv47uJ/DiVjmZ59PcNuNaihWJMyMsf1k4fz6KpJ79L0IKz rucGrk+XKORcMBrRs9dQFrsedJJjZ/kZCtDToCZzk8uMhqGEwbV0u0taPxaMHHfNXVuA kRQ2TdruLdqGwE0nIpV1CgG+i08BrCVb4raAWmrzaI3AW8Kdp/gI5/h9cNzqdVAed2Vc x0yg== 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=O8ldmuo2uJxZyYyhctfxhL6H9CbQtIETz1Mn1cK7ira5pLGlUOgf3vVfyjEYI1B2g9 2Y5NZm5bTvb/GfDCr1Fco95z4yZPiW7QksrGgVQ38zpqLwKuB/LeGjxlmriDa3il4RuY kqwUeNgl/Ad+gQ4IsEtXlo+ejn0L2+wysXhaw5/ip9hsxJ0skQdjyQKyyUYfQNGMYBRN jnNVAnmoU6Y7AaUTm+eDyPO5A8L/IuAdQNk+Dfd9EeNygJZpP1ZAdIwzkiSv9PPBk9z3 IIDv+vVwYIcYVs2/t99r7OhxeC3ewLA3eVYOW3/oyqPwfvuRRddiRM4OlC+dT2OOxEdc HVkw== X-Gm-Message-State: AIVw111xXnQ1o+ZVcdsbu1HTGPHlNB/GNAc/HZoF7Aaqu9M/adWlvABD 7Hd6XPR7bFfO0awsX6o= X-Received: by 10.28.130.196 with SMTP id e187mr272904wmd.24.1499385898657; Thu, 06 Jul 2017 17:04:58 -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 b197sm1111520wmb.4.2017.07.06.17.04.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 06 Jul 2017 17:04:57 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 7 Jul 2017 02:04:28 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v7 11/17] 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: Fri, 07 Jul 2017 00:04:59 -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 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 */ }; /** -- 2.1.4