From patchwork Thu Oct 12 08:21:11 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: 30196 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C90A21B1AA; Thu, 12 Oct 2017 10:21:51 +0200 (CEST) Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 0BA4D9B6B for ; Thu, 12 Oct 2017 10:21:46 +0200 (CEST) Received: by mail-wm0-f46.google.com with SMTP id m72so22899925wmc.0 for ; Thu, 12 Oct 2017 01:21:46 -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=LIIFxGwgJ4Rn1weIdsII3d7YdnfRiRsUBfecH2kPY5Q=; b=P+Dxh1+44d/kKeZksRqtXEBYnZ5VS6nhRyicvtOsxvesZTU9AtRY/TeTqutELqUWFr URj5VY/PbW8ba+Klf18QXbJZwrj0k84YapjUnr8X//nOKbUjiPS8lZrUbCLKMBRPszu4 VlVlbNIZNwu2YzzHqSsHrTXRL6I/M6CQszBrmJcGUhCveiqOkCmKQif0oQVTJsGELjET CITw7qe+wQvjw4DGpPKPcqja6GnBpz2JW5T/Rq7wUrgtkfIgGCTzqbGnu18/QfZ0ZZ3y uNP0L+er3p2O57tEZ7vrPR+8RjgYH+lyZWWkWdeTeuJyUTv02oMi1wth1T8sHO3YlCAG u7Ew== 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=LIIFxGwgJ4Rn1weIdsII3d7YdnfRiRsUBfecH2kPY5Q=; b=CMpUqkGqjJfF91+RnEKsX/20RsELciP5SU4ltKKaB9bTM7O15Jt3U04Kc9j/qvx/hn I6PdgWj8KTcrOgzli6QybZG6jLQsLRGQT1sdPf9meaMt+zBT9vaBMmfEOdp6VxKDP3PX fITi+4Kx8Gr4aT02kX7HcoxPoqrkvWahjT3vK+AB1eKeJDnJRCdr7LmRQO4juI/uOkPj Q8/KqpP/s0YjUahlKj6eNWh4qwFUAzSbzllwTSNDWo1Hs6ZwBEtyzxLQ9G67LerUKxVV /ThLHrbgRDoOZ0v81qY/M0bcJb5wr+Pgz/Vha7rGWe6323qpS7Bad2d/AeecSQpBhtpO rAdA== X-Gm-Message-State: AMCzsaWXEVH1nnGxN0/V6azYO0D/mw1k0oT9ov6NrBsQHigKJ++2+X11 LCUqflDCVLuSV4a7tAMH5b2tVyEr X-Google-Smtp-Source: AOwi7QC4WJ3PO4hk/KI6riwxY4o9CKJP+4vj3TwrdAyulPDnsQYbRrdT6rpA2wV4RiHTglcrBjeFPQ== X-Received: by 10.223.144.227 with SMTP id i90mr1536398wri.190.1507796505398; Thu, 12 Oct 2017 01:21:45 -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 200sm19424728wmu.44.2017.10.12.01.21.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 01:21:44 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 12 Oct 2017 10:21:11 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v2 04/18] 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: , 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h index 0eec406..6222677 100644 --- a/lib/librte_eal/common/include/rte_devargs.h +++ b/lib/librte_eal/common/include/rte_devargs.h @@ -206,6 +206,14 @@ 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