From mboxrd@z Thu Jan 1 00:00:00 1970 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) 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=WIX52jZyvMCElrrrRfgMs1wu45ISrAmE346PL26gOiE=; b=Z5CyudcWW2/36I/kLpJqkW9xKdaOq+EUGazq1fIH0Um4VV2xMQy9pDNkCIXem4S9VI pYT22MSqTrvo2nUHewY1N5y09MwjgfS3YNtUzvpK3cxx/vOy4ftvUAcOyjUBEEUq7x5n a1WPfSazNDMM6XSKR3mBAKjNbgvsNymzLlnPaH6xZXA3n/6gWcW1J+jeYV+pNJvV6dnj V0aEpU0IizW/2O4Oaf4ZeqCWxBjUM/k8Riyb2f5c6oclchdIbte/dQK4Zag9bfejrnpw 3YUA5gfopSaBXPMeccLGnt+Z+G5qrtZw5YJtODdInm7zx7tdhGrwK+zaj6IFfeGAezrH O78A== 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=WIX52jZyvMCElrrrRfgMs1wu45ISrAmE346PL26gOiE=; b=MEoFgkRoTvICY5ViFU7HbKF/unGYa5hm6D4+bm2tMvbfNvag52gH6C21rxcbY9m/rx h0DWryJrE7ec2+TiCJt6BQFFTAqsSYMD18/Hi2xwlQiI1TLXYAvtSqALQE67WtEPwpLT IUOeVqPrBLhZpBIGvDP2Z8wa59d/vE5SCU9jQoM+kWCC3SxrWmO7Zi6Fk+79swZj/zIE iZbLyX3KYEj65CZiNxv9vnEuDR5W5Kf/I5z7bJtNUe9WxQKFRK5N3oc5XpJiXAb95R25 YLxkzZLZa/G7sQ0RqDlVJjZkcChkOpUxBqq0RCTxXneK4hZbbyqvyPAT//KgT5SGiXuO w5Bg== X-Gm-Message-State: AHYfb5jMFFVIEGjPwYxPJKunGhFf5kUqek6izlctl8Ae27edopMsk1Fw pQ9oaORlhe23tbYnMgc= X-Received: by 10.223.154.71 with SMTP id z65mr6047571wrb.218.1503677304574; Fri, 25 Aug 2017 09:08:24 -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 h190sm1351661wmd.4.2017.08.25.09.08.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Aug 2017 09:08:23 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Fri, 25 Aug 2017 18:07:22 +0200 Message-Id: <5376c9d91c1363356861db19ccb2dc6e7458d5d6.1503676587.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 2/6] devargs: introduce foreach macro 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, 25 Aug 2017 16:08:25 -0000 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