From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f172.google.com (mail-wr0-f172.google.com [209.85.128.172]) by dpdk.org (Postfix) with ESMTP id 6D9572BB8 for ; Thu, 8 Jun 2017 01:53:45 +0200 (CEST) Received: by mail-wr0-f172.google.com with SMTP id v104so12014742wrb.0 for ; Wed, 07 Jun 2017 16:53:45 -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=tjqI29ilY4kKBMG5nOy4tpYCC4CTfVaxuIKSf3JLPKU=; b=XWmlGzMMuF7ij0ILN5mSbFMuFvx+pMHEwGFSQIbXiOYmhJiXPbAG9okoDzTEJgKWjm kk2YsDczgfyn6Kp2wodMBtqCbHyqv4fszrR0Q0L+10DXnD4GbHytpPo/0gkTfVBKZbfo 1ySHUEuES1jTolJ4H9AhxndfqK6c3/kFh86OkeBq/wUZvUWTMSd1APLc6xo3K2gnltEE hCzpy6y+9ByFmlh196ZkXdTi90Vl1S1UPH0BB9M1UCckJV8xA15n28lnwvWn4KFhwxqJ lpwkCUrAJCtFsRLRIz5UloDL8NzWt9u9clpJAJuYXaTYjC3O5wvjSByynj/Xf3p5NHYw NBeA== 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=tjqI29ilY4kKBMG5nOy4tpYCC4CTfVaxuIKSf3JLPKU=; b=G6fHILkTa9gYsxgpV4rBqd3nfVvB2az+umyI3eh1xE5ZISe41yRgZjiuUqcd1tFmGm UkLUGvEZ3ofEMbUwhEjsloa2LVScMfMACbEQoZIjz4k8dtNXbvV4K2YpyQNF7Av8FjrN jOvEYsSsH9r7LNu9bWNb/PwIwHeeZDZw+23QDUDyVJAEf3NFWOUXstoucRG4RMbs/+vN 2hQb4iw/lvNnN1HEXpgbLKh6RniLdvSHoE2DiBwoV8Gx1C9DK7ZCRufRLw7L/5lb497y pOMv34S6VB1HUd1hkyZwOzVNgDU/D/6cKS9irVpOygD25ENz1RSsU7QV2gdYlWp509Xj w4ag== X-Gm-Message-State: AODbwcBKAEDJ7e2eU/EETgg/jtglBZO6OHHImf9tEiSzQfRTsr5rKQFb VmKO1bq/vwrry62DBSA= X-Received: by 10.223.146.129 with SMTP id 1mr12609804wrn.164.1496879624899; Wed, 07 Jun 2017 16:53:44 -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 z23sm4589942wrz.0.2017.06.07.16.53.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Jun 2017 16:53:44 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck , Gaetan Rivet Date: Thu, 8 Jun 2017 01:53:20 +0200 Message-Id: <22d668ff3f4bac3eb206286e09e51bc7894f33bf.1496876710.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 v3 06/10] 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, 07 Jun 2017 23:53:45 -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..52528ef 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_cmp_t cmp, const void *data) +{ + struct rte_vdev_device *dev; + + TAILQ_FOREACH(dev, &vdev_device_list, next) { + if (cmp(&dev->device, data) == 0) + 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