From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gaetan Rivet Subject: [PATCH 2/6] devargs: introduce foreach macro Date: Fri, 25 Aug 2017 18:07:22 +0200 Message-ID: <5376c9d91c1363356861db19ccb2dc6e7458d5d6.1503676587.git.gaetan.rivet@6wind.com> References: Cc: Gaetan Rivet To: dev@dpdk.org Return-path: Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) by dpdk.org (Postfix) with ESMTP id 408FC7D5A for ; Fri, 25 Aug 2017 18:08:25 +0200 (CEST) Received: by mail-wr0-f180.google.com with SMTP id a47so694304wra.4 for ; Fri, 25 Aug 2017 09:08:25 -0700 (PDT) In-Reply-To: In-Reply-To: References: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Introduce new rte_devargs accessor allowing to iterate over all rte_devargs pertaining to a bus. Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/include/rte_devargs.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index 226a082..5ca5a32 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -233,6 +233,15 @@ void rte_eal_devargs_dump(FILE *f); struct rte_devargs * rte_eal_devargs_next(const char *busname, const struct rte_devargs *start); +/** + * Iterate over all rte_devargs for a specific bus. + */ +#define RTE_EAL_DEVARGS_FOREACH(busname, da) \ + for (da = rte_eal_devargs_next(busname, NULL); \ + da != NULL; \ + da = rte_eal_devargs_next(busname, da)) \ + + #ifdef __cplusplus } #endif -- 2.1.4