From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id C8C541B53 for ; Wed, 31 May 2017 15:18:16 +0200 (CEST) Received: by mail-wm0-f53.google.com with SMTP id 7so118497251wmo.1 for ; Wed, 31 May 2017 06:18:16 -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=W04TeCJ6YupG1NgwWMlBbtg/agZEta1V9yzRf7K6/Mc=; b=Ly3ukvttXm4UwOuI8UsYszM4MKmleym/qba2SpBhMIDpj7LxgyU2G24ELFl9iL8PuF iH/lwbpiJeWPmYhjqPn/l2RLRYceXS8jSXyGSCMwFrDTgz3tzvENwNSY0t1LdFCbsQK2 2dz+jZT2tCApCLw9v0AIKPFmI/Wt8dmhoA8Bd393Vi4kgnNctG5J6uFWI+g5T6gc6RCt p42mFTVISFegqBydmak7qDvMLGTBSDbXa9LMXOkkzjU3OcprYE2gwSMHhDsaUUE59Inb DE6IcezuMZL5Mi7O1k3LRDPEMuSCDaOdsmNZmaQ9XfsGmMDsE1KCgDv7nbC28Mcqx/f+ Z+Tg== 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=W04TeCJ6YupG1NgwWMlBbtg/agZEta1V9yzRf7K6/Mc=; b=czja0s+OMqhJyy/FuYLR6x0ps0CiK0m5kV4VMqDzMm8wqP2+RQj/Cp/VKDKwW2hGku 17xVn+DjLiy22Sh1MQSDgmzweWy2H2II9LZYXuSyGOlR9CJQCno0JpCbjhQdZe7lkmUM lqo5qmBTpKom2aYz48nxrSfVCSZc0GrzNmQ7FSTRwPHL118VY7An3QzBbP8iH7964LtX JOOtW0nqBYcJl4Bi6gQSkF7GIxh/QRNEtDSCnmBz98lNKlxN2lRsc81Jfel0tEcuCrRj NGgatuwWUmfva8LnhdSTRB0Brt7yNkaJIIQKLX30u3H59OKK4cNcuPWlB5FXmmiOb47Q klrQ== X-Gm-Message-State: AODbwcBJ0ziZ/vaAKIXGxDreMQebrdwNuoNBkR4w1AxwqHxBXSgiJ58V GzRQ/3sQOJoxaijs2/8= X-Received: by 10.28.54.91 with SMTP id d88mr5145896wma.9.1496236696188; Wed, 31 May 2017 06:18:16 -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 g77sm10045744wmd.19.2017.05.31.06.18.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 31 May 2017 06:18:15 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck , Gaetan Rivet Date: Wed, 31 May 2017 15:17:51 +0200 Message-Id: <915054e7a283bcab9ef0b3da3ca8acdf3463f2f7.1496235017.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 06/11] vdev: implement find_device bus operation 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, 31 May 2017 13:18:17 -0000 From: Jan Blunck Signed-off-by: Jan Blunck Signed-off-by: Gaetan Rivet --- lib/librte_eal/common/eal_common_vdev.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/librte_eal/common/eal_common_vdev.c b/lib/librte_eal/common/eal_common_vdev.c index 0037a64..46f2b74 100644 --- a/lib/librte_eal/common/eal_common_vdev.c +++ b/lib/librte_eal/common/eal_common_vdev.c @@ -338,9 +338,22 @@ vdev_probe(void) return 0; } +static struct rte_device * +vdev_find_device(rte_dev_match_t match, const void *data) +{ + struct rte_vdev_device *dev; + + TAILQ_FOREACH(dev, &vdev_device_list, next) { + if (match(&dev->device, data)) + return &dev->device; + } + return NULL; +} + static struct rte_bus rte_vdev_bus = { .scan = vdev_scan, .probe = vdev_probe, + .find_device = vdev_find_device, }; RTE_INIT(rte_vdev_bus_register); -- 2.1.4