From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7A1A2A00C5; Sat, 9 Jul 2022 10:28:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C6A7142836; Sat, 9 Jul 2022 10:28:08 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 1670642829 for ; Sat, 9 Jul 2022 10:28:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6Gw21UroPhq0s70LqDASM9ltMpgSMjaqgF19X/ypmi0=; b=HrNePsvqOwOs6VZJ1zPQxWbDSd9EHvQgq12aeHeAZmIrhlWvXbn3SwthNcOc3HXrERtSbQ OHuRSGgYKeNCSLKFfzAwMAtKscE2emvthZ4nrQR56Gem6bAbFSdwY6tEZjhSKLn+9E5uVB U+AqA+1V9IgeUnJbj+MDNGwVLhutb2Q= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-126-K4Hcvzo9PqGvHj-HamX_KQ-1; Sat, 09 Jul 2022 04:28:01 -0400 X-MC-Unique: K4Hcvzo9PqGvHj-HamX_KQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E26FF29AA3B7; Sat, 9 Jul 2022 08:28:00 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67D662026D64; Sat, 9 Jul 2022 08:27:58 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Aman Singh , Yuying Zhang , Parav Pandit , Xueming Li , Hemant Agrawal , Sachin Saxena , Rosen Xu , Stephen Hemminger , Long Li , Matan Azrad , Viacheslav Ovsiienko , Chas Williams , "Min Hu (Connor)" Subject: [RFC v2 v2 11/29] drivers/bus: hide specific structures Date: Sat, 9 Jul 2022 10:26:26 +0200 Message-Id: <20220709082644.664675-12-david.marchand@redhat.com> In-Reply-To: <20220709082644.664675-1-david.marchand@redhat.com> References: <20220628144643.1213026-1-david.marchand@redhat.com> <20220709082644.664675-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Now that there is no bus specific object referenced in the driver objects, we can hide rte_dpaa_bus, rte_fslmc_bus, rte_pci_bus, rte_vmbus_bus specific structures into their bus code. While at it: - move enumerators only used in the bus code itself, - remove unneeded list head structure type, - reorder the definitions and macro manipulating the bus singleton object, - remove inclusion of rte_bus.h and update code that relied on it, Signed-off-by: David Marchand --- Changes since RFC v1: - dropped kni UT and ethtool example changes after new cleanup was added, - cleaned ifgpa and vdev bus, --- app/test-pmd/testpmd.h | 1 + drivers/bus/auxiliary/private.h | 28 +++++++++++------------ drivers/bus/auxiliary/rte_bus_auxiliary.h | 1 - drivers/bus/dpaa/dpaa_bus.c | 8 +++++++ drivers/bus/dpaa/rte_dpaa_bus.h | 13 ----------- drivers/bus/fslmc/fslmc_bus.c | 1 + drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 1 + drivers/bus/fslmc/private.h | 27 ++++++++++++++++++++++ drivers/bus/fslmc/rte_fslmc.h | 20 ---------------- drivers/bus/ifpga/ifpga_bus.c | 4 ++-- drivers/bus/ifpga/rte_bus_ifpga.h | 6 ----- drivers/bus/pci/bsd/pci.c | 2 -- drivers/bus/pci/linux/pci.c | 3 --- drivers/bus/pci/private.h | 18 ++++++++++++++- drivers/bus/pci/rte_bus_pci.h | 22 ------------------ drivers/bus/pci/windows/pci.c | 1 + drivers/bus/pci/windows/pci_netuio.c | 1 + drivers/bus/vdev/rte_bus_vdev.h | 3 --- drivers/bus/vdev/vdev.c | 6 ++--- drivers/bus/vmbus/private.h | 18 +++++++++++++++ drivers/bus/vmbus/rte_bus_vmbus.h | 20 ---------------- drivers/bus/vmbus/vmbus_common.c | 1 - drivers/common/mlx5/mlx5_common_pci.c | 1 + drivers/net/bonding/rte_eth_bond_args.c | 1 + drivers/net/mlx5/linux/mlx5_os.c | 1 + drivers/net/netvsc/hn_ethdev.c | 1 + 27 files changed, 97 insertions(+), 114 deletions(-) create mode 100644 drivers/bus/fslmc/private.h diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index fb2f5195d3..8694c65539 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -8,6 +8,7 @@ #include #include +#include #include #ifdef RTE_LIB_GRO #include diff --git a/drivers/bus/auxiliary/private.h b/drivers/bus/auxiliary/private.h index d22e83cf7a..d97e8c694e 100644 --- a/drivers/bus/auxiliary/private.h +++ b/drivers/bus/auxiliary/private.h @@ -9,9 +9,10 @@ #include #include +#include + #include "rte_bus_auxiliary.h" -extern struct rte_auxiliary_bus auxiliary_bus; extern int auxiliary_bus_logtype; #define AUXILIARY_LOG(level, ...) \ @@ -19,27 +20,24 @@ extern int auxiliary_bus_logtype; RTE_FMT("auxiliary bus: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ RTE_FMT_TAIL(__VA_ARGS__,))) -/* Auxiliary bus iterators */ -#define FOREACH_DEVICE_ON_AUXILIARY_BUS(p) \ - TAILQ_FOREACH(p, &(auxiliary_bus.device_list), next) - -#define FOREACH_DRIVER_ON_AUXILIARY_BUS(p) \ - TAILQ_FOREACH(p, &(auxiliary_bus.driver_list), next) - -/* List of auxiliary devices. */ -TAILQ_HEAD(rte_auxiliary_device_list, rte_auxiliary_device); -/* List of auxiliary drivers. */ -TAILQ_HEAD(rte_auxiliary_driver_list, rte_auxiliary_driver); - /* * Structure describing the auxiliary bus */ struct rte_auxiliary_bus { struct rte_bus bus; /* Inherit the generic class */ - struct rte_auxiliary_device_list device_list; /* List of devices */ - struct rte_auxiliary_driver_list driver_list; /* List of drivers */ + TAILQ_HEAD(, rte_auxiliary_device) device_list; /* List of devices */ + TAILQ_HEAD(, rte_auxiliary_driver) driver_list; /* List of drivers */ }; +extern struct rte_auxiliary_bus auxiliary_bus; + +/* Auxiliary bus iterators */ +#define FOREACH_DEVICE_ON_AUXILIARY_BUS(p) \ + TAILQ_FOREACH(p, &(auxiliary_bus.device_list), next) + +#define FOREACH_DRIVER_ON_AUXILIARY_BUS(p) \ + TAILQ_FOREACH(p, &(auxiliary_bus.driver_list), next) + /* * Test whether the auxiliary device exist. */ diff --git a/drivers/bus/auxiliary/rte_bus_auxiliary.h b/drivers/bus/auxiliary/rte_bus_auxiliary.h index b19696e5e6..3b3dbc866a 100644 --- a/drivers/bus/auxiliary/rte_bus_auxiliary.h +++ b/drivers/bus/auxiliary/rte_bus_auxiliary.h @@ -25,7 +25,6 @@ extern "C" { #include #include #include -#include #include #define RTE_BUS_AUXILIARY_NAME "auxiliary" diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index 2c286d5817..ad4ea156a6 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -43,6 +43,14 @@ #include #include +struct rte_dpaa_bus { + struct rte_bus bus; + TAILQ_HEAD(, rte_dpaa_device) device_list; + TAILQ_HEAD(, rte_dpaa_driver) driver_list; + int device_count; + int detected; +}; + static struct rte_dpaa_bus rte_dpaa_bus; struct netcfg_info *dpaa_netcfg; diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index 5e8f32dfbf..69c759c68b 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -6,7 +6,6 @@ #ifndef __RTE_DPAA_BUS_H__ #define __RTE_DPAA_BUS_H__ -#include #include #include #include @@ -73,24 +72,12 @@ extern unsigned int dpaa_svr_family; struct rte_dpaa_device; struct rte_dpaa_driver; -/* DPAA Device and Driver lists for DPAA bus */ -TAILQ_HEAD(rte_dpaa_device_list, rte_dpaa_device); -TAILQ_HEAD(rte_dpaa_driver_list, rte_dpaa_driver); - enum rte_dpaa_type { FSL_DPAA_ETH = 1, FSL_DPAA_CRYPTO, FSL_DPAA_QDMA }; -struct rte_dpaa_bus { - struct rte_bus bus; - struct rte_dpaa_device_list device_list; - struct rte_dpaa_driver_list driver_list; - int device_count; - int detected; -}; - struct dpaa_device_id { uint8_t fman_id; /**< Fman interface ID, for ETH type device */ uint8_t mac_id; /**< Fman MAC interface ID, for ETH type device */ diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index f112d2afeb..8498f5321a 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -16,6 +16,7 @@ #include #include +#include "private.h" #include #include #include "fslmc_logs.h" diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 3d4e71a80a..b172c84d52 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -29,9 +29,9 @@ #include #include #include -#include #include +#include "private.h" #include "rte_fslmc.h" #include "fslmc_vfio.h" #include "fslmc_logs.h" diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c b/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c index ca1d0304d5..28780717bd 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c @@ -12,6 +12,7 @@ #include #include +#include "private.h" #include #include #include diff --git a/drivers/bus/fslmc/private.h b/drivers/bus/fslmc/private.h new file mode 100644 index 0000000000..80d4673ca8 --- /dev/null +++ b/drivers/bus/fslmc/private.h @@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2016,2021 NXP + */ + +#ifndef __PRIVATE_H__ +#define __PRIVATE_H__ + +#include + +#include + +/* + * FSLMC bus + */ +struct rte_fslmc_bus { + struct rte_bus bus; /**< Generic Bus object */ + TAILQ_HEAD(, rte_dpaa2_device) device_list; + /**< FSLMC DPAA2 Device list */ + TAILQ_HEAD(, rte_dpaa2_driver) driver_list; + /**< FSLMC DPAA2 Driver list */ + int device_count[DPAA2_DEVTYPE_MAX]; + /**< Count of all devices scanned */ +}; + +extern struct rte_fslmc_bus rte_fslmc_bus; + +#endif /* __PRIVATE_H__ */ diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h index 9c3791635c..6bdee86aaf 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -29,7 +29,6 @@ extern "C" { #include #include #include -#include #include #include #include @@ -69,15 +68,9 @@ dpaa2_seqn(struct rte_mbuf *mbuf) struct rte_dpaa2_driver; -/* DPAA2 Device and Driver lists for FSLMC bus */ -TAILQ_HEAD(rte_fslmc_device_list, rte_dpaa2_device); -TAILQ_HEAD(rte_fslmc_driver_list, rte_dpaa2_driver); - #define RTE_DEV_TO_FSLMC_CONST(ptr) \ container_of(ptr, const struct rte_dpaa2_device, device) -extern struct rte_fslmc_bus rte_fslmc_bus; - enum rte_dpaa2_dev_type { /* Devices backed by DPDK driver */ DPAA2_ETH, /**< DPNI type device*/ @@ -152,19 +145,6 @@ struct rte_dpaa2_driver { rte_dpaa2_remove_t remove; }; -/* - * FSLMC bus - */ -struct rte_fslmc_bus { - struct rte_bus bus; /**< Generic Bus object */ - struct rte_fslmc_device_list device_list; - /**< FSLMC DPAA2 Device list */ - struct rte_fslmc_driver_list driver_list; - /**< FSLMC DPAA2 Driver list */ - int device_count[DPAA2_DEVTYPE_MAX]; - /**< Count of all devices scanned */ -}; - /** * Register a DPAA2 driver. * diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c index e005f2cb70..5353dbdb01 100644 --- a/drivers/bus/ifpga/ifpga_bus.c +++ b/drivers/bus/ifpga/ifpga_bus.c @@ -37,9 +37,9 @@ */ static struct rte_bus rte_ifpga_bus; -static struct ifpga_afu_dev_list ifpga_afu_dev_list = +static TAILQ_HEAD(, rte_afu_device) ifpga_afu_dev_list = TAILQ_HEAD_INITIALIZER(ifpga_afu_dev_list); -static struct ifpga_afu_drv_list ifpga_afu_drv_list = +static TAILQ_HEAD(, rte_afu_driver) ifpga_afu_drv_list = TAILQ_HEAD_INITIALIZER(ifpga_afu_drv_list); diff --git a/drivers/bus/ifpga/rte_bus_ifpga.h b/drivers/bus/ifpga/rte_bus_ifpga.h index 682d565891..8792e23dd0 100644 --- a/drivers/bus/ifpga/rte_bus_ifpga.h +++ b/drivers/bus/ifpga/rte_bus_ifpga.h @@ -19,18 +19,12 @@ extern "C" { #include #include -/** Name of Intel FPGA Bus */ #define IFPGA_BUS_NAME ifpga /* Forward declarations */ struct rte_afu_device; struct rte_afu_driver; -/** Double linked list of Intel FPGA AFU device. */ -RTE_TAILQ_HEAD(ifpga_afu_dev_list, rte_afu_device); -/** Double linked list of Intel FPGA AFU device drivers. */ -RTE_TAILQ_HEAD(ifpga_afu_drv_list, rte_afu_driver); - #define IFPGA_BUS_BITSTREAM_PATH_MAX_LEN 256 struct rte_afu_uuid { diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c index 9a11f99ae3..bcd772427b 100644 --- a/drivers/bus/pci/bsd/pci.c +++ b/drivers/bus/pci/bsd/pci.c @@ -48,8 +48,6 @@ * PCI probing under BSD. */ -extern struct rte_pci_bus rte_pci_bus; - /* Map pci device */ int rte_pci_map_device(struct rte_pci_device *dev) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index e521459870..fa5d5e131d 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -24,8 +23,6 @@ * PCI probing using Linux sysfs. */ -extern struct rte_pci_bus rte_pci_bus; - static int pci_get_kernel_driver_by_path(const char *filename, char *dri_name, size_t len) diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h index 0fbef8e1d8..6ccec15655 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h @@ -8,12 +8,28 @@ #include #include -#include +#include #include #include +/** + * Structure describing the PCI bus + */ +struct rte_pci_bus { + struct rte_bus bus; /**< Inherit the generic class */ + RTE_TAILQ_HEAD(, rte_pci_device) device_list; /**< List of PCI devices */ + RTE_TAILQ_HEAD(, rte_pci_driver) driver_list; /**< List of PCI drivers */ +}; + extern struct rte_pci_bus rte_pci_bus; +/* PCI Bus iterators */ +#define FOREACH_DEVICE_ON_PCIBUS(p) \ + RTE_TAILQ_FOREACH(p, &(rte_pci_bus.device_list), next) + +#define FOREACH_DRIVER_ON_PCIBUS(p) \ + RTE_TAILQ_FOREACH(p, &(rte_pci_bus.driver_list), next) + struct rte_pci_driver; struct rte_pci_device; diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h index 1913bc111c..01d834e3cc 100644 --- a/drivers/bus/pci/rte_bus_pci.h +++ b/drivers/bus/pci/rte_bus_pci.h @@ -25,7 +25,6 @@ extern "C" { #include #include #include -#include #include /** Pathname of PCI devices directory. */ @@ -35,18 +34,6 @@ const char *rte_pci_get_sysfs_path(void); struct rte_pci_device; struct rte_pci_driver; -/** List of PCI devices */ -RTE_TAILQ_HEAD(rte_pci_device_list, rte_pci_device); -/** List of PCI drivers */ -RTE_TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver); - -/* PCI Bus iterators */ -#define FOREACH_DEVICE_ON_PCIBUS(p) \ - RTE_TAILQ_FOREACH(p, &(rte_pci_bus.device_list), next) - -#define FOREACH_DRIVER_ON_PCIBUS(p) \ - RTE_TAILQ_FOREACH(p, &(rte_pci_bus.driver_list), next) - struct rte_devargs; enum rte_pci_kernel_driver { @@ -169,15 +156,6 @@ struct rte_pci_driver { uint32_t drv_flags; /**< Flags RTE_PCI_DRV_*. */ }; -/** - * Structure describing the PCI bus - */ -struct rte_pci_bus { - struct rte_bus bus; /**< Inherit the generic class */ - struct rte_pci_device_list device_list; /**< List of PCI devices */ - struct rte_pci_driver_list driver_list; /**< List of PCI drivers */ -}; - /** Device needs PCI BAR mapping (done with either IGB_UIO or VFIO) */ #define RTE_PCI_DRV_NEED_MAPPING 0x0001 /** Device needs PCI BAR mapping with enabled write combining (wc) */ diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index 7bf091158b..f013b743b3 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "private.h" #include "pci_netuio.h" diff --git a/drivers/bus/pci/windows/pci_netuio.c b/drivers/bus/pci/windows/pci_netuio.c index 5460399eea..314bbcf547 100644 --- a/drivers/bus/pci/windows/pci_netuio.c +++ b/drivers/bus/pci/windows/pci_netuio.c @@ -8,6 +8,7 @@ #include #include #include +#include #ifdef __MINGW32__ #include diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h index 5af6be009f..ce20faf649 100644 --- a/drivers/bus/vdev/rte_bus_vdev.h +++ b/drivers/bus/vdev/rte_bus_vdev.h @@ -51,9 +51,6 @@ rte_vdev_device_args(const struct rte_vdev_device *dev) return ""; } -/** Double linked list of virtual device drivers. */ -RTE_TAILQ_HEAD(vdev_driver_list, rte_vdev_driver); - /** * Probe function called for each virtual device driver once. */ diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index a8d8b2327e..804486d3ba 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -30,16 +30,14 @@ /* Forward declare to access virtual bus name */ static struct rte_bus rte_vdev_bus; -/** Double linked list of virtual device drivers. */ -TAILQ_HEAD(vdev_device_list, rte_vdev_device); -static struct vdev_device_list vdev_device_list = +static TAILQ_HEAD(, rte_vdev_device) vdev_device_list = TAILQ_HEAD_INITIALIZER(vdev_device_list); /* The lock needs to be recursive because a vdev can manage another vdev. */ static rte_spinlock_recursive_t vdev_device_list_lock = RTE_SPINLOCK_RECURSIVE_INITIALIZER; -static struct vdev_driver_list vdev_driver_list = +static TAILQ_HEAD(, rte_vdev_driver) vdev_driver_list = TAILQ_HEAD_INITIALIZER(vdev_driver_list); struct vdev_custom_scan { diff --git a/drivers/bus/vmbus/private.h b/drivers/bus/vmbus/private.h index 658303bc27..597ba18df9 100644 --- a/drivers/bus/vmbus/private.h +++ b/drivers/bus/vmbus/private.h @@ -8,13 +8,31 @@ #include #include + +#include #include #include #include #include +/** + * Structure describing the VM bus + */ +struct rte_vmbus_bus { + struct rte_bus bus; /**< Inherit the generic class */ + RTE_TAILQ_HEAD(, rte_vmbus_device) device_list; /**< List of devices */ + RTE_TAILQ_HEAD(, rte_vmbus_driver) driver_list; /**< List of drivers */ +}; + extern struct rte_vmbus_bus rte_vmbus_bus; +/* VMBus iterators */ +#define FOREACH_DEVICE_ON_VMBUS(p) \ + RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.device_list), next) + +#define FOREACH_DRIVER_ON_VMBUS(p) \ + RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.driver_list), next) + extern int vmbus_logtype_bus; #define VMBUS_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, vmbus_logtype_bus, "%s(): " fmt "\n", \ diff --git a/drivers/bus/vmbus/rte_bus_vmbus.h b/drivers/bus/vmbus/rte_bus_vmbus.h index 8d6ba26028..763c077623 100644 --- a/drivers/bus/vmbus/rte_bus_vmbus.h +++ b/drivers/bus/vmbus/rte_bus_vmbus.h @@ -23,7 +23,6 @@ extern "C" { #include #include -#include #include #include #include @@ -37,16 +36,6 @@ struct rte_vmbus_driver; struct vmbus_channel; struct vmbus_mon_page; -RTE_TAILQ_HEAD(rte_vmbus_device_list, rte_vmbus_device); -RTE_TAILQ_HEAD(rte_vmbus_driver_list, rte_vmbus_driver); - -/* VMBus iterators */ -#define FOREACH_DEVICE_ON_VMBUS(p) \ - RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.device_list), next) - -#define FOREACH_DRIVER_ON_VMBUS(p) \ - RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.driver_list), next) - /** Maximum number of VMBUS resources. */ enum hv_uio_map { HV_TXRX_RING_MAP = 0, @@ -101,15 +90,6 @@ struct rte_vmbus_driver { }; -/** - * Structure describing the VM bus - */ -struct rte_vmbus_bus { - struct rte_bus bus; /**< Inherit the generic class */ - struct rte_vmbus_device_list device_list; /**< List of devices */ - struct rte_vmbus_driver_list driver_list; /**< List of drivers */ -}; - /** * Scan the content of the VMBUS bus, and the devices in the devices * list diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c index 0f2d878126..03b39c82b7 100644 --- a/drivers/bus/vmbus/vmbus_common.c +++ b/drivers/bus/vmbus/vmbus_common.c @@ -11,7 +11,6 @@ #include #include -#include #include #include #include diff --git a/drivers/common/mlx5/mlx5_common_pci.c b/drivers/common/mlx5/mlx5_common_pci.c index 66626953f1..e708e23a7f 100644 --- a/drivers/common/mlx5/mlx5_common_pci.c +++ b/drivers/common/mlx5/mlx5_common_pci.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "mlx5_common_log.h" diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index 5406e1c934..b90757756a 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -4,6 +4,7 @@ #include #include +#include #include #include diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 0741028dab..04b9614f5c 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 787139c0b2..308936ad9f 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include -- 2.36.1