From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by dpdk.org (Postfix) with ESMTP id 2409C2A5D for ; Thu, 12 Oct 2017 10:21:57 +0200 (CEST) Received: by mail-wm0-f51.google.com with SMTP id b189so10782312wmd.4 for ; Thu, 12 Oct 2017 01:21:57 -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=HxdkUwPqOWJNJ3BiSKjukcBnXkgmNXWdoorICHSxSeM=; b=TBgUykl9BiYkF8uG9zN6AEthyNL9kpBFgGt+RdT4p/k/uJ9VkJgtMwDjwK3U6/wNbs 3KQPD9xL0Qq2fQ17OjKcf4R3ygo+bWKovJYHW9iYiRphMQP9Z1naWk5qV7MEzuX/IZdY k93anQjSJT4M8c7ttKU6KNuXy1Nx2XNxaCTdJNZ6sEc08Ty9zrAqU+UAIzW4EpWvTFhx bmydynx+0lqOXMXk2/j9ba65Z/R8rQyp1ygkAePYu1Wf76iOF9M4S/LturhDN85xwbRf YSVEBvxcb3yroDHTr2sn+0qXCuxDJqN994DWpLDtvJuqxIDJ29R57vjiUNTi956oUa7V kiMg== 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=HxdkUwPqOWJNJ3BiSKjukcBnXkgmNXWdoorICHSxSeM=; b=I5bMrcbjb5ZNDpO98Bmxw8BkkPgg0dA3N2SbHSEfvw+yYQxJzLcKK8XtkXdbixO3JH BBytTf/jsiFSfaROCRDoo/D2HQpKHECVuN2VXjvhUzXsAPUf3NHadjLH5zCHPW9HZYJR BnGvpBSAqPX5AEtF4I7HatU2ZG2uP+kHguqkuWU4UYaSJpEuNHuP/4LajnY81D0WvTwX 5TLbfoBaH0B0hb1tv/XUtbYoOn0liWJwSDDPE3A7JSKPSGoB3u272n2grICgVN6Q75eL 72ey2TPy8UP+mOX1Y9Q/zUysrJAF+I/D2A17rz/4A3FHdoZm/aKHD7zZu2SqKwh0KZsi xU1A== X-Gm-Message-State: AMCzsaXl67waOrLHS9Dyr/xnY/2jaGdas7bWLA9NkELcJfuODraodyf1 iL530qqTuS9/uIIG63oL0IHBa8SP X-Google-Smtp-Source: AOwi7QAic5IBa+2Bisoc+ElumqcJ2tMafcUn3R+pgBLN3o5+QFiKjvR9qpk2GHAWYP/0T4MIQTRExw== X-Received: by 10.223.162.196 with SMTP id t4mr1310963wra.42.1507796516423; Thu, 12 Oct 2017 01:21:56 -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.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 01:21:55 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Gaetan Rivet Date: Thu, 12 Oct 2017 10:21:20 +0200 Message-Id: <5119c935da0c88362e761a9a8e23c3539778e125.1507796100.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 13/18] bus: make device recognition function public 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: Thu, 12 Oct 2017 08:21:57 -0000 As other EAL facilities now requires the bus to be explicitly mentioned, the function rte_bus_find_by_device_name can be used by third parties to ease the transition to a more formal device definition scheme. Signed-off-by: Gaetan Rivet --- lib/librte_eal/bsdapp/eal/rte_eal_version.map | 1 + lib/librte_eal/common/include/rte_bus.h | 12 ++++++++++++ lib/librte_eal/linuxapp/eal/rte_eal_version.map | 1 + 3 files changed, 14 insertions(+) diff --git a/lib/librte_eal/bsdapp/eal/rte_eal_version.map b/lib/librte_eal/bsdapp/eal/rte_eal_version.map index 0d693c8..13c8450 100644 --- a/lib/librte_eal/bsdapp/eal/rte_eal_version.map +++ b/lib/librte_eal/bsdapp/eal/rte_eal_version.map @@ -223,6 +223,7 @@ EXPERIMENTAL { DPDK_17.11 { global: + rte_bus_find_by_device_name; rte_bus_get_iommu_class; rte_eal_iova_mode; rte_eal_mbuf_default_mempool_ops; diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h index 1cae96e..6d3fb70 100644 --- a/lib/librte_eal/common/include/rte_bus.h +++ b/lib/librte_eal/common/include/rte_bus.h @@ -364,6 +364,18 @@ struct rte_bus *rte_bus_find_by_device(const struct rte_device *dev); struct rte_bus *rte_bus_find_by_name(const char *busname); /** + * Find a bus capable of identifying a device. + * + * @param str + * A device identifier (PCI address, virtual PMD name, ...). + * + * @return + * A valid bus handle if found. + * NULL if no bus is able to parse this device. + */ +struct rte_bus *rte_bus_find_by_device_name(const char *str); + +/** * Helper for Bus registration. * The constructor has higher priority than PMD constructors. */ diff --git a/lib/librte_eal/linuxapp/eal/rte_eal_version.map b/lib/librte_eal/linuxapp/eal/rte_eal_version.map index 9c0251e..a6fe25c 100644 --- a/lib/librte_eal/linuxapp/eal/rte_eal_version.map +++ b/lib/librte_eal/linuxapp/eal/rte_eal_version.map @@ -227,6 +227,7 @@ EXPERIMENTAL { DPDK_17.11 { global: + rte_bus_find_by_device_name; rte_bus_get_iommu_class; rte_eal_iova_mode; rte_eal_mbuf_default_mempool_ops; -- 2.1.4