From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f182.google.com (mail-wr0-f182.google.com [209.85.128.182]) by dpdk.org (Postfix) with ESMTP id 5121A293B for ; Mon, 26 Jun 2017 02:22:32 +0200 (CEST) Received: by mail-wr0-f182.google.com with SMTP id k67so131077810wrc.2 for ; Sun, 25 Jun 2017 17:22:32 -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=iQ5LwG5bEJ1TVsfZzDurYenB0KLAsQ51ahGbReszIpTw80t+LT7G0bqWsvuWZrnIjP 8B5CN0aUwWOXeLupSk4im0gb46vwCSj5XI/4kyIPXdCqT/i7wkMv+UJVN33eEkinbYrM +fHn/uHOq74hHUK26ijUuklAqUsfZfH1XFXzaFfC1iJey2iNQi72WH9mqgqIbHddfzxv dZaFoxcIWZcIk0aNDgialt2QH0MSYvQdvGC1Wq94Nb4KjI7cY113B4KJ5VdVjPpIORyX UTKcakbGM1WLtxY2+oVG7QnQTK7L+hH/oKMUxovWMMUctuEHA+FhnwZXsn+uybfWaxtm ZjoQ== 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=K1b4PKRz0cCuVXX4k+/GiHawQpWTURmJCLoO0Hwwx2E0Z4tWVK8j5Q8ZnYfmejdpcA 0GxCfMAnti/1fglmzFP08Ptr/3PsDPNEKugP8hJVRK1oRYgvXh6xnqrDtYBbDAvV24Hq d9iiLxaFVxiZcvn1YK0HUKY1BtKuit7uMjLTnWAnsMy7Ckk0deDTH6R06xM2ynOXpcBs ShBRdL5OfvQ1jpEnZM+VmXyOAFlI+YomLf1S9OMeXsqCmWo8exHUWKaYJqW2xpWNdcwz 7zqvFIIx8kTIOK/WYCT9eAzeJjn7zSSwMHzix8DaMU6eWs1pMQORIOKTSKegNRPM4kwD f/xw== X-Gm-Message-State: AKS2vOwIRo8dsz5HSfISHxAcu/cTibqpnAPRbq9L+nSd2LsYs3/Fyf20 7gW6Dy8TPvU4wPRsgh4= X-Received: by 10.223.152.34 with SMTP id v31mr11896628wrb.60.1498436551686; Sun, 25 Jun 2017 17:22:31 -0700 (PDT) Received: from bidouze.dev.6wind.com ([62.23.145.78]) by smtp.gmail.com with ESMTPSA id 19sm16061626wrx.26.2017.06.25.17.22.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 25 Jun 2017 17:22:30 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jan Blunck , Gaetan Rivet Date: Mon, 26 Jun 2017 02:22:04 +0200 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: In-Reply-To: References: Subject: [dpdk-dev] [PATCH v5 06/12] 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: Mon, 26 Jun 2017 00:22:32 -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