From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) by dpdk.org (Postfix) with ESMTP id 8D9C9915D for ; Wed, 24 May 2017 18:17:09 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id d127so73328693wmf.0 for ; Wed, 24 May 2017 09:17:09 -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=F6/Ntb0P1AxUl1SjkW9XyV2I+LxzwOzeNDW3n5p0n3IxuSraB6EF9P5LPutI8cVlu+ GQ+TJe5Oq3A1It21/bkd5eTlknOzEgB7SGAD1pCTYuP11YhRijQa8H0rE2cDyWI6mYJN qR/tNP1ss6QZp5Fj7uQS096Io0WBjH7ZVoW/D1ccZOJY9USn+gdXk/shbThplswLJILf umrDUUoe4jCzWhAd6i5UGe6EQGcXvgcaz4kWmuLqIMz3fQuh53vF5fyNvb9WuWfYS6Vm 0DPs9wlK0O2HAMV0V+5BEZCrYlYML/26tRrNvECjGBHQCsIqeIYbvB11uKffx9sxUsgo OM2w== 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=Y5PSFxCYMgZeDf+oqsnPJTtgEVyKxymj/PfRMdO9Xu7A0r9vCw07WheG26MFQtE5Ys yy4/dtwTvkpywr5R5teY3YsoPQ+QN6bDooPonwOUDwiZKtEvDWWIuzeEU4Pxw3cEXGoV FCAGAYnZwUKt5ZHMPDJOTzUUtFfeRCryJIK5j4L4CHYlqi2pp9bR3bDohPgP/0d7Wi9s z3ZEwsWtk6We+Gs3c/ynhQVY+kK4cqU9lRvXmGzRlJvHqDkN20nt8VkwJaiT+nPoTESu gbFGh6W0mIJJ5tFEu90MIL/mxPqqi95tEIiQ239bzcrNasREgUfUct9v6Okutjd8aZQV FTaQ== X-Gm-Message-State: AODbwcDPywb5h+JSNGlDL3RwkVFrf8n3p0J7DsdDqJ5ULmaRVBUfaHoS bRR4qbusZH7eLQqSjYM= X-Received: by 10.28.184.85 with SMTP id i82mr6472374wmf.64.1495642629023; Wed, 24 May 2017 09:17:09 -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 17sm5816909wml.32.2017.05.24.09.17.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 24 May 2017 09:17:08 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Wed, 24 May 2017 18:16:44 +0200 Message-Id: <20c15d2d9705f45a2bb2abbd0c07e1478811777a.1495642399.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 v2 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: Wed, 24 May 2017 16:17:10 -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 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