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 59EBAA00C5; Sat, 9 Jul 2022 10:29:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7370342B78; Sat, 9 Jul 2022 10:29:32 +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 DBC1842B78 for ; Sat, 9 Jul 2022 10:29:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355370; 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=Wxa+eWdpXn+qppLE0QsNyhgC54EEt2XH8dr3SnBYjeE=; b=akdeC9OIVVSu7Iz2zhWbk3JZz9t9Ow8h4mzwJbRS6S5Iweow1xICsHw+v1c6eH0zDRZ657 b+EGxP23Yiytp6ihB3NtJKKw4J0W9S/aJ+TuW1hY1HN03zw1N/UUsWTtVvnGd3wxsf8r5J XBStGDdX74etUSHXS9MzYdTzsK77ZYI= 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-440-kvCeShkTPDSDiRyJ9A5TCQ-1; Sat, 09 Jul 2022 04:29:26 -0400 X-MC-Unique: kvCeShkTPDSDiRyJ9A5TCQ-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 51B473C02B77; Sat, 9 Jul 2022 08:29:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3AE332026D64; Sat, 9 Jul 2022 08:29:25 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Stephen Hemminger , Long Li , Ray Kinsella Subject: [RFC v2 v2 25/29] bus/vmbus: make driver-only headers private Date: Sat, 9 Jul 2022 10:26:40 +0200 Message-Id: <20220709082644.664675-26-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 The vmbus bus interface is for drivers only. Mark as internal and move the header on the driver headers list. Signed-off-by: David Marchand --- drivers/bus/vmbus/bus_vmbus_driver.h | 106 +++++++++++++++++++++++++++ drivers/bus/vmbus/meson.build | 1 + drivers/bus/vmbus/private.h | 2 +- drivers/bus/vmbus/rte_bus_vmbus.h | 83 --------------------- drivers/bus/vmbus/version.map | 9 ++- drivers/net/netvsc/hn_ethdev.c | 2 +- drivers/net/netvsc/hn_nvs.c | 2 +- drivers/net/netvsc/hn_rndis.c | 2 +- drivers/net/netvsc/hn_rxtx.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- 10 files changed, 120 insertions(+), 91 deletions(-) create mode 100644 drivers/bus/vmbus/bus_vmbus_driver.h diff --git a/drivers/bus/vmbus/bus_vmbus_driver.h b/drivers/bus/vmbus/bus_vmbus_driver.h new file mode 100644 index 0000000000..3424e791c9 --- /dev/null +++ b/drivers/bus/vmbus/bus_vmbus_driver.h @@ -0,0 +1,106 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2018, Microsoft Corporation. + * All Rights Reserved. + */ + +#ifndef BUS_VMBUS_DRIVER_H +#define BUS_VMBUS_DRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +struct vmbus_channel; +struct vmbus_mon_page; + +/** Maximum number of VMBUS resources. */ +enum hv_uio_map { + HV_TXRX_RING_MAP = 0, + HV_INT_PAGE_MAP, + HV_MON_PAGE_MAP, + HV_RECV_BUF_MAP, + HV_SEND_BUF_MAP +}; +#define VMBUS_MAX_RESOURCE 5 + +/** + * A structure describing a VMBUS device. + */ +struct rte_vmbus_device { + RTE_TAILQ_ENTRY(rte_vmbus_device) next; /**< Next probed VMBUS device */ + const struct rte_vmbus_driver *driver; /**< Associated driver */ + struct rte_device device; /**< Inherit core device */ + rte_uuid_t device_id; /**< VMBUS device id */ + rte_uuid_t class_id; /**< VMBUS device type */ + uint32_t relid; /**< id for primary */ + uint8_t monitor_id; /**< monitor page */ + int uio_num; /**< UIO device number */ + uint32_t *int_page; /**< VMBUS interrupt page */ + struct vmbus_channel *primary; /**< VMBUS primary channel */ + struct vmbus_mon_page *monitor_page; /**< VMBUS monitor page */ + + struct rte_intr_handle *intr_handle; /**< Interrupt handle */ + struct rte_mem_resource resource[VMBUS_MAX_RESOURCE]; +}; + +/** + * Initialization function for the driver called during VMBUS probing. + */ +typedef int (vmbus_probe_t)(struct rte_vmbus_driver *, + struct rte_vmbus_device *); + +/** + * Initialization function for the driver called during hot plugging. + */ +typedef int (vmbus_remove_t)(struct rte_vmbus_device *); + +/** + * A structure describing a VMBUS driver. + */ +struct rte_vmbus_driver { + RTE_TAILQ_ENTRY(rte_vmbus_driver) next; /**< Next in list. */ + struct rte_driver driver; + vmbus_probe_t *probe; /**< Device Probe function. */ + vmbus_remove_t *remove; /**< Device Remove function. */ + + const rte_uuid_t *id_table; /**< ID table. */ +}; + +/** + * Register a VMBUS driver. + * + * @param driver + * A pointer to a rte_vmbus_driver structure describing the driver + * to be registered. + */ +__rte_internal +void rte_vmbus_register(struct rte_vmbus_driver *driver); + +/** + * Unregister a VMBUS driver. + * + * @param driver + * A pointer to a rte_vmbus_driver structure describing the driver + * to be unregistered. + */ +__rte_internal +void rte_vmbus_unregister(struct rte_vmbus_driver *driver); + +/** Helper for VMBUS device registration from driver instance */ +#define RTE_PMD_REGISTER_VMBUS(nm, vmbus_drv) \ + RTE_INIT(vmbusinitfn_ ##nm) \ + { \ + (vmbus_drv).driver.name = RTE_STR(nm); \ + rte_vmbus_register(&vmbus_drv); \ + } \ + RTE_PMD_EXPORT_NAME(nm, __COUNTER__) + +#ifdef __cplusplus +} +#endif + +#endif /* BUS_VMBUS_DRIVER_H */ diff --git a/drivers/bus/vmbus/meson.build b/drivers/bus/vmbus/meson.build index 3892cbf67f..34988d1d84 100644 --- a/drivers/bus/vmbus/meson.build +++ b/drivers/bus/vmbus/meson.build @@ -8,6 +8,7 @@ endif headers = files('rte_bus_vmbus.h','rte_vmbus_reg.h') +driver_sdk_headers = files('bus_vmbus_driver.h') sources = files( 'vmbus_bufring.c', diff --git a/drivers/bus/vmbus/private.h b/drivers/bus/vmbus/private.h index 600530c4f6..e33424675c 100644 --- a/drivers/bus/vmbus/private.h +++ b/drivers/bus/vmbus/private.h @@ -10,10 +10,10 @@ #include #include +#include #include #include #include -#include /** * Structure describing the VM bus diff --git a/drivers/bus/vmbus/rte_bus_vmbus.h b/drivers/bus/vmbus/rte_bus_vmbus.h index 763c077623..03894a5d46 100644 --- a/drivers/bus/vmbus/rte_bus_vmbus.h +++ b/drivers/bus/vmbus/rte_bus_vmbus.h @@ -27,68 +27,12 @@ extern "C" { #include #include #include -#include #include /* Forward declarations */ struct rte_vmbus_device; struct rte_vmbus_driver; struct vmbus_channel; -struct vmbus_mon_page; - -/** Maximum number of VMBUS resources. */ -enum hv_uio_map { - HV_TXRX_RING_MAP = 0, - HV_INT_PAGE_MAP, - HV_MON_PAGE_MAP, - HV_RECV_BUF_MAP, - HV_SEND_BUF_MAP -}; -#define VMBUS_MAX_RESOURCE 5 - -/** - * A structure describing a VMBUS device. - */ -struct rte_vmbus_device { - RTE_TAILQ_ENTRY(rte_vmbus_device) next; /**< Next probed VMBUS device */ - const struct rte_vmbus_driver *driver; /**< Associated driver */ - struct rte_device device; /**< Inherit core device */ - rte_uuid_t device_id; /**< VMBUS device id */ - rte_uuid_t class_id; /**< VMBUS device type */ - uint32_t relid; /**< id for primary */ - uint8_t monitor_id; /**< monitor page */ - int uio_num; /**< UIO device number */ - uint32_t *int_page; /**< VMBUS interrupt page */ - struct vmbus_channel *primary; /**< VMBUS primary channel */ - struct vmbus_mon_page *monitor_page; /**< VMBUS monitor page */ - - struct rte_intr_handle *intr_handle; /**< Interrupt handle */ - struct rte_mem_resource resource[VMBUS_MAX_RESOURCE]; -}; - -/** - * Initialization function for the driver called during VMBUS probing. - */ -typedef int (vmbus_probe_t)(struct rte_vmbus_driver *, - struct rte_vmbus_device *); - -/** - * Initialization function for the driver called during hot plugging. - */ -typedef int (vmbus_remove_t)(struct rte_vmbus_device *); - -/** - * A structure describing a VMBUS driver. - */ -struct rte_vmbus_driver { - RTE_TAILQ_ENTRY(rte_vmbus_driver) next; /**< Next in list. */ - struct rte_driver driver; - vmbus_probe_t *probe; /**< Device Probe function. */ - vmbus_remove_t *remove; /**< Device Remove function. */ - - const rte_uuid_t *id_table; /**< ID table. */ -}; - /** * Scan the content of the VMBUS bus, and the devices in the devices @@ -357,15 +301,6 @@ void rte_vmbus_set_latency(const struct rte_vmbus_device *dev, const struct vmbus_channel *chan, uint32_t latency); -/** - * Register a VMBUS driver. - * - * @param driver - * A pointer to a rte_vmbus_driver structure describing the driver - * to be registered. - */ -void rte_vmbus_register(struct rte_vmbus_driver *driver); - /** * For debug dump contents of ring buffer. * @@ -374,24 +309,6 @@ void rte_vmbus_register(struct rte_vmbus_driver *driver); */ void rte_vmbus_chan_dump(FILE *f, const struct vmbus_channel *chan); -/** - * Unregister a VMBUS driver. - * - * @param driver - * A pointer to a rte_vmbus_driver structure describing the driver - * to be unregistered. - */ -void rte_vmbus_unregister(struct rte_vmbus_driver *driver); - -/** Helper for VMBUS device registration from driver instance */ -#define RTE_PMD_REGISTER_VMBUS(nm, vmbus_drv) \ - RTE_INIT(vmbusinitfn_ ##nm) \ - { \ - (vmbus_drv).driver.name = RTE_STR(nm); \ - rte_vmbus_register(&vmbus_drv); \ - } \ - RTE_PMD_EXPORT_NAME(nm, __COUNTER__) - #ifdef __cplusplus } #endif diff --git a/drivers/bus/vmbus/version.map b/drivers/bus/vmbus/version.map index 3cadec7fae..fb7bed747d 100644 --- a/drivers/bus/vmbus/version.map +++ b/drivers/bus/vmbus/version.map @@ -16,13 +16,18 @@ DPDK_22 { rte_vmbus_map_device; rte_vmbus_max_channels; rte_vmbus_probe; - rte_vmbus_register; rte_vmbus_scan; rte_vmbus_set_latency; rte_vmbus_sub_channel_index; rte_vmbus_subchan_open; rte_vmbus_unmap_device; - rte_vmbus_unregister; local: *; }; + +INTERNAL { + global: + + rte_vmbus_register; + rte_vmbus_unregister; +}; diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 0aedecd358..ccc06bdda6 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include "hn_logs.h" diff --git a/drivers/net/netvsc/hn_nvs.c b/drivers/net/netvsc/hn_nvs.c index b90280c9ff..817fb06dfb 100644 --- a/drivers/net/netvsc/hn_nvs.c +++ b/drivers/net/netvsc/hn_nvs.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "hn_logs.h" #include "hn_var.h" diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c index 1b63b27e0c..20f75a17b0 100644 --- a/drivers/net/netvsc/hn_rndis.c +++ b/drivers/net/netvsc/hn_rndis.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "hn_logs.h" #include "hn_var.h" diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 909c07a4ab..61cf374224 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include "hn_logs.h" diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index cce0a79edb..40981706d5 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include -- 2.36.1