summaryrefslogtreecommitdiff
path: root/drivers/bus/ifpga
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2018-10-03 00:25:06 +0200
committerThomas Monjalon <thomas@monjalon.net>2018-10-11 14:09:24 +0200
commit6844d146ff397d82526a8a39b550443937f7ac12 (patch)
tree0ba8560cc5af2888323090429792947f994092eb /drivers/bus/ifpga
parent2effa126fbd8d53e0a5d723ac8314c1bb2c3ce9b (diff)
downloaddpdk-6844d146ff397d82526a8a39b550443937f7ac12.zip
dpdk-6844d146ff397d82526a8a39b550443937f7ac12.tar.gz
dpdk-6844d146ff397d82526a8a39b550443937f7ac12.tar.xz
eal: add bus pointer in device structure
When a device is added with a devargs (hotplug or whitelist), the bus pointer can be retrieved via its devargs. But there is no such devargs.bus in case of standard scan. A pointer to the rte_bus handle is added to rte_device. When a device is allocated (during a scan), the pointer to its bus is assigned. It will make possible to remove a rte_device, using the function pointer from its bus. The function rte_bus_find_by_device() becomes useless, and may be removed later. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com> Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'drivers/bus/ifpga')
-rw-r--r--drivers/bus/ifpga/Makefile2
-rw-r--r--drivers/bus/ifpga/ifpga_bus.c1
-rw-r--r--drivers/bus/ifpga/meson.build2
3 files changed, 4 insertions, 1 deletions
diff --git a/drivers/bus/ifpga/Makefile b/drivers/bus/ifpga/Makefile
index 3ff3bdb..514452b 100644
--- a/drivers/bus/ifpga/Makefile
+++ b/drivers/bus/ifpga/Makefile
@@ -19,7 +19,7 @@ LDLIBS += -lrte_kvargs
EXPORT_MAP := rte_bus_ifpga_version.map
# library version
-LIBABIVER := 1
+LIBABIVER := 2
SRCS-$(CONFIG_RTE_LIBRTE_IFPGA_BUS) += ifpga_bus.c
SRCS-$(CONFIG_RTE_LIBRTE_IFPGA_BUS) += ifpga_common.c
diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index 3ef035b..8066332 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -142,6 +142,7 @@ ifpga_scan_one(struct rte_rawdev *rawdev,
if (!afu_dev)
goto end;
+ afu_dev->device.bus = &rte_ifpga_bus;
afu_dev->device.devargs = devargs;
afu_dev->device.numa_node = SOCKET_ID_ANY;
afu_dev->device.name = devargs->name;
diff --git a/drivers/bus/ifpga/meson.build b/drivers/bus/ifpga/meson.build
index c9b08c8..0b5c38d 100644
--- a/drivers/bus/ifpga/meson.build
+++ b/drivers/bus/ifpga/meson.build
@@ -1,6 +1,8 @@
# SPDX-License-Identifier: BSD-3-Clause
# Copyright(c) 2010-2018 Intel Corporation
+version = 2
+
deps += ['pci', 'kvargs', 'rawdev']
install_headers('rte_bus_ifpga.h')
sources = files('ifpga_common.c', 'ifpga_bus.c')