From patchwork Sat Jul 9 08:26:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113856 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4DFEFA00C5; Sat, 9 Jul 2022 10:27:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DF8F14021F; Sat, 9 Jul 2022 10:27:07 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 4E4F54021E for ; Sat, 9 Jul 2022 10:27:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355225; 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=oZnz32hBTAj7hsvvZzLpaMdPXuO6eyeuYQzz/vxnesc=; b=jHIz1BVRXbYkDvh4EQWCUkzNRncW2d/3+F2lFUkd/Ixr2xyz0DiB9P/h2j0FQ9f4Yx8YYr LwG38eZpVmRFEztgTMmgxKbfaoiK4IMY5nr5ahG0dbunRJQGermiL9Ap+OVS9b5zCklxda RsPDjJ5p4Un/qKNVphtzy0ijDYN/Ijs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-249-hl6S5bs5OquPP232YdhDxA-1; Sat, 09 Jul 2022 04:27:04 -0400 X-MC-Unique: hl6S5bs5OquPP232YdhDxA-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 DAF9C185A7B2; Sat, 9 Jul 2022 08:27:03 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1AC432026D64; Sat, 9 Jul 2022 08:27:02 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Matan Azrad , Viacheslav Ovsiienko Subject: [RFC v2 v2 01/29] common/mlx5: rework check on driver registration Date: Sat, 9 Jul 2022 10:26:16 +0200 Message-Id: <20220709082644.664675-2-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 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 Rely on a local flag rather than dereference a bus object. This will help next commits. Signed-off-by: David Marchand --- drivers/common/mlx5/linux/mlx5_common_auxiliary.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/common/mlx5/linux/mlx5_common_auxiliary.c b/drivers/common/mlx5/linux/mlx5_common_auxiliary.c index 6584aeb18e..a182a8bdde 100644 --- a/drivers/common/mlx5/linux/mlx5_common_auxiliary.c +++ b/drivers/common/mlx5/linux/mlx5_common_auxiliary.c @@ -179,14 +179,20 @@ static struct rte_auxiliary_driver mlx5_auxiliary_driver = { .dma_unmap = mlx5_common_auxiliary_dma_unmap, }; +static bool mlx5_common_auxiliary_initialized; + void mlx5_common_auxiliary_init(void) { - if (mlx5_auxiliary_driver.bus == NULL) + if (!mlx5_common_auxiliary_initialized) { rte_auxiliary_register(&mlx5_auxiliary_driver); + mlx5_common_auxiliary_initialized = true; + } } RTE_FINI(mlx5_common_auxiliary_driver_finish) { - if (mlx5_auxiliary_driver.bus != NULL) + if (mlx5_common_auxiliary_initialized) { rte_auxiliary_unregister(&mlx5_auxiliary_driver); + mlx5_common_auxiliary_initialized = false; + } } From patchwork Sat Jul 9 08:26:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113858 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 83FF7A00C5; Sat, 9 Jul 2022 10:27:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5314342826; Sat, 9 Jul 2022 10:27:17 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id DCF6C410F2 for ; Sat, 9 Jul 2022 10:27:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355233; 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=lzRO+UecPTi/JypXF54fDDq5/xh60vu2UXWk157d1Kg=; b=AjOAssPXIZbcG9JZGuij0rWqgbY3+rZ9wXwctaHnooFMHvDab+2H8ccguvsmKMZB/JXn+D TS8e+oME1udjOj0BjJOfmninsFRWjeYCxxwxJGt/VAxmrFmtq1JmiAUCz3w5HbQkaTDLYd 5YIjbNEyLKWfptx7Gv1H71rEeZy/pbw= 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-483-XndrYJXkNleOYiYXgIzN_Q-1; Sat, 09 Jul 2022 04:27:10 -0400 X-MC-Unique: XndrYJXkNleOYiYXgIzN_Q-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 D88C429AA3BC; Sat, 9 Jul 2022 08:27:09 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id B9D092026D64; Sat, 9 Jul 2022 08:27:08 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Rosen Xu , Tianfei zhang , Ray Kinsella Subject: [RFC v2 v2 02/29] raw/ifpga: remove PCI bus accessor Date: Sat, 9 Jul 2022 10:26:17 +0200 Message-Id: <20220709082644.664675-3-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 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 There is no in-tree user for this accessor that returns the PCI bus object. On the other hand, a bus object can be retrieved by name using rte_bus_find_by_name. We can remove driver specific API. Signed-off-by: David Marchand --- drivers/raw/ifpga/ifpga_rawdev.c | 7 +------ drivers/raw/ifpga/ifpga_rawdev.h | 1 - drivers/raw/ifpga/rte_pmd_ifpga.c | 6 ------ drivers/raw/ifpga/rte_pmd_ifpga.h | 10 ---------- drivers/raw/ifpga/version.map | 1 - 5 files changed, 1 insertion(+), 24 deletions(-) diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index 8c05302a65..78a7123528 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -10,8 +10,8 @@ #include #include #include + #include -#include #include #include #include @@ -1888,11 +1888,6 @@ RTE_PMD_REGISTER_PARAM_STRING(ifpga_rawdev_cfg, "port= " "afu_bts="); -struct rte_pci_bus *ifpga_get_pci_bus(void) -{ - return rte_ifpga_rawdev_pmd.bus; -} - int ifpga_rawdev_partial_reconfigure(struct rte_rawdev *dev, int port, const char *file) { diff --git a/drivers/raw/ifpga/ifpga_rawdev.h b/drivers/raw/ifpga/ifpga_rawdev.h index 4c191190ca..0fb66cbaae 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.h +++ b/drivers/raw/ifpga/ifpga_rawdev.h @@ -91,7 +91,6 @@ int ifpga_unregister_msix_irq(struct ifpga_rawdev *dev, enum ifpga_irq_type type, int vec_start, rte_intr_callback_fn handler, void *arg); -struct rte_pci_bus *ifpga_get_pci_bus(void); int ifpga_rawdev_partial_reconfigure(struct rte_rawdev *dev, int port, const char *file); void ifpga_rawdev_cleanup(void); diff --git a/drivers/raw/ifpga/rte_pmd_ifpga.c b/drivers/raw/ifpga/rte_pmd_ifpga.c index 23146432c2..1ca248123b 100644 --- a/drivers/raw/ifpga/rte_pmd_ifpga.c +++ b/drivers/raw/ifpga/rte_pmd_ifpga.c @@ -402,12 +402,6 @@ rte_pmd_ifpga_reload(uint16_t dev_id, int type, int page) return opae_mgr_reload(adapter->mgr, type, page); } -const struct rte_pci_bus * -rte_pmd_ifpga_get_pci_bus(void) -{ - return ifpga_get_pci_bus(); -} - int rte_pmd_ifpga_partial_reconfigure(uint16_t dev_id, int port, const char *file) { diff --git a/drivers/raw/ifpga/rte_pmd_ifpga.h b/drivers/raw/ifpga/rte_pmd_ifpga.h index 3fa5d3435a..791543f2cd 100644 --- a/drivers/raw/ifpga/rte_pmd_ifpga.h +++ b/drivers/raw/ifpga/rte_pmd_ifpga.h @@ -220,16 +220,6 @@ rte_pmd_ifpga_reboot_try(uint16_t dev_id); int rte_pmd_ifpga_reload(uint16_t dev_id, int type, int page); -/** - * Get PCI bus the Intel FPGA driver register to - * - * @return - * - (valid pointer) if successful. - * - (NULL) if the Intel FPGA driver is not registered to any PCI bus. - */ -const struct rte_pci_bus * -rte_pmd_ifpga_get_pci_bus(void); - /** * Perform PR (partial reconfiguration) on specified Intel FPGA device * diff --git a/drivers/raw/ifpga/version.map b/drivers/raw/ifpga/version.map index ff71a453e2..340d8eb3c7 100644 --- a/drivers/raw/ifpga/version.map +++ b/drivers/raw/ifpga/version.map @@ -10,7 +10,6 @@ DPDK_22 { rte_pmd_ifpga_stop_update; rte_pmd_ifpga_reboot_try; rte_pmd_ifpga_reload; - rte_pmd_ifpga_get_pci_bus; rte_pmd_ifpga_partial_reconfigure; rte_pmd_ifpga_cleanup; From patchwork Sat Jul 9 08:26:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113859 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 58776A00C5; Sat, 9 Jul 2022 10:27:26 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7969242825; Sat, 9 Jul 2022 10:27:23 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id B069D40A81 for ; Sat, 9 Jul 2022 10:27:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355242; 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=nKG2gxnis7tK/eFPzuC9UNIVfAvuGKRtkvvQ/BjHsuM=; b=GK4uLVHRyAdRzwm3l5ljSn6vgstJfsoaTGnLrI3XJP3/IMj6e5BLbHxXUiVm+dC1aJwjeU 4ng9cV1YQ4E0DiVUcFAGx/T/J3Dyhl6+POJ9+6KUXZc0TwcXQmGcsVWQXcFDgtpctmdW5c 6p8yV4Yu1287hL9R5nRbOz7fjq3CXVs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-553-aCVxOCFCOs2Ukg9MuE0Mww-1; Sat, 09 Jul 2022 04:27:18 -0400 X-MC-Unique: aCVxOCFCOs2Ukg9MuE0Mww-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 EA78D857A87; Sat, 9 Jul 2022 08:27:17 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 53C702026D64; Sat, 9 Jul 2022 08:27:17 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Cristian Dumitrescu Subject: [RFC v2 v2 03/29] kni: stop populating PCI info in examples Date: Sat, 9 Jul 2022 10:26:18 +0200 Message-Id: <20220709082644.664675-4-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 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 addr and id fields are deprecated and are not used in the kni library. Stop populating them in in-tree examples. Signed-off-by: David Marchand --- app/test/test_kni.c | 30 ------------------------------ examples/ip_pipeline/kni.c | 10 ---------- 2 files changed, 40 deletions(-) diff --git a/app/test/test_kni.c b/app/test/test_kni.c index 622315c8b1..4039da0b08 100644 --- a/app/test/test_kni.c +++ b/app/test/test_kni.c @@ -25,7 +25,6 @@ test_kni(void) #include #include #include -#include #include #include @@ -426,8 +425,6 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp) struct rte_kni_conf conf; struct rte_eth_dev_info info; struct rte_kni_ops ops; - const struct rte_pci_device *pci_dev; - const struct rte_bus *bus = NULL; if (!mp) return -1; @@ -443,13 +440,6 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp) return -1; } - if (info.device) - bus = rte_bus_find_by_device(info.device); - if (bus && !strcmp(bus->name, "pci")) { - pci_dev = RTE_DEV_TO_PCI(info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - } snprintf(conf.name, sizeof(conf.name), TEST_KNI_PORT); /* core id 1 configured for kernel thread */ @@ -545,8 +535,6 @@ test_kni(void) struct rte_kni_conf conf; struct rte_eth_dev_info info; struct rte_kni_ops ops; - const struct rte_pci_device *pci_dev; - const struct rte_bus *bus; FILE *fd; DIR *dir; char buf[16]; @@ -645,15 +633,6 @@ test_kni(void) return -1; } - if (info.device) - bus = rte_bus_find_by_device(info.device); - else - bus = NULL; - if (bus && !strcmp(bus->name, "pci")) { - pci_dev = RTE_DEV_TO_PCI(info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - } conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; @@ -689,15 +668,6 @@ test_kni(void) goto fail; } - if (info.device) - bus = rte_bus_find_by_device(info.device); - else - bus = NULL; - if (bus && !strcmp(bus->name, "pci")) { - pci_dev = RTE_DEV_TO_PCI(info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - } conf.group_id = port_id; conf.mbuf_size = MAX_PACKET_SZ; diff --git a/examples/ip_pipeline/kni.c b/examples/ip_pipeline/kni.c index a2d3331cb0..cd02c39478 100644 --- a/examples/ip_pipeline/kni.c +++ b/examples/ip_pipeline/kni.c @@ -6,7 +6,6 @@ #include #include -#include #include #include "kni.h" @@ -107,8 +106,6 @@ kni_create(const char *name, struct kni_params *params) struct mempool *mempool; struct link *link; struct rte_kni *k; - const struct rte_pci_device *pci_dev; - const struct rte_bus *bus = NULL; int ret; /* Check input params */ @@ -134,13 +131,6 @@ kni_create(const char *name, struct kni_params *params) kni_conf.core_id = params->thread_id; kni_conf.group_id = link->port_id; kni_conf.mbuf_size = mempool->buffer_size; - if (dev_info.device) - bus = rte_bus_find_by_device(dev_info.device); - if (bus && !strcmp(bus->name, "pci")) { - pci_dev = RTE_DEV_TO_PCI(dev_info.device); - kni_conf.addr = pci_dev->addr; - kni_conf.id = pci_dev->id; - } memset(&kni_ops, 0, sizeof(kni_ops)); kni_ops.port_id = link->port_id; From patchwork Sat Jul 9 08:26:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113861 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4F467A00C5; Sat, 9 Jul 2022 10:27:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4DC542B6C; Sat, 9 Jul 2022 10:27:38 +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 B66624021E for ; Sat, 9 Jul 2022 10:27:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355257; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=I2HmaXXgi+id40VhQX6qAjpQ8oEc6efbxm3DdXEU2LM=; b=EXp2rduC5Ey1a9UvEgOalTfoM9QYnDIpc+TkV+ktX61wxOiLcF6sZjiuD315rjNRjkYhm0 gJwDbAz61cDrIqxEud2kBrChUooepk+fCOiWmT+rG+NnNDDDHZ0shXhoiaQpwqgLiEqEy2 7o1X4rLIGsYQ0rSduLNrwOKvvTXzi1c= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-118-xs32Zr-jMXusSgode_Zlvw-1; Sat, 09 Jul 2022 04:27:22 -0400 X-MC-Unique: xs32Zr-jMXusSgode_Zlvw-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 3E3178001EA for ; Sat, 9 Jul 2022 08:27:22 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id C13962026D64 for ; Sat, 9 Jul 2022 08:27:21 +0000 (UTC) From: David Marchand To: dev@dpdk.org Subject: [RFC v2 v2 04/29] examples/ethtool: prefer device name Date: Sat, 9 Jul 2022 10:26:19 +0200 Message-Id: <20220709082644.664675-5-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 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 Rely on the generic device name rather than restrict to only supporting PCI devices. Signed-off-by: David Marchand --- examples/ethtool/lib/rte_ethtool.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c index ffaad96498..88dc917b73 100644 --- a/examples/ethtool/lib/rte_ethtool.c +++ b/examples/ethtool/lib/rte_ethtool.c @@ -8,7 +8,6 @@ #include #include #include -#include #ifdef RTE_NET_IXGBE #include #endif @@ -23,8 +22,6 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) { struct rte_eth_dev_info dev_info; struct rte_dev_reg_info reg_info; - const struct rte_pci_device *pci_dev; - const struct rte_bus *bus = NULL; int n; int ret; @@ -52,18 +49,8 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) strlcpy(drvinfo->driver, dev_info.driver_name, sizeof(drvinfo->driver)); strlcpy(drvinfo->version, rte_version(), sizeof(drvinfo->version)); - /* TODO: replace bus_info by rte_devargs.name */ - if (dev_info.device) - bus = rte_bus_find_by_device(dev_info.device); - if (bus && !strcmp(bus->name, "pci")) { - pci_dev = RTE_DEV_TO_PCI(dev_info.device); - snprintf(drvinfo->bus_info, sizeof(drvinfo->bus_info), - "%04x:%02x:%02x.%x", - pci_dev->addr.domain, pci_dev->addr.bus, - pci_dev->addr.devid, pci_dev->addr.function); - } else { - snprintf(drvinfo->bus_info, sizeof(drvinfo->bus_info), "N/A"); - } + strlcpy(drvinfo->bus_info, dev_info.device->name, + sizeof(drvinfo->bus_info)); memset(®_info, 0, sizeof(reg_info)); rte_eth_dev_get_reg_info(port_id, ®_info); From patchwork Sat Jul 9 08:26:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113860 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D9DF1A00C5; Sat, 9 Jul 2022 10:27:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CA6EC4280C; Sat, 9 Jul 2022 10:27:37 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9B1904280C for ; Sat, 9 Jul 2022 10:27:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355256; 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=IZDw6QVb1mqr8+Y8OOr4jM5Pn8EUkdDM6ym3ZkqGskE=; b=WSxcyyf+mcRI5iSpVdYNZgCx6uzL0y9+EjzHM9/jxb2yK8+iV4r0noontf6BoZrkYiH1Tr doqF+zYQzwpr2iRN/WXhXp4bnPu/T2uzX5bU0BykA+yZjMR3vqaAp00aCw0EO/LDZ7PpZ7 hbQYbREttmt8NAqiWwfSSbIqOLdLrvg= 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-159-46aEQfhRPCyLW0xya7nWhw-1; Sat, 09 Jul 2022 04:27:27 -0400 X-MC-Unique: 46aEQfhRPCyLW0xya7nWhw-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 7E4AD3806737; Sat, 9 Jul 2022 08:27:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id B5A962026D64; Sat, 9 Jul 2022 08:27:25 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Aman Singh , Yuying Zhang Subject: [RFC v2 v2 05/29] dev: hide debug messages in device iterator Date: Sat, 9 Jul 2022 10:26:20 +0200 Message-Id: <20220709082644.664675-6-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 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 For any bus that does not support device iteration, rte_dev_iterator_init both returned an error code and logged an error message. An application (like testpmd) that only wants to list devices, would have no choice but to inspect a bus object to avoid spewing error logs. Make those log messages debug level, and remove the check in testpmd. Signed-off-by: David Marchand --- app/test-pmd/config.c | 4 ---- lib/eal/common/eal_common_dev.c | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 608bec9796..39bce480bf 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -642,10 +642,6 @@ device_infos_display(const char *identifier) if (identifier && da.bus != next) continue; - /* Skip buses that don't have iterate method */ - if (!next->dev_iterate) - continue; - snprintf(devstr, sizeof(devstr), "bus=%s", next->name); RTE_DEV_FOREACH(dev, devstr, &dev_iter) { diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c index 9d913e5478..b6f0392f30 100644 --- a/lib/eal/common/eal_common_dev.c +++ b/lib/eal/common/eal_common_dev.c @@ -592,18 +592,17 @@ rte_dev_iterator_init(struct rte_dev_iterator *it, * one layer specified. */ if (bus == NULL && cls == NULL) { - RTE_LOG(ERR, EAL, - "Either bus or class must be specified.\n"); + RTE_LOG(DEBUG, EAL, "Either bus or class must be specified.\n"); rte_errno = EINVAL; goto get_out; } if (bus != NULL && bus->dev_iterate == NULL) { - RTE_LOG(ERR, EAL, "Bus %s not supported\n", bus->name); + RTE_LOG(DEBUG, EAL, "Bus %s not supported\n", bus->name); rte_errno = ENOTSUP; goto get_out; } if (cls != NULL && cls->dev_iterate == NULL) { - RTE_LOG(ERR, EAL, "Class %s not supported\n", cls->name); + RTE_LOG(DEBUG, EAL, "Class %s not supported\n", cls->name); rte_errno = ENOTSUP; goto get_out; } From patchwork Sat Jul 9 08:26:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113863 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 952F0A00C5; Sat, 9 Jul 2022 10:27:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D59D142B75; Sat, 9 Jul 2022 10:27:44 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 2460D42B70 for ; Sat, 9 Jul 2022 10:27:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355262; 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=iZZkJcN7rIbl2rlPAfODjLzVxehbUJtDS4ZZYFU2vNU=; b=OC0oxW5q1yGyhT0rj0AImt9XAbO0ZlpOlB4CQ9o9HZQJCzh+Oj6mjnQhwxJyXC6UEUPCDH KXBwe1/x+AZze5s8FNt8Qwxn0B3U0qf19Lqut9BQDznx8FGQVxr5DsMfzSAasdhxkOamiu jJ9W7oWXJJ+wREdZokvfhiSIjjWbwQU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-395-YTuJ70pOOh6NcKmSnk_THQ-1; Sat, 09 Jul 2022 04:27:36 -0400 X-MC-Unique: YTuJ70pOOh6NcKmSnk_THQ-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 14EE0101A58F; Sat, 9 Jul 2022 08:27:35 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0824B2026D64; Sat, 9 Jul 2022 08:27:30 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Fan Zhang , Ashish Gupta , Qiming Yang , Wenjun Wu , Shijith Thotton , Srisivasubramanian Srinivasan , Chengwen Feng , Kevin Laatz , Bruce Richardson , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Olivier Matz , Ori Kam , Akhil Goyal , Maxime Coquelin , Chenbo Xia Subject: [RFC v2 v2 06/29] dev: move unrelated macros from header Date: Sat, 9 Jul 2022 10:26:21 +0200 Message-Id: <20220709082644.664675-7-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 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 RTE_FUNC_PTR_OR_* macros have nothing to do with the rte_device object and associated API. Move them to rte_common.h and include it where needed. Signed-off-by: David Marchand --- drivers/common/qat/qat_device.c | 1 + drivers/compress/qat/qat_comp_pmd.c | 1 + drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 1 + drivers/net/ixgbe/rte_pmd_ixgbe.c | 1 + drivers/net/liquidio/lio_ethdev.c | 1 + lib/compressdev/rte_compressdev.c | 1 + lib/dmadev/rte_dmadev.c | 1 + lib/eal/include/rte_common.h | 11 +++++++++++ lib/eal/include/rte_dev.h | 11 ----------- lib/ethdev/ethdev_driver.c | 1 + lib/ethdev/ethdev_pci.h | 1 + lib/mempool/rte_mempool_ops.c | 1 + lib/regexdev/rte_regexdev.c | 1 + lib/security/rte_security.c | 1 + lib/vhost/vdpa.c | 1 + 15 files changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/common/qat/qat_device.c b/drivers/common/qat/qat_device.c index db4b087d2b..6583cf0554 100644 --- a/drivers/common/qat/qat_device.c +++ b/drivers/common/qat/qat_device.c @@ -2,6 +2,7 @@ * Copyright(c) 2018-2022 Intel Corporation */ +#include #include #include #include diff --git a/drivers/compress/qat/qat_comp_pmd.c b/drivers/compress/qat/qat_comp_pmd.c index dc8db84a68..e4cac159be 100644 --- a/drivers/compress/qat/qat_comp_pmd.c +++ b/drivers/compress/qat/qat_comp_pmd.c @@ -2,6 +2,7 @@ * Copyright(c) 2015-2022 Intel Corporation */ +#include #include #include "qat_comp.h" diff --git a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c index 1e0c4fe464..88c9b21cd8 100644 --- a/drivers/crypto/scheduler/rte_cryptodev_scheduler.c +++ b/drivers/crypto/scheduler/rte_cryptodev_scheduler.c @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ +#include #include #include #include diff --git a/drivers/net/ixgbe/rte_pmd_ixgbe.c b/drivers/net/ixgbe/rte_pmd_ixgbe.c index 9729f8575f..8ae4d9b39a 100644 --- a/drivers/net/ixgbe/rte_pmd_ixgbe.c +++ b/drivers/net/ixgbe/rte_pmd_ixgbe.c @@ -2,6 +2,7 @@ * Copyright(c) 2010-2017 Intel Corporation */ +#include #include #include "base/ixgbe_api.h" diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 90ffe31b9f..ccbd0ff849 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -2,6 +2,7 @@ * Copyright(c) 2017 Cavium, Inc */ +#include #include #include #include diff --git a/lib/compressdev/rte_compressdev.c b/lib/compressdev/rte_compressdev.c index 22c438f2dd..12469042f7 100644 --- a/lib/compressdev/rte_compressdev.c +++ b/lib/compressdev/rte_compressdev.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/lib/dmadev/rte_dmadev.c b/lib/dmadev/rte_dmadev.c index 174d4c40ae..e199b888c8 100644 --- a/lib/dmadev/rte_dmadev.c +++ b/lib/dmadev/rte_dmadev.c @@ -5,6 +5,7 @@ #include +#include #include #include #include diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h index a96cc2a138..e2d1271c53 100644 --- a/lib/eal/include/rte_common.h +++ b/lib/eal/include/rte_common.h @@ -861,6 +861,17 @@ rte_log2_u64(uint64_t v) /** Number of elements in the array. */ #define RTE_DIM(a) (sizeof (a) / sizeof ((a)[0])) +/** Macros to check for invalid function pointers. */ +#define RTE_FUNC_PTR_OR_ERR_RET(func, retval) do { \ + if ((func) == NULL) \ + return retval; \ +} while (0) + +#define RTE_FUNC_PTR_OR_RET(func) do { \ + if ((func) == NULL) \ + return; \ +} while (0) + /** * Converts a numeric string to the equivalent uint64_t value. * As well as straight number conversion, also recognises the suffixes diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h index e6ff1218f9..24f9122558 100644 --- a/lib/eal/include/rte_dev.h +++ b/lib/eal/include/rte_dev.h @@ -36,17 +36,6 @@ typedef void (*rte_dev_event_cb_fn)(const char *device_name, enum rte_dev_event_type event, void *cb_arg); -/* Macros to check for invalid function pointers */ -#define RTE_FUNC_PTR_OR_ERR_RET(func, retval) do { \ - if ((func) == NULL) \ - return retval; \ -} while (0) - -#define RTE_FUNC_PTR_OR_RET(func) do { \ - if ((func) == NULL) \ - return; \ -} while (0) - /** * Device policies. */ diff --git a/lib/ethdev/ethdev_driver.c b/lib/ethdev/ethdev_driver.c index a285f213f0..86f5a37874 100644 --- a/lib/ethdev/ethdev_driver.c +++ b/lib/ethdev/ethdev_driver.c @@ -2,6 +2,7 @@ * Copyright(c) 2022 Intel Corporation */ +#include #include #include diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h index 0549842709..b4bb460dcb 100644 --- a/lib/ethdev/ethdev_pci.h +++ b/lib/ethdev/ethdev_pci.h @@ -10,6 +10,7 @@ extern "C" { #endif +#include #include #include #include diff --git a/lib/mempool/rte_mempool_ops.c b/lib/mempool/rte_mempool_ops.c index 2d36dee8f0..d60235a7e3 100644 --- a/lib/mempool/rte_mempool_ops.c +++ b/lib/mempool/rte_mempool_ops.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include diff --git a/lib/regexdev/rte_regexdev.c b/lib/regexdev/rte_regexdev.c index 02a388bc5d..aa57ab5bfa 100644 --- a/lib/regexdev/rte_regexdev.c +++ b/lib/regexdev/rte_regexdev.c @@ -5,6 +5,7 @@ #include +#include #include #include diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c index 4f5e4b4d49..046b6496d2 100644 --- a/lib/security/rte_security.c +++ b/lib/security/rte_security.c @@ -4,6 +4,7 @@ * Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved */ +#include #include #include #include diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c index b2a2919fc0..bdebcbe565 100644 --- a/lib/vhost/vdpa.c +++ b/lib/vhost/vdpa.c @@ -10,6 +10,7 @@ #include +#include #include #include #include From patchwork Sat Jul 9 08:26:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113862 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 618C9A00C5; Sat, 9 Jul 2022 10:27:48 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF81A42B72; Sat, 9 Jul 2022 10:27:43 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id EB1DC42B70 for ; Sat, 9 Jul 2022 10:27:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355261; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=caxZxclDBJux+v8CvicA4hEE6So1gL+Mp1mBIeiBB0w=; b=GmrC8NxPneWI8AmX8g5DxoVahPF+E0h1cfH9NryoKSU+m61cRLboStcHeguqlPZI8resEa tj9s3pKE6qDv3EAatnEMX711VHJAAVSqZZdrCaXg/6t8JrjKKYmEgYkGR3cj/dV8Ovp8jV VoSE+LMFvuM0TTWteVOoeoKjc4f8CXc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-135-2C28FD_AOGmf-oZdObDTJw-1; Sat, 09 Jul 2022 04:27:39 -0400 X-MC-Unique: 2C28FD_AOGmf-oZdObDTJw-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 7F359101A54E for ; Sat, 9 Jul 2022 08:27:39 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0A0042026D64 for ; Sat, 9 Jul 2022 08:27:38 +0000 (UTC) From: David Marchand To: dev@dpdk.org Subject: [RFC v2 v2 07/29] devargs: remove dependency on bus header Date: Sat, 9 Jul 2022 10:26:22 +0200 Message-Id: <20220709082644.664675-8-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 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 We don't need to include rte_bus.h. Only a forward declaration of rte_bus and an inclusion of rte_dev.h are needed. Signed-off-by: David Marchand --- app/test/test_vdev.c | 1 + lib/eal/include/rte_devargs.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/test/test_vdev.c b/app/test/test_vdev.c index 720722c363..5eeff3106d 100644 --- a/app/test/test_vdev.c +++ b/app/test/test_vdev.c @@ -8,6 +8,7 @@ #include #include +#include #include #include "test.h" diff --git a/lib/eal/include/rte_devargs.h b/lib/eal/include/rte_devargs.h index 37a0f042ab..38dee2f288 100644 --- a/lib/eal/include/rte_devargs.h +++ b/lib/eal/include/rte_devargs.h @@ -22,7 +22,9 @@ extern "C" { #include #include -#include +#include + +struct rte_bus; /** * Bus type key in global devargs syntax. From patchwork Sat Jul 9 08:26:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113864 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 394C2A00C5; Sat, 9 Jul 2022 10:28:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 591544284D; Sat, 9 Jul 2022 10:27:48 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 96ACB42B80 for ; Sat, 9 Jul 2022 10:27:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355266; 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=8ejBqDkrADTKToc3M58vPXclr3ZjE7QrEWWpcRo5OTQ=; b=LiB8MSB+og0IPhltPUTMIwslW1KVZU/VNMw7brS32BwD3gJFwMGS1/RJSM/PMYYArroKkE 6wGaW4Q/fM1pUg7Eu+JlteEnjKHY202PZkIOx8sUQBHpaBunIf0zwrO6UY76+acAnEEYmo W+AVwEb0OFs6UtEJCMFxc+M+OiX6FZE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-163-Hy790-H-NYWrjEeCjNQWqA-1; Sat, 09 Jul 2022 04:27:44 -0400 X-MC-Unique: Hy790-H-NYWrjEeCjNQWqA-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 29180811E83; Sat, 9 Jul 2022 08:27:44 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7537D2026D64; Sat, 9 Jul 2022 08:27:42 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Parav Pandit , Xueming Li , Rosen Xu , Stephen Hemminger , Long Li , Jay Zhou , Radha Mohan Chintakuntla , Veerasenareddy Burru Subject: [RFC v2 v2 08/29] bus: remove unneeded inclusion of bus header Date: Sat, 9 Jul 2022 10:26:23 +0200 Message-Id: <20220709082644.664675-9-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 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 Those files don't need to include rte_bus.h. Signed-off-by: David Marchand --- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/ifpga/ifpga_common.c | 1 - drivers/bus/ifpga/rte_bus_ifpga.h | 1 - drivers/bus/vdev/vdev_params.c | 1 - drivers/bus/vmbus/linux/vmbus_uio.c | 1 - drivers/bus/vmbus/vmbus_bufring.c | 1 - drivers/bus/vmbus/vmbus_channel.c | 1 - drivers/bus/vmbus/vmbus_common_uio.c | 1 - drivers/crypto/virtio/virtio_pci.c | 1 - drivers/dma/cnxk/cnxk_dmadev.c | 1 - 10 files changed, 10 deletions(-) diff --git a/drivers/bus/auxiliary/linux/auxiliary.c b/drivers/bus/auxiliary/linux/auxiliary.c index 9bd4ee3295..28092e31c4 100644 --- a/drivers/bus/auxiliary/linux/auxiliary.c +++ b/drivers/bus/auxiliary/linux/auxiliary.c @@ -6,7 +6,6 @@ #include #include -#include #include #include #include diff --git a/drivers/bus/ifpga/ifpga_common.c b/drivers/bus/ifpga/ifpga_common.c index 78e2eaee4e..223660d6ff 100644 --- a/drivers/bus/ifpga/ifpga_common.c +++ b/drivers/bus/ifpga/ifpga_common.c @@ -14,7 +14,6 @@ #include #include -#include #include #include #include diff --git a/drivers/bus/ifpga/rte_bus_ifpga.h b/drivers/bus/ifpga/rte_bus_ifpga.h index 007ad19875..682d565891 100644 --- a/drivers/bus/ifpga/rte_bus_ifpga.h +++ b/drivers/bus/ifpga/rte_bus_ifpga.h @@ -15,7 +15,6 @@ extern "C" { #endif /* __cplusplus */ -#include #include #include #include diff --git a/drivers/bus/vdev/vdev_params.c b/drivers/bus/vdev/vdev_params.c index 3969faf16d..2c72614776 100644 --- a/drivers/bus/vdev/vdev_params.c +++ b/drivers/bus/vdev/vdev_params.c @@ -5,7 +5,6 @@ #include #include -#include #include #include diff --git a/drivers/bus/vmbus/linux/vmbus_uio.c b/drivers/bus/vmbus/linux/vmbus_uio.c index 5db70f8e0d..26edef342d 100644 --- a/drivers/bus/vmbus/linux/vmbus_uio.c +++ b/drivers/bus/vmbus/linux/vmbus_uio.c @@ -13,7 +13,6 @@ #include #include -#include #include #include #include diff --git a/drivers/bus/vmbus/vmbus_bufring.c b/drivers/bus/vmbus/vmbus_bufring.c index c4aa07b307..c78619dc44 100644 --- a/drivers/bus/vmbus/vmbus_bufring.c +++ b/drivers/bus/vmbus/vmbus_bufring.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/bus/vmbus/vmbus_channel.c b/drivers/bus/vmbus/vmbus_channel.c index 9bd01679c3..5549fd0944 100644 --- a/drivers/bus/vmbus/vmbus_channel.c +++ b/drivers/bus/vmbus/vmbus_channel.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/bus/vmbus/vmbus_common_uio.c b/drivers/bus/vmbus/vmbus_common_uio.c index 882a24f869..4d4613513c 100644 --- a/drivers/bus/vmbus/vmbus_common_uio.c +++ b/drivers/bus/vmbus/vmbus_common_uio.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include "private.h" diff --git a/drivers/crypto/virtio/virtio_pci.c b/drivers/crypto/virtio/virtio_pci.c index ae069794a6..95a43c8801 100644 --- a/drivers/crypto/virtio/virtio_pci.c +++ b/drivers/crypto/virtio/virtio_pci.c @@ -10,7 +10,6 @@ #endif #include -#include #include "virtio_pci.h" #include "virtqueue.h" diff --git a/drivers/dma/cnxk/cnxk_dmadev.c b/drivers/dma/cnxk/cnxk_dmadev.c index 2824c1b44f..3e8c15d617 100644 --- a/drivers/dma/cnxk/cnxk_dmadev.c +++ b/drivers/dma/cnxk/cnxk_dmadev.c @@ -5,7 +5,6 @@ #include #include -#include #include #include #include From patchwork Sat Jul 9 08:26:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113865 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8FFDCA00C5; Sat, 9 Jul 2022 10:28:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8AC59410DD; Sat, 9 Jul 2022 10:27:56 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 07350410DD for ; Sat, 9 Jul 2022 10:27:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355274; 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=+t3zyoAVyulm+oxGToIbp8mQkmVKr9Yx8cVuvMe/ENg=; b=UqRt2wZHMKMjbqXeGAVBXE4UF0rMMcMVdI6wwdqCFvKwqL5cFDIxjpK+QXdBlnLc84TxKa sOLUf/5kFT8R/RYy9KUVQKdbO4zwR3iOZyg1NAMQ3C9ZGY31GyBpSVkaf7PJwEKPEXuorq vE2i1Ozwy4TJurDFPj2PsQzVtO6yQC4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-121-hNujy_cyNQyBom5OhrnHfg-1; Sat, 09 Jul 2022 04:27:52 -0400 X-MC-Unique: hNujy_cyNQyBom5OhrnHfg-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 2042885A581; Sat, 9 Jul 2022 08:27:51 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 315A32026D64; Sat, 9 Jul 2022 08:27:48 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Stephen Hemminger , Long Li , Sunila Sahu , Fan Zhang , Ashish Gupta , Gaetan Rivet , Anatoly Burakov , Akhil Goyal , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Reshma Pattan Subject: [RFC v2 v2 09/29] bus: move IOVA definition from header Date: Sat, 9 Jul 2022 10:26:24 +0200 Message-Id: <20220709082644.664675-10-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 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 iova enum definition does not need to be defined as part of the bus API. Move it to rte_eal.h. With this step, rte_eal.h does not depend on rte_bus.h and rte_dev.h. Fix existing code that was relying on these implicit inclusions. Signed-off-by: David Marchand --- app/test-compress-perf/comp_perf_options.h | 2 ++ drivers/bus/vmbus/rte_bus_vmbus.h | 1 + drivers/compress/zlib/zlib_pmd_ops.c | 1 + drivers/net/failsafe/failsafe.c | 1 + drivers/net/failsafe/failsafe_eal.c | 1 + examples/multi_process/hotplug_mp/commands.c | 2 ++ lib/compressdev/rte_compressdev.c | 1 + lib/compressdev/rte_compressdev_pmd.c | 1 + lib/cryptodev/cryptodev_pmd.c | 2 ++ lib/eal/common/eal_thread.h | 1 + lib/eal/common/hotplug_mp.c | 1 + lib/eal/include/rte_bus.h | 18 ++---------------- lib/eal/include/rte_eal.h | 15 ++++++++++++++- lib/eal/include/rte_lcore.h | 2 ++ lib/eal/windows/eal.c | 1 + lib/ethdev/rte_ethdev.c | 1 + lib/pcapng/rte_pcapng.c | 1 + 17 files changed, 35 insertions(+), 17 deletions(-) diff --git a/app/test-compress-perf/comp_perf_options.h b/app/test-compress-perf/comp_perf_options.h index 0b777521c5..57dd146330 100644 --- a/app/test-compress-perf/comp_perf_options.h +++ b/app/test-compress-perf/comp_perf_options.h @@ -5,6 +5,8 @@ #ifndef _COMP_PERF_OPS_ #define _COMP_PERF_OPS_ +#include + #define MAX_LIST 32 #define MIN_COMPRESSED_BUF_SIZE 8 #define EXPANSE_RATIO 1.1 diff --git a/drivers/bus/vmbus/rte_bus_vmbus.h b/drivers/bus/vmbus/rte_bus_vmbus.h index a24bad831d..4421326fe8 100644 --- a/drivers/bus/vmbus/rte_bus_vmbus.h +++ b/drivers/bus/vmbus/rte_bus_vmbus.h @@ -23,6 +23,7 @@ extern "C" { #include #include +#include #include #include #include diff --git a/drivers/compress/zlib/zlib_pmd_ops.c b/drivers/compress/zlib/zlib_pmd_ops.c index 0a73aed949..7d657d81bc 100644 --- a/drivers/compress/zlib/zlib_pmd_ops.c +++ b/drivers/compress/zlib/zlib_pmd_ops.c @@ -4,6 +4,7 @@ #include +#include #include #include diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c index 05cf533896..3eb7d32b76 100644 --- a/drivers/net/failsafe/failsafe.c +++ b/drivers/net/failsafe/failsafe.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "failsafe_private.h" diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c index cb4a2abc02..130344dce2 100644 --- a/drivers/net/failsafe/failsafe_eal.c +++ b/drivers/net/failsafe/failsafe_eal.c @@ -3,6 +3,7 @@ * Copyright 2017 Mellanox Technologies, Ltd */ +#include #include #include diff --git a/examples/multi_process/hotplug_mp/commands.c b/examples/multi_process/hotplug_mp/commands.c index 41ea265e45..da8b5e5924 100644 --- a/examples/multi_process/hotplug_mp/commands.c +++ b/examples/multi_process/hotplug_mp/commands.c @@ -8,6 +8,8 @@ #include #include #include + +#include #include /**********************************************************/ diff --git a/lib/compressdev/rte_compressdev.c b/lib/compressdev/rte_compressdev.c index 12469042f7..7f6dedbc52 100644 --- a/lib/compressdev/rte_compressdev.c +++ b/lib/compressdev/rte_compressdev.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c index 7f500d76d4..9bfae077db 100644 --- a/lib/compressdev/rte_compressdev_pmd.c +++ b/lib/compressdev/rte_compressdev_pmd.c @@ -5,6 +5,7 @@ #include #include #include +#include #include #include "rte_compressdev_internal.h" diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c index 1903ade388..75d0075b86 100644 --- a/lib/cryptodev/cryptodev_pmd.c +++ b/lib/cryptodev/cryptodev_pmd.c @@ -3,6 +3,8 @@ */ #include + +#include #include #include #include diff --git a/lib/eal/common/eal_thread.h b/lib/eal/common/eal_thread.h index ca3378d463..e0240ccc60 100644 --- a/lib/eal/common/eal_thread.h +++ b/lib/eal/common/eal_thread.h @@ -5,6 +5,7 @@ #ifndef EAL_THREAD_H #define EAL_THREAD_H +#include #include /** diff --git a/lib/eal/common/hotplug_mp.c b/lib/eal/common/hotplug_mp.c index bde0de196e..1614a57752 100644 --- a/lib/eal/common/hotplug_mp.c +++ b/lib/eal/common/hotplug_mp.c @@ -3,6 +3,7 @@ */ #include +#include #include #include #include diff --git a/lib/eal/include/rte_bus.h b/lib/eal/include/rte_bus.h index bbbb6efd28..17edaa37c9 100644 --- a/lib/eal/include/rte_bus.h +++ b/lib/eal/include/rte_bus.h @@ -20,27 +20,13 @@ extern "C" { #include -#include #include +#include +#include /** Double linked list of buses */ RTE_TAILQ_HEAD(rte_bus_list, rte_bus); - -/** - * IOVA mapping mode. - * - * IOVA mapping mode is iommu programming mode of a device. - * That device (for example: IOMMU backed DMA device) based - * on rte_iova_mode will generate physical or virtual address. - * - */ -enum rte_iova_mode { - RTE_IOVA_DC = 0, /* Don't care mode */ - RTE_IOVA_PA = (1 << 0), /* DMA using physical address */ - RTE_IOVA_VA = (1 << 1) /* DMA using virtual address */ -}; - /** * Bus specific scan for devices attached on the bus. * For each bus object, the scan would be responsible for finding devices and diff --git a/lib/eal/include/rte_eal.h b/lib/eal/include/rte_eal.h index 5dfc50e987..fd3d7c1da8 100644 --- a/lib/eal/include/rte_eal.h +++ b/lib/eal/include/rte_eal.h @@ -17,7 +17,6 @@ #include #include #include -#include #include #include @@ -458,6 +457,20 @@ static inline int rte_gettid(void) __rte_internal uint64_t rte_eal_get_baseaddr(void); +/** + * IOVA mapping mode. + * + * IOVA mapping mode is iommu programming mode of a device. + * That device (for example: IOMMU backed DMA device) based + * on rte_iova_mode will generate physical or virtual address. + * + */ +enum rte_iova_mode { + RTE_IOVA_DC = 0, /* Don't care mode */ + RTE_IOVA_PA = (1 << 0), /* DMA using physical address */ + RTE_IOVA_VA = (1 << 1) /* DMA using virtual address */ +}; + /** * Get the iova mode * diff --git a/lib/eal/include/rte_lcore.h b/lib/eal/include/rte_lcore.h index b598e1b9ec..4d3978512c 100644 --- a/lib/eal/include/rte_lcore.h +++ b/lib/eal/include/rte_lcore.h @@ -11,6 +11,8 @@ * API for lcore and socket manipulation * */ +#include + #include #include #include diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c index 122de2a319..79322d2ce9 100644 --- a/lib/eal/windows/eal.c +++ b/lib/eal/windows/eal.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index 1979dc0850..ebbe8cca3d 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c index 06ad712bd1..5b079cd14a 100644 --- a/lib/pcapng/rte_pcapng.c +++ b/lib/pcapng/rte_pcapng.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include From patchwork Sat Jul 9 08:26:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113866 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0EB62A00C5; Sat, 9 Jul 2022 10:28:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF92742825; Sat, 9 Jul 2022 10:28:06 +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 80C1240A81 for ; Sat, 9 Jul 2022 10:28:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355285; 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=rhc0/8qLqXVlJzGx8L8kRxEbyN8tbI6zEnyjV5G3BYs=; b=GVyIbOTGJoNEO4kjxm9C8b8pKn3dplztAQtYQ4tzL6QsTZDekjH6FJIgbi6l+f9a8UU/Q6 sHuVaVBUG2kqs319gUclqdP6tfmw62CrLNtdHQPS5p92kUshpwRPqM/+Xu2DNS6JxUfStS U6NjWCST96ktw0xU9z7NHZZ4/541Wvc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-306-V02oP4-mNx6bOTu1kPBUpg-1; Sat, 09 Jul 2022 04:27:55 -0400 X-MC-Unique: V02oP4-mNx6bOTu1kPBUpg-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 7971E101AA45; Sat, 9 Jul 2022 08:27:55 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1A7532026D2D; Sat, 9 Jul 2022 08:27:53 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Parav Pandit , Xueming Li , Hemant Agrawal , Sachin Saxena , Stephen Hemminger , Long Li Subject: [RFC v2 v2 10/29] drivers/bus: remove back reference to bus objects Date: Sat, 9 Jul 2022 10:26:25 +0200 Message-Id: <20220709082644.664675-11-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 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 There is no need for a back reference to a singleton object in the bus driver objects: each function is contextually aware of which bus object it should manipulate. Signed-off-by: David Marchand --- drivers/bus/auxiliary/auxiliary_common.c | 2 -- drivers/bus/auxiliary/rte_bus_auxiliary.h | 2 -- drivers/bus/dpaa/dpaa_bus.c | 10 +--------- drivers/bus/dpaa/rte_dpaa_bus.h | 1 - drivers/bus/fslmc/fslmc_bus.c | 10 +--------- drivers/bus/fslmc/rte_fslmc.h | 1 - drivers/bus/pci/pci_common.c | 2 -- drivers/bus/pci/rte_bus_pci.h | 1 - drivers/bus/vmbus/rte_bus_vmbus.h | 2 -- drivers/bus/vmbus/vmbus_common.c | 2 -- 10 files changed, 2 insertions(+), 31 deletions(-) diff --git a/drivers/bus/auxiliary/auxiliary_common.c b/drivers/bus/auxiliary/auxiliary_common.c index 2cf8fe672d..0b212f2d64 100644 --- a/drivers/bus/auxiliary/auxiliary_common.c +++ b/drivers/bus/auxiliary/auxiliary_common.c @@ -259,7 +259,6 @@ void rte_auxiliary_register(struct rte_auxiliary_driver *driver) { TAILQ_INSERT_TAIL(&auxiliary_bus.driver_list, driver, next); - driver->bus = &auxiliary_bus; } /* Unregister a driver */ @@ -267,7 +266,6 @@ void rte_auxiliary_unregister(struct rte_auxiliary_driver *driver) { TAILQ_REMOVE(&auxiliary_bus.driver_list, driver, next); - driver->bus = NULL; } /* Add a device to auxiliary bus */ diff --git a/drivers/bus/auxiliary/rte_bus_auxiliary.h b/drivers/bus/auxiliary/rte_bus_auxiliary.h index 93b266daf7..b19696e5e6 100644 --- a/drivers/bus/auxiliary/rte_bus_auxiliary.h +++ b/drivers/bus/auxiliary/rte_bus_auxiliary.h @@ -32,7 +32,6 @@ extern "C" { /* Forward declarations */ struct rte_auxiliary_driver; -struct rte_auxiliary_bus; struct rte_auxiliary_device; /** @@ -125,7 +124,6 @@ struct rte_auxiliary_device { struct rte_auxiliary_driver { RTE_TAILQ_ENTRY(rte_auxiliary_driver) next; /**< Next in list. */ struct rte_driver driver; /**< Inherit core driver. */ - struct rte_auxiliary_bus *bus; /**< Auxiliary bus reference. */ rte_auxiliary_match_t *match; /**< Device match function. */ rte_auxiliary_probe_t *probe; /**< Device probe function. */ rte_auxiliary_remove_t *remove; /**< Device remove function. */ diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index e442bc4c33..2c286d5817 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -520,23 +520,15 @@ rte_dpaa_driver_register(struct rte_dpaa_driver *driver) BUS_INIT_FUNC_TRACE(); TAILQ_INSERT_TAIL(&rte_dpaa_bus.driver_list, driver, next); - /* Update Bus references */ - driver->dpaa_bus = &rte_dpaa_bus; } /* un-register a dpaa bus based dpaa driver */ void rte_dpaa_driver_unregister(struct rte_dpaa_driver *driver) { - struct rte_dpaa_bus *dpaa_bus; - BUS_INIT_FUNC_TRACE(); - dpaa_bus = driver->dpaa_bus; - - TAILQ_REMOVE(&dpaa_bus->driver_list, driver, next); - /* Update Bus references */ - driver->dpaa_bus = NULL; + TAILQ_REMOVE(&rte_dpaa_bus.driver_list, driver, next); } static int diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/rte_dpaa_bus.h index 1f04d9ebd3..5e8f32dfbf 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/rte_dpaa_bus.h @@ -119,7 +119,6 @@ typedef int (*rte_dpaa_remove_t)(struct rte_dpaa_device *dpaa_dev); struct rte_dpaa_driver { TAILQ_ENTRY(rte_dpaa_driver) next; struct rte_driver driver; - struct rte_dpaa_bus *dpaa_bus; enum rte_dpaa_type drv_type; rte_dpaa_probe_t probe; rte_dpaa_remove_t remove; diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index e9edc27e0a..f112d2afeb 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -530,27 +530,19 @@ rte_fslmc_driver_register(struct rte_dpaa2_driver *driver) RTE_VERIFY(driver); TAILQ_INSERT_TAIL(&rte_fslmc_bus.driver_list, driver, next); - /* Update Bus references */ - driver->fslmc_bus = &rte_fslmc_bus; } /*un-register a fslmc bus based dpaa2 driver */ void rte_fslmc_driver_unregister(struct rte_dpaa2_driver *driver) { - struct rte_fslmc_bus *fslmc_bus; - - fslmc_bus = driver->fslmc_bus; - /* Cleanup the PA->VA Translation table; From wherever this function * is called from. */ if (rte_eal_iova_mode() == RTE_IOVA_PA) dpaax_iova_table_depopulate(); - TAILQ_REMOVE(&fslmc_bus->driver_list, driver, next); - /* Update Bus references */ - driver->fslmc_bus = NULL; + TAILQ_REMOVE(&rte_fslmc_bus.driver_list, driver, next); } /* diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/rte_fslmc.h index 8c67bfba55..9c3791635c 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/rte_fslmc.h @@ -146,7 +146,6 @@ typedef int (*rte_dpaa2_remove_t)(struct rte_dpaa2_device *dpaa2_dev); struct rte_dpaa2_driver { TAILQ_ENTRY(rte_dpaa2_driver) next; /**< Next in list. */ struct rte_driver driver; /**< Inherit core driver. */ - struct rte_fslmc_bus *fslmc_bus; /**< FSLMC bus reference */ uint32_t drv_flags; /**< Flags for controlling device.*/ enum rte_dpaa2_dev_type drv_type; /**< Driver Type */ rte_dpaa2_probe_t probe; diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 37ab879779..0d61d49287 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -443,7 +443,6 @@ void rte_pci_register(struct rte_pci_driver *driver) { TAILQ_INSERT_TAIL(&rte_pci_bus.driver_list, driver, next); - driver->bus = &rte_pci_bus; } /* unregister a driver */ @@ -451,7 +450,6 @@ void rte_pci_unregister(struct rte_pci_driver *driver) { TAILQ_REMOVE(&rte_pci_bus.driver_list, driver, next); - driver->bus = NULL; } /* Add a device to PCI bus */ diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h index 1c6a8fdd7b..1913bc111c 100644 --- a/drivers/bus/pci/rte_bus_pci.h +++ b/drivers/bus/pci/rte_bus_pci.h @@ -161,7 +161,6 @@ typedef int (pci_dma_unmap_t)(struct rte_pci_device *dev, void *addr, struct rte_pci_driver { RTE_TAILQ_ENTRY(rte_pci_driver) next; /**< Next in list. */ struct rte_driver driver; /**< Inherit core driver. */ - struct rte_pci_bus *bus; /**< PCI bus reference. */ rte_pci_probe_t *probe; /**< Device probe function. */ rte_pci_remove_t *remove; /**< Device remove function. */ pci_dma_map_t *dma_map; /**< device dma map function. */ diff --git a/drivers/bus/vmbus/rte_bus_vmbus.h b/drivers/bus/vmbus/rte_bus_vmbus.h index 4421326fe8..8d6ba26028 100644 --- a/drivers/bus/vmbus/rte_bus_vmbus.h +++ b/drivers/bus/vmbus/rte_bus_vmbus.h @@ -34,7 +34,6 @@ extern "C" { /* Forward declarations */ struct rte_vmbus_device; struct rte_vmbus_driver; -struct rte_vmbus_bus; struct vmbus_channel; struct vmbus_mon_page; @@ -95,7 +94,6 @@ typedef int (vmbus_remove_t)(struct rte_vmbus_device *); struct rte_vmbus_driver { RTE_TAILQ_ENTRY(rte_vmbus_driver) next; /**< Next in list. */ struct rte_driver driver; - struct rte_vmbus_bus *bus; /**< VM bus reference. */ vmbus_probe_t *probe; /**< Device Probe function. */ vmbus_remove_t *remove; /**< Device Remove function. */ diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c index 367727367e..0f2d878126 100644 --- a/drivers/bus/vmbus/vmbus_common.c +++ b/drivers/bus/vmbus/vmbus_common.c @@ -235,7 +235,6 @@ rte_vmbus_register(struct rte_vmbus_driver *driver) "Registered driver %s", driver->driver.name); TAILQ_INSERT_TAIL(&rte_vmbus_bus.driver_list, driver, next); - driver->bus = &rte_vmbus_bus; } /* unregister vmbus driver */ @@ -243,7 +242,6 @@ void rte_vmbus_unregister(struct rte_vmbus_driver *driver) { TAILQ_REMOVE(&rte_vmbus_bus.driver_list, driver, next); - driver->bus = NULL; } /* Add a device to VMBUS bus */ From patchwork Sat Jul 9 08:26:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113867 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 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 From patchwork Sat Jul 9 08:26:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113868 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A3B25A00C5; Sat, 9 Jul 2022 10:28:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 74F1B42B84; Sat, 9 Jul 2022 10:28:10 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 34DDB40C35 for ; Sat, 9 Jul 2022 10:28:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355288; 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=uexBKq7sVFMmxMqA8al3VJ/upxES+r7iEgcdfm+ePaQ=; b=d4+LBlKWeLkN9TPj7X+fEUjruFYdennIBsFvHsqWxr+zuYgIUEZ/PvTVGAtoOO/5jguwTZ 04eN9aoBjX8FNGpSYFGzFrQZwOHRuLFHkiBaQna45p0uHj4PIe9OX25vp8KfdciLMjGmLw YDQLna1KRjSDh/eaXl/QuMOBKw1Vt1M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641--X3PKXBBMfCrjuUbTzA1yA-1; Sat, 09 Jul 2022 04:28:05 -0400 X-MC-Unique: -X3PKXBBMfCrjuUbTzA1yA-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 254138032F0; Sat, 9 Jul 2022 08:28:05 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 11D892026D64; Sat, 9 Jul 2022 08:28:03 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Aman Singh , Yuying Zhang , Anatoly Burakov , Ray Kinsella Subject: [RFC v2 v2 12/29] bus: introduce accessors Date: Sat, 9 Jul 2022 10:26:27 +0200 Message-Id: <20220709082644.664675-13-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 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 Add helpers to get a rte_bus object details. This will be used externally. Internal users may still dereference a rte_bus object. Signed-off-by: David Marchand --- Changes since RFC v1: - changed approach: only external users are updated, --- app/test-pmd/config.c | 6 ++--- app/test-pmd/testpmd.c | 4 +-- app/test-pmd/testpmd.h | 4 +-- app/test/test_devargs.c | 4 +-- examples/multi_process/hotplug_mp/commands.c | 4 +-- lib/eal/common/eal_common_bus.c | 26 ++++++++++++-------- lib/eal/include/rte_bus.h | 12 +++++++++ lib/eal/version.map | 3 +++ 8 files changed, 42 insertions(+), 21 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index 39bce480bf..bc154e8bf7 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -642,7 +642,7 @@ device_infos_display(const char *identifier) if (identifier && da.bus != next) continue; - snprintf(devstr, sizeof(devstr), "bus=%s", next->name); + snprintf(devstr, sizeof(devstr), "bus=%s", rte_bus_name(next)); RTE_DEV_FOREACH(dev, devstr, &dev_iter) { if (!dev->driver) @@ -653,7 +653,7 @@ device_infos_display(const char *identifier) continue; printf("\n%s Infos for device %s %s\n", info_border, dev->name, info_border); - printf("Bus name: %s", dev->bus->name); + printf("Bus name: %s", rte_bus_name(dev->bus)); printf("\nDriver name: %s", dev->driver->name); printf("\nDevargs: %s", dev->devargs ? dev->devargs->args : ""); @@ -1154,7 +1154,7 @@ port_reg_off_is_invalid(portid_t port_id, uint32_t reg_off) } bus = rte_bus_find_by_device(ports[port_id].dev_info.device); - if (bus && !strcmp(bus->name, "pci")) { + if (bus && !strcmp(rte_bus_name(bus), "pci")) { pci_dev = RTE_DEV_TO_PCI(ports[port_id].dev_info.device); } else { fprintf(stderr, "Not a PCI device\n"); diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index addcbcac85..51c2488b45 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -3507,9 +3507,9 @@ detach_devargs(char *identifier) } } - if (rte_eal_hotplug_remove(da.bus->name, da.name) != 0) { + if (rte_eal_hotplug_remove(rte_bus_name(da.bus), da.name) != 0) { TESTPMD_LOG(ERR, "Failed to detach device %s(%s)\n", - da.name, da.bus->name); + da.name, rte_bus_name(da.bus)); rte_devargs_reset(&da); return; } diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 8694c65539..59a8a429c5 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -819,7 +819,7 @@ port_pci_reg_read(struct rte_port *port, uint32_t reg_off) } bus = rte_bus_find_by_device(port->dev_info.device); - if (bus && !strcmp(bus->name, "pci")) { + if (bus && !strcmp(rte_bus_name(bus), "pci")) { pci_dev = RTE_DEV_TO_PCI(port->dev_info.device); } else { fprintf(stderr, "Not a PCI device\n"); @@ -847,7 +847,7 @@ port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v) } bus = rte_bus_find_by_device(port->dev_info.device); - if (bus && !strcmp(bus->name, "pci")) { + if (bus && !strcmp(rte_bus_name(bus), "pci")) { pci_dev = RTE_DEV_TO_PCI(port->dev_info.device); } else { fprintf(stderr, "Not a PCI device\n"); diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c index 16621285d2..ac5bc34c18 100644 --- a/app/test/test_devargs.c +++ b/app/test/test_devargs.c @@ -98,9 +98,9 @@ test_valid_devargs_cases(const struct devargs_case *list, size_t n) list[i].bus_kv) != 0) goto fail; if (list[i].bus != NULL && - strcmp(da.bus->name, list[i].bus) != 0) { + strcmp(rte_bus_name(da.bus), list[i].bus) != 0) { printf("rte_devargs_parse(%s) bus name (%s) not expected (%s)\n", - list[i].devargs, da.bus->name, list[i].bus); + list[i].devargs, rte_bus_name(da.bus), list[i].bus); goto fail; } if ((list[i].class_kv > 0 || list[i].class != NULL) && diff --git a/examples/multi_process/hotplug_mp/commands.c b/examples/multi_process/hotplug_mp/commands.c index da8b5e5924..88f44e00a0 100644 --- a/examples/multi_process/hotplug_mp/commands.c +++ b/examples/multi_process/hotplug_mp/commands.c @@ -126,7 +126,7 @@ static void cmd_dev_attach_parsed(void *parsed_result, return; } - if (!rte_eal_hotplug_add(da.bus->name, da.name, da.args)) + if (!rte_eal_hotplug_add(rte_bus_name(da.bus), da.name, da.args)) cmdline_printf(cl, "attached device %s\n", da.name); else cmdline_printf(cl, "failed to attached device %s\n", @@ -173,7 +173,7 @@ static void cmd_dev_detach_parsed(void *parsed_result, } printf("detaching...\n"); - if (!rte_eal_hotplug_remove(da.bus->name, da.name)) + if (!rte_eal_hotplug_remove(rte_bus_name(da.bus), da.name)) cmdline_printf(cl, "detached device %s\n", da.name); else diff --git a/lib/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c index baa5b532af..cbf382f967 100644 --- a/lib/eal/common/eal_common_bus.c +++ b/lib/eal/common/eal_common_bus.c @@ -16,11 +16,17 @@ static struct rte_bus_list rte_bus_list = TAILQ_HEAD_INITIALIZER(rte_bus_list); +const char * +rte_bus_name(const struct rte_bus *bus) +{ + return bus->name; +} + void rte_bus_register(struct rte_bus *bus) { RTE_VERIFY(bus); - RTE_VERIFY(bus->name && strlen(bus->name)); + RTE_VERIFY(rte_bus_name(bus) && strlen(rte_bus_name(bus))); /* A bus should mandatorily have the scan implemented */ RTE_VERIFY(bus->scan); RTE_VERIFY(bus->probe); @@ -29,14 +35,14 @@ rte_bus_register(struct rte_bus *bus) RTE_VERIFY(!bus->plug || bus->unplug); TAILQ_INSERT_TAIL(&rte_bus_list, bus, next); - RTE_LOG(DEBUG, EAL, "Registered [%s] bus.\n", bus->name); + RTE_LOG(DEBUG, EAL, "Registered [%s] bus.\n", rte_bus_name(bus)); } void rte_bus_unregister(struct rte_bus *bus) { TAILQ_REMOVE(&rte_bus_list, bus, next); - RTE_LOG(DEBUG, EAL, "Unregistered [%s] bus.\n", bus->name); + RTE_LOG(DEBUG, EAL, "Unregistered [%s] bus.\n", rte_bus_name(bus)); } /* Scan all the buses for registered devices */ @@ -50,7 +56,7 @@ rte_bus_scan(void) ret = bus->scan(); if (ret) RTE_LOG(ERR, EAL, "Scan for (%s) bus failed.\n", - bus->name); + rte_bus_name(bus)); } return 0; @@ -64,7 +70,7 @@ rte_bus_probe(void) struct rte_bus *bus, *vbus = NULL; TAILQ_FOREACH(bus, &rte_bus_list, next) { - if (!strcmp(bus->name, "vdev")) { + if (!strcmp(rte_bus_name(bus), "vdev")) { vbus = bus; continue; } @@ -72,14 +78,14 @@ rte_bus_probe(void) ret = bus->probe(); if (ret) RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", - bus->name); + rte_bus_name(bus)); } if (vbus) { ret = vbus->probe(); if (ret) RTE_LOG(ERR, EAL, "Bus (%s) probe failed.\n", - vbus->name); + rte_bus_name(vbus)); } return 0; @@ -92,7 +98,7 @@ bus_dump_one(FILE *f, struct rte_bus *bus) int ret; /* For now, dump only the bus name */ - ret = fprintf(f, " %s\n", bus->name); + ret = fprintf(f, " %s\n", rte_bus_name(bus)); /* Error in case of inability in writing to stream */ if (ret < 0) @@ -163,7 +169,7 @@ cmp_bus_name(const struct rte_bus *bus, const void *_name) { const char *name = _name; - return strcmp(bus->name, name); + return strcmp(rte_bus_name(bus), name); } struct rte_bus * @@ -213,7 +219,7 @@ rte_bus_get_iommu_class(void) bus_iova_mode = bus->get_iommu_class(); RTE_LOG(DEBUG, EAL, "Bus %s wants IOVA as '%s'\n", - bus->name, + rte_bus_name(bus), bus_iova_mode == RTE_IOVA_DC ? "DC" : (bus_iova_mode == RTE_IOVA_PA ? "PA" : "VA")); if (bus_iova_mode == RTE_IOVA_PA) diff --git a/lib/eal/include/rte_bus.h b/lib/eal/include/rte_bus.h index 17edaa37c9..2775e1ac66 100644 --- a/lib/eal/include/rte_bus.h +++ b/lib/eal/include/rte_bus.h @@ -266,6 +266,18 @@ struct rte_bus { }; +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * @param bus + * A pointer to a rte_bus structure. + * @return + * A pointer to the bus name string. + */ +__rte_experimental +const char *rte_bus_name(const struct rte_bus *bus); + /** * Register a Bus handler. * diff --git a/lib/eal/version.map b/lib/eal/version.map index c2a2cebf69..6f713c987d 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -424,6 +424,9 @@ EXPERIMENTAL { rte_thread_self; rte_thread_set_affinity_by_id; rte_thread_set_priority; + + # added in 22.11 + rte_bus_name; }; INTERNAL { From patchwork Sat Jul 9 08:26:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113870 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 47C81A00C5; Sat, 9 Jul 2022 10:28:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB5FE42B79; Sat, 9 Jul 2022 10:28:22 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 4779E40A81 for ; Sat, 9 Jul 2022 10:28:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355299; 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=bmPfDQqCkCJPKiD2X/f2rx0TOL01v0mC1PfqymYRBMs=; b=O8K2JQyV+8SIk/VY1HWO2Q4f5A8a70hzUeqtGYfFRxiQoKXVQK1+KP6qp6p/gr5bRHW6wS BDs4/nqjfc4DFY2GcY/R7laIRbgEyo175kgDnHkXKZ5JLZjudH5Fwi6jHLbMwRoniKLFHw A/FwvKvssoR9jGjb/Am/hFwwTplugyA= 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-629-FlpuYBd1PZiMoDDjzLxGNA-1; Sat, 09 Jul 2022 04:28:14 -0400 X-MC-Unique: FlpuYBd1PZiMoDDjzLxGNA-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 2485B3806720; Sat, 9 Jul 2022 08:28:13 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 20D9E2026D64; Sat, 9 Jul 2022 08:28:08 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Parav Pandit , Xueming Li , Hemant Agrawal , Sachin Saxena , Rosen Xu , Anatoly Burakov , Stephen Hemminger , Long Li , Matan Azrad , Viacheslav Ovsiienko , Bruce Richardson , Kevin Laatz , Chas Williams , "Min Hu (Connor)" , Gaetan Rivet , Maxime Coquelin , Chenbo Xia , Ray Kinsella , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Reshma Pattan Subject: [RFC v2 v2 13/29] bus: hide bus object Date: Sat, 9 Jul 2022 10:26:28 +0200 Message-Id: <20220709082644.664675-14-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 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 Make rte_bus opaque for non internal users. This will make extending this object possible without breaking the ABI. Introduce a new driver header and move rte_bus definition and helpers. Update drivers and library to use the internal header. Signed-off-by: David Marchand --- Changes since RFC v1: - update all existing users of the public header to use the internal one, --- app/test/test_devargs.c | 2 +- app/test/test_vdev.c | 2 +- drivers/bus/auxiliary/auxiliary_common.c | 2 +- drivers/bus/auxiliary/auxiliary_params.c | 2 +- drivers/bus/auxiliary/private.h | 2 +- drivers/bus/dpaa/dpaa_bus.c | 4 +- drivers/bus/fslmc/fslmc_bus.c | 2 +- drivers/bus/fslmc/private.h | 2 +- drivers/bus/ifpga/ifpga_bus.c | 2 +- drivers/bus/pci/linux/pci_vfio.c | 2 +- drivers/bus/pci/pci_common.c | 2 +- drivers/bus/pci/pci_params.c | 2 +- drivers/bus/pci/private.h | 2 +- drivers/bus/vdev/vdev.c | 2 +- drivers/bus/vmbus/private.h | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/dma/idxd/idxd_bus.c | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/failsafe/failsafe.c | 2 +- drivers/net/failsafe/failsafe_eal.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/netvsc/hn_ethdev.c | 2 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- drivers/net/virtio/virtio_pci.c | 2 +- drivers/raw/ioat/idxd_bus.c | 2 +- lib/eal/common/eal_common_bus.c | 2 +- lib/eal/common/eal_common_dev.c | 2 +- lib/eal/common/eal_common_devargs.c | 2 +- lib/eal/common/hotplug_mp.c | 2 +- lib/eal/include/bus_driver.h | 296 +++++++++++++++++++++++ lib/eal/include/meson.build | 4 + lib/eal/include/rte_bus.h | 275 +-------------------- lib/eal/linux/eal_dev.c | 2 +- lib/eal/version.map | 4 +- lib/ethdev/rte_ethdev.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 36 files changed, 338 insertions(+), 307 deletions(-) create mode 100644 lib/eal/include/bus_driver.h diff --git a/app/test/test_devargs.c b/app/test/test_devargs.c index ac5bc34c18..14a0b11fbe 100644 --- a/app/test/test_devargs.c +++ b/app/test/test_devargs.c @@ -6,10 +6,10 @@ #include #include +#include #include #include #include -#include #include #include "test.h" diff --git a/app/test/test_vdev.c b/app/test/test_vdev.c index 5eeff3106d..9e39993e90 100644 --- a/app/test/test_vdev.c +++ b/app/test/test_vdev.c @@ -6,9 +6,9 @@ #include #include +#include #include #include -#include #include #include "test.h" diff --git a/drivers/bus/auxiliary/auxiliary_common.c b/drivers/bus/auxiliary/auxiliary_common.c index 0b212f2d64..38d722e653 100644 --- a/drivers/bus/auxiliary/auxiliary_common.c +++ b/drivers/bus/auxiliary/auxiliary_common.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/bus/auxiliary/auxiliary_params.c b/drivers/bus/auxiliary/auxiliary_params.c index 9017118b36..542083dc89 100644 --- a/drivers/bus/auxiliary/auxiliary_params.c +++ b/drivers/bus/auxiliary/auxiliary_params.c @@ -4,7 +4,7 @@ #include -#include +#include #include #include #include diff --git a/drivers/bus/auxiliary/private.h b/drivers/bus/auxiliary/private.h index d97e8c694e..1e0e584039 100644 --- a/drivers/bus/auxiliary/private.h +++ b/drivers/bus/auxiliary/private.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include "rte_bus_auxiliary.h" diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index ad4ea156a6..ed3036a642 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -14,6 +14,8 @@ #include #include +#include +#include #include #include #include @@ -26,10 +28,8 @@ #include #include #include -#include #include #include -#include #include #include diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 8498f5321a..0b52c8e46c 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/bus/fslmc/private.h b/drivers/bus/fslmc/private.h index 80d4673ca8..f08dc7716b 100644 --- a/drivers/bus/fslmc/private.h +++ b/drivers/bus/fslmc/private.h @@ -5,7 +5,7 @@ #ifndef __PRIVATE_H__ #define __PRIVATE_H__ -#include +#include #include diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c index 5353dbdb01..d962fb8362 100644 --- a/drivers/bus/ifpga/ifpga_bus.c +++ b/drivers/bus/ifpga/ifpga_bus.c @@ -13,8 +13,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index cd0d0b1670..fab3483d9f 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 0d61d49287..c26aacd364 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c index 61a868707f..39d702a418 100644 --- a/drivers/bus/pci/pci_params.c +++ b/drivers/bus/pci/pci_params.c @@ -4,7 +4,7 @@ #include -#include +#include #include #include #include diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h index 6ccec15655..0cefed5edf 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 804486d3ba..ee569fcdf2 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -10,9 +10,9 @@ #include #include +#include #include #include -#include #include #include #include diff --git a/drivers/bus/vmbus/private.h b/drivers/bus/vmbus/private.h index 597ba18df9..600530c4f6 100644 --- a/drivers/bus/vmbus/private.h +++ b/drivers/bus/vmbus/private.h @@ -9,7 +9,7 @@ #include #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 e708e23a7f..838b62b81c 100644 --- a/drivers/common/mlx5/mlx5_common_pci.c +++ b/drivers/common/mlx5/mlx5_common_pci.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "mlx5_common_log.h" diff --git a/drivers/dma/idxd/idxd_bus.c b/drivers/dma/idxd/idxd_bus.c index 13cb967f6d..e30dcfc281 100644 --- a/drivers/dma/idxd/idxd_bus.c +++ b/drivers/dma/idxd/idxd_bus.c @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index b90757756a..cc3805baba 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -2,9 +2,9 @@ * Copyright(c) 2010-2014 Intel Corporation */ +#include #include #include -#include #include #include diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c index 3eb7d32b76..7fe77cfe8e 100644 --- a/drivers/net/failsafe/failsafe.c +++ b/drivers/net/failsafe/failsafe.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include "failsafe_private.h" diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c index 130344dce2..d71b512f81 100644 --- a/drivers/net/failsafe/failsafe_eal.c +++ b/drivers/net/failsafe/failsafe_eal.c @@ -3,7 +3,7 @@ * Copyright 2017 Mellanox Technologies, Ltd */ -#include +#include #include #include diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 04b9614f5c..6899f430cb 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index 308936ad9f..0aedecd358 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index 2587195168..9d65f75048 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -23,8 +23,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index 632451dcbe..9cf4d760b4 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -9,7 +9,7 @@ #endif #include -#include +#include #include "virtio_pci.h" #include "virtio_logs.h" diff --git a/drivers/raw/ioat/idxd_bus.c b/drivers/raw/ioat/idxd_bus.c index 539f51b1b1..f32d811055 100644 --- a/drivers/raw/ioat/idxd_bus.c +++ b/drivers/raw/ioat/idxd_bus.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include "ioat_private.h" diff --git a/lib/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c index cbf382f967..be64d31b0f 100644 --- a/lib/eal/common/eal_common_bus.c +++ b/lib/eal/common/eal_common_bus.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c index b6f0392f30..62a598957c 100644 --- a/lib/eal/common/eal_common_dev.c +++ b/lib/eal/common/eal_common_dev.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c index d5833af373..03e6e59baf 100644 --- a/lib/eal/common/eal_common_devargs.c +++ b/lib/eal/common/eal_common_devargs.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/eal/common/hotplug_mp.c b/lib/eal/common/hotplug_mp.c index 1614a57752..5202bd5658 100644 --- a/lib/eal/common/hotplug_mp.c +++ b/lib/eal/common/hotplug_mp.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/lib/eal/include/bus_driver.h b/lib/eal/include/bus_driver.h new file mode 100644 index 0000000000..d2e615a736 --- /dev/null +++ b/lib/eal/include/bus_driver.h @@ -0,0 +1,296 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Red Hat, Inc. + */ + +#ifndef BUS_DRIVER_H +#define BUS_DRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include +#include + +struct rte_devargs; +struct rte_device; + +/** Double linked list of buses */ +RTE_TAILQ_HEAD(rte_bus_list, rte_bus); + +/** + * Bus specific scan for devices attached on the bus. + * For each bus object, the scan would be responsible for finding devices and + * adding them to its private device list. + * + * A bus should mandatorily implement this method. + * + * @return + * 0 for successful scan + * <0 for unsuccessful scan with error value + */ +typedef int (*rte_bus_scan_t)(void); + +/** + * Implementation specific probe function which is responsible for linking + * devices on that bus with applicable drivers. + * + * This is called while iterating over each registered bus. + * + * @return + * 0 for successful probe + * !0 for any error while probing + */ +typedef int (*rte_bus_probe_t)(void); + +/** + * Device iterator to find a device on a bus. + * + * This function returns an rte_device if one of those held by the bus + * matches the data passed as parameter. + * + * If the comparison function returns zero this function should stop iterating + * over any more devices. To continue a search the device of a previous search + * can be passed via the start parameter. + * + * @param cmp + * Comparison function. + * + * @param data + * Data to compare each device against. + * + * @param start + * starting point for the iteration + * + * @return + * The first device matching the data, NULL if none exists. + */ +typedef struct rte_device * +(*rte_bus_find_device_t)(const struct rte_device *start, rte_dev_cmp_t cmp, + const void *data); + +/** + * Implementation specific probe function which is responsible for linking + * devices on that bus with applicable drivers. + * + * @param dev + * Device pointer that was returned by a previous call to find_device. + * + * @return + * 0 on success. + * !0 on error. + */ +typedef int (*rte_bus_plug_t)(struct rte_device *dev); + +/** + * Implementation specific remove function which is responsible for unlinking + * devices on that bus from assigned driver. + * + * @param dev + * Device pointer that was returned by a previous call to find_device. + * + * @return + * 0 on success. + * !0 on error. + */ +typedef int (*rte_bus_unplug_t)(struct rte_device *dev); + +/** + * Bus specific parsing function. + * Validates the syntax used in the textual representation of a device, + * If the syntax is valid and ``addr`` is not NULL, writes the bus-specific + * device representation to ``addr``. + * + * @param[in] name + * device textual description + * + * @param[out] addr + * device information location address, into which parsed info + * should be written. If NULL, nothing should be written, which + * is not an error. + * + * @return + * 0 if parsing was successful. + * !0 for any error. + */ +typedef int (*rte_bus_parse_t)(const char *name, void *addr); + +/** + * Parse bus part of the device arguments. + * + * The field name of the struct rte_devargs will be set. + * + * @param da + * Pointer to the devargs to parse. + * + * @return + * 0 on successful parsing, otherwise rte_errno is set. + * -EINVAL: on parsing error. + * -ENODEV: if no key matching a device argument is specified. + * -E2BIG: device name is too long. + */ +typedef int (*rte_bus_devargs_parse_t)(struct rte_devargs *da); + +/** + * Device level DMA map function. + * After a successful call, the memory segment will be mapped to the + * given device. + * + * @param dev + * Device pointer. + * @param addr + * Virtual address to map. + * @param iova + * IOVA address to map. + * @param len + * Length of the memory segment being mapped. + * + * @return + * 0 if mapping was successful. + * Negative value and rte_errno is set otherwise. + */ +typedef int (*rte_dev_dma_map_t)(struct rte_device *dev, void *addr, + uint64_t iova, size_t len); + +/** + * Device level DMA unmap function. + * After a successful call, the memory segment will no longer be + * accessible by the given device. + * + * @param dev + * Device pointer. + * @param addr + * Virtual address to unmap. + * @param iova + * IOVA address to unmap. + * @param len + * Length of the memory segment being mapped. + * + * @return + * 0 if un-mapping was successful. + * Negative value and rte_errno is set otherwise. + */ +typedef int (*rte_dev_dma_unmap_t)(struct rte_device *dev, void *addr, + uint64_t iova, size_t len); + +/** + * Implement a specific hot-unplug handler, which is responsible for + * handle the failure when device be hot-unplugged. When the event of + * hot-unplug be detected, it could call this function to handle + * the hot-unplug failure and avoid app crash. + * @param dev + * Pointer of the device structure. + * + * @return + * 0 on success. + * !0 on error. + */ +typedef int (*rte_bus_hot_unplug_handler_t)(struct rte_device *dev); + +/** + * Implement a specific sigbus handler, which is responsible for handling + * the sigbus error which is either original memory error, or specific memory + * error that caused of device be hot-unplugged. When sigbus error be captured, + * it could call this function to handle sigbus error. + * @param failure_addr + * Pointer of the fault address of the sigbus error. + * + * @return + * 0 for success handle the sigbus for hot-unplug. + * 1 for not process it, because it is a generic sigbus error. + * -1 for failed to handle the sigbus for hot-unplug. + */ +typedef int (*rte_bus_sigbus_handler_t)(const void *failure_addr); + +/** + * Bus scan policies + */ +enum rte_bus_scan_mode { + RTE_BUS_SCAN_UNDEFINED, + RTE_BUS_SCAN_ALLOWLIST, + RTE_BUS_SCAN_BLOCKLIST, +}; + +/** + * A structure used to configure bus operations. + */ +struct rte_bus_conf { + enum rte_bus_scan_mode scan_mode; /**< Scan policy. */ +}; + + +/** + * Get common iommu class of the all the devices on the bus. The bus may + * check that those devices are attached to iommu driver. + * If no devices are attached to the bus. The bus may return with don't care + * (_DC) value. + * Otherwise, The bus will return appropriate _pa or _va iova mode. + * + * @return + * enum rte_iova_mode value. + */ +typedef enum rte_iova_mode (*rte_bus_get_iommu_class_t)(void); + +/** + * A structure describing a generic bus. + */ +struct rte_bus { + RTE_TAILQ_ENTRY(rte_bus) next; /**< Next bus object in linked list */ + const char *name; /**< Name of the bus */ + rte_bus_scan_t scan; /**< Scan for devices attached to bus */ + rte_bus_probe_t probe; /**< Probe devices on bus */ + rte_bus_find_device_t find_device; /**< Find a device on the bus */ + rte_bus_plug_t plug; /**< Probe single device for drivers */ + rte_bus_unplug_t unplug; /**< Remove single device from driver */ + rte_bus_parse_t parse; /**< Parse a device name */ + rte_bus_devargs_parse_t devargs_parse; /**< Parse bus devargs */ + rte_dev_dma_map_t dma_map; /**< DMA map for device in the bus */ + rte_dev_dma_unmap_t dma_unmap; /**< DMA unmap for device in the bus */ + struct rte_bus_conf conf; /**< Bus configuration */ + rte_bus_get_iommu_class_t get_iommu_class; /**< Get iommu class */ + rte_dev_iterate_t dev_iterate; /**< Device iterator. */ + rte_bus_hot_unplug_handler_t hot_unplug_handler; + /**< handle hot-unplug failure on the bus */ + rte_bus_sigbus_handler_t sigbus_handler; + /**< handle sigbus error on the bus */ +}; + +/** + * Register a Bus handler. + * + * @param bus + * A pointer to a rte_bus structure describing the bus + * to be registered. + */ +__rte_internal +void rte_bus_register(struct rte_bus *bus); + +/** + * Helper for Bus registration. + * The constructor has higher priority than PMD constructors. + */ +#define RTE_REGISTER_BUS(nm, bus) \ +RTE_INIT_PRIO(businitfn_ ##nm, BUS) \ +{\ + (bus).name = RTE_STR(nm);\ + rte_bus_register(&bus); \ +} + +/** + * Unregister a Bus handler. + * + * @param bus + * A pointer to a rte_bus structure describing the bus + * to be unregistered. + */ +__rte_internal +void rte_bus_unregister(struct rte_bus *bus); + +#ifdef __cplusplus +} +#endif + +#endif /* BUS_DRIVER_H */ diff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build index fd6e844224..77d8621a51 100644 --- a/lib/eal/include/meson.build +++ b/lib/eal/include/meson.build @@ -55,6 +55,10 @@ headers += files( 'rte_vfio.h', ) +driver_sdk_headers = files( + 'bus_driver.h', +) + # special case install the generic headers, since they go in a subdir generic_headers = files( 'generic/rte_atomic.h', diff --git a/lib/eal/include/rte_bus.h b/lib/eal/include/rte_bus.h index 2775e1ac66..902a6c7c59 100644 --- a/lib/eal/include/rte_bus.h +++ b/lib/eal/include/rte_bus.h @@ -20,251 +20,11 @@ extern "C" { #include -#include +#include #include -#include -/** Double linked list of buses */ -RTE_TAILQ_HEAD(rte_bus_list, rte_bus); - -/** - * Bus specific scan for devices attached on the bus. - * For each bus object, the scan would be responsible for finding devices and - * adding them to its private device list. - * - * A bus should mandatorily implement this method. - * - * @return - * 0 for successful scan - * <0 for unsuccessful scan with error value - */ -typedef int (*rte_bus_scan_t)(void); - -/** - * Implementation specific probe function which is responsible for linking - * devices on that bus with applicable drivers. - * - * This is called while iterating over each registered bus. - * - * @return - * 0 for successful probe - * !0 for any error while probing - */ -typedef int (*rte_bus_probe_t)(void); - -/** - * Device iterator to find a device on a bus. - * - * This function returns an rte_device if one of those held by the bus - * matches the data passed as parameter. - * - * If the comparison function returns zero this function should stop iterating - * over any more devices. To continue a search the device of a previous search - * can be passed via the start parameter. - * - * @param cmp - * Comparison function. - * - * @param data - * Data to compare each device against. - * - * @param start - * starting point for the iteration - * - * @return - * The first device matching the data, NULL if none exists. - */ -typedef struct rte_device * -(*rte_bus_find_device_t)(const struct rte_device *start, rte_dev_cmp_t cmp, - const void *data); - -/** - * Implementation specific probe function which is responsible for linking - * devices on that bus with applicable drivers. - * - * @param dev - * Device pointer that was returned by a previous call to find_device. - * - * @return - * 0 on success. - * !0 on error. - */ -typedef int (*rte_bus_plug_t)(struct rte_device *dev); - -/** - * Implementation specific remove function which is responsible for unlinking - * devices on that bus from assigned driver. - * - * @param dev - * Device pointer that was returned by a previous call to find_device. - * - * @return - * 0 on success. - * !0 on error. - */ -typedef int (*rte_bus_unplug_t)(struct rte_device *dev); - -/** - * Bus specific parsing function. - * Validates the syntax used in the textual representation of a device, - * If the syntax is valid and ``addr`` is not NULL, writes the bus-specific - * device representation to ``addr``. - * - * @param[in] name - * device textual description - * - * @param[out] addr - * device information location address, into which parsed info - * should be written. If NULL, nothing should be written, which - * is not an error. - * - * @return - * 0 if parsing was successful. - * !0 for any error. - */ -typedef int (*rte_bus_parse_t)(const char *name, void *addr); - -/** - * Parse bus part of the device arguments. - * - * The field name of the struct rte_devargs will be set. - * - * @param da - * Pointer to the devargs to parse. - * - * @return - * 0 on successful parsing, otherwise rte_errno is set. - * -EINVAL: on parsing error. - * -ENODEV: if no key matching a device argument is specified. - * -E2BIG: device name is too long. - */ -typedef int (*rte_bus_devargs_parse_t)(struct rte_devargs *da); - -/** - * Device level DMA map function. - * After a successful call, the memory segment will be mapped to the - * given device. - * - * @param dev - * Device pointer. - * @param addr - * Virtual address to map. - * @param iova - * IOVA address to map. - * @param len - * Length of the memory segment being mapped. - * - * @return - * 0 if mapping was successful. - * Negative value and rte_errno is set otherwise. - */ -typedef int (*rte_dev_dma_map_t)(struct rte_device *dev, void *addr, - uint64_t iova, size_t len); - -/** - * Device level DMA unmap function. - * After a successful call, the memory segment will no longer be - * accessible by the given device. - * - * @param dev - * Device pointer. - * @param addr - * Virtual address to unmap. - * @param iova - * IOVA address to unmap. - * @param len - * Length of the memory segment being mapped. - * - * @return - * 0 if un-mapping was successful. - * Negative value and rte_errno is set otherwise. - */ -typedef int (*rte_dev_dma_unmap_t)(struct rte_device *dev, void *addr, - uint64_t iova, size_t len); - -/** - * Implement a specific hot-unplug handler, which is responsible for - * handle the failure when device be hot-unplugged. When the event of - * hot-unplug be detected, it could call this function to handle - * the hot-unplug failure and avoid app crash. - * @param dev - * Pointer of the device structure. - * - * @return - * 0 on success. - * !0 on error. - */ -typedef int (*rte_bus_hot_unplug_handler_t)(struct rte_device *dev); - -/** - * Implement a specific sigbus handler, which is responsible for handling - * the sigbus error which is either original memory error, or specific memory - * error that caused of device be hot-unplugged. When sigbus error be captured, - * it could call this function to handle sigbus error. - * @param failure_addr - * Pointer of the fault address of the sigbus error. - * - * @return - * 0 for success handle the sigbus for hot-unplug. - * 1 for not process it, because it is a generic sigbus error. - * -1 for failed to handle the sigbus for hot-unplug. - */ -typedef int (*rte_bus_sigbus_handler_t)(const void *failure_addr); - -/** - * Bus scan policies - */ -enum rte_bus_scan_mode { - RTE_BUS_SCAN_UNDEFINED, - RTE_BUS_SCAN_ALLOWLIST, - RTE_BUS_SCAN_BLOCKLIST, -}; - -/** - * A structure used to configure bus operations. - */ -struct rte_bus_conf { - enum rte_bus_scan_mode scan_mode; /**< Scan policy. */ -}; - - -/** - * Get common iommu class of the all the devices on the bus. The bus may - * check that those devices are attached to iommu driver. - * If no devices are attached to the bus. The bus may return with don't care - * (_DC) value. - * Otherwise, The bus will return appropriate _pa or _va iova mode. - * - * @return - * enum rte_iova_mode value. - */ -typedef enum rte_iova_mode (*rte_bus_get_iommu_class_t)(void); - - -/** - * A structure describing a generic bus. - */ -struct rte_bus { - RTE_TAILQ_ENTRY(rte_bus) next; /**< Next bus object in linked list */ - const char *name; /**< Name of the bus */ - rte_bus_scan_t scan; /**< Scan for devices attached to bus */ - rte_bus_probe_t probe; /**< Probe devices on bus */ - rte_bus_find_device_t find_device; /**< Find a device on the bus */ - rte_bus_plug_t plug; /**< Probe single device for drivers */ - rte_bus_unplug_t unplug; /**< Remove single device from driver */ - rte_bus_parse_t parse; /**< Parse a device name */ - rte_bus_devargs_parse_t devargs_parse; /**< Parse bus devargs */ - rte_dev_dma_map_t dma_map; /**< DMA map for device in the bus */ - rte_dev_dma_unmap_t dma_unmap; /**< DMA unmap for device in the bus */ - struct rte_bus_conf conf; /**< Bus configuration */ - rte_bus_get_iommu_class_t get_iommu_class; /**< Get iommu class */ - rte_dev_iterate_t dev_iterate; /**< Device iterator. */ - rte_bus_hot_unplug_handler_t hot_unplug_handler; - /**< handle hot-unplug failure on the bus */ - rte_bus_sigbus_handler_t sigbus_handler; - /**< handle sigbus error on the bus */ - -}; +struct rte_bus; +struct rte_device; /** * @warning @@ -278,24 +38,6 @@ struct rte_bus { __rte_experimental const char *rte_bus_name(const struct rte_bus *bus); -/** - * Register a Bus handler. - * - * @param bus - * A pointer to a rte_bus structure describing the bus - * to be registered. - */ -void rte_bus_register(struct rte_bus *bus); - -/** - * Unregister a Bus handler. - * - * @param bus - * A pointer to a rte_bus structure describing the bus - * to be unregistered. - */ -void rte_bus_unregister(struct rte_bus *bus); - /** * Scan all the buses. * @@ -385,17 +127,6 @@ struct rte_bus *rte_bus_find_by_name(const char *busname); */ enum rte_iova_mode rte_bus_get_iommu_class(void); -/** - * Helper for Bus registration. - * The constructor has higher priority than PMD constructors. - */ -#define RTE_REGISTER_BUS(nm, bus) \ -RTE_INIT_PRIO(businitfn_ ##nm, BUS) \ -{\ - (bus).name = RTE_STR(nm);\ - rte_bus_register(&bus); \ -} - #ifdef __cplusplus } #endif diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c index 02ae1cde29..b5eab93fbf 100644 --- a/lib/eal/linux/eal_dev.c +++ b/lib/eal/linux/eal_dev.c @@ -8,12 +8,12 @@ #include #include +#include #include #include #include #include #include -#include #include #include diff --git a/lib/eal/version.map b/lib/eal/version.map index 6f713c987d..48c8a2f511 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -13,9 +13,7 @@ DPDK_22 { rte_bus_find_by_name; rte_bus_get_iommu_class; rte_bus_probe; - rte_bus_register; rte_bus_scan; - rte_bus_unregister; rte_calloc; rte_calloc_socket; rte_cpu_get_flag_enabled; @@ -432,6 +430,8 @@ EXPERIMENTAL { INTERNAL { global: + rte_bus_register; + rte_bus_unregister; rte_eal_get_baseaddr; rte_firmware_read; rte_intr_allow_others; diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c index ebbe8cca3d..9eba97f2d2 100644 --- a/lib/ethdev/rte_ethdev.c +++ b/lib/ethdev/rte_ethdev.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c index 5b079cd14a..72aabd4dd0 100644 --- a/lib/pcapng/rte_pcapng.c +++ b/lib/pcapng/rte_pcapng.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include From patchwork Sat Jul 9 08:26:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113869 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9550BA00C5; Sat, 9 Jul 2022 10:28:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE3474282E; Sat, 9 Jul 2022 10:28:20 +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 3DE434280C for ; Sat, 9 Jul 2022 10:28:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355298; 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=1DM/VZRHAxui6OfW/riufGlEYxZ8W7EQFcuvmKy0uj0=; b=TBdUqSw1grtfTTlx+tlCh7bUJY1R6DRS19iAvwoJV5CSmXliHrDczOi+SNlGQ+3Z3zdQJ0 zE49aG60IpA+EYPaOjzpm5651uJdsQXDeXYDC1EL3klvgSVXZ4IXZB2avMSSydbJysxK76 9198NciHeMSAGBx1Z8/LXC8/Da6AtMA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-586-_DX7E0AgMSykujJSYQrjWA-1; Sat, 09 Jul 2022 04:28:17 -0400 X-MC-Unique: _DX7E0AgMSykujJSYQrjWA-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 6277C101E98A; Sat, 9 Jul 2022 08:28:17 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id BEF1C2026D64; Sat, 9 Jul 2022 08:28:16 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Nicolas Chautru Subject: [RFC v2 v2 14/29] bbdev: mark driver header Date: Sat, 9 Jul 2022 10:26:29 +0200 Message-Id: <20220709082644.664675-15-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 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 rte_bbdev_pmd.h is a driver only header. Signed-off-by: David Marchand --- lib/bbdev/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/bbdev/meson.build b/lib/bbdev/meson.build index 07685e7578..7d035065f1 100644 --- a/lib/bbdev/meson.build +++ b/lib/bbdev/meson.build @@ -8,7 +8,6 @@ if is_windows endif sources = files('rte_bbdev.c') -headers = files('rte_bbdev.h', - 'rte_bbdev_pmd.h', - 'rte_bbdev_op.h') +headers = files('rte_bbdev.h', 'rte_bbdev_op.h') +driver_sdk_headers = files('rte_bbdev_pmd.h') deps += ['mbuf'] From patchwork Sat Jul 9 08:26:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113871 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C389CA00C5; Sat, 9 Jul 2022 10:28:43 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8A27A42B71; Sat, 9 Jul 2022 10:28:27 +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 294EE42B6D for ; Sat, 9 Jul 2022 10:28:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355305; 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=dDochzAnh5A0t8pEcOLEWp1Lo4KB9zT3FS/k1jJRteQ=; b=WUIxlZHtqLMCoiHBhPUF7pF7ut21J37YrXqz1xFHo6s3Zn3h96dRVgtZoUbcC/vyCg+jPL LYxq8H6RibOzni3TyiWEG+sQ9NII4hiXI2U3j5EatMR7cDhl0KLbPu06OnpMWZh98ODd2A CGH3z+DKJgbCCzzCNQuLjH4vA0KjgU0= 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-614-InoCnK12MeePd9GxFJ8GcQ-1; Sat, 09 Jul 2022 04:28:22 -0400 X-MC-Unique: InoCnK12MeePd9GxFJ8GcQ-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 C2EA73806738; Sat, 9 Jul 2022 08:28:21 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8A26F2026D64; Sat, 9 Jul 2022 08:28:20 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: stable@dpdk.org, Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko , Tyler Retzlaff Subject: [RFC v2 v2 15/29] ethdev: mark some headers as driver only Date: Sat, 9 Jul 2022 10:26:30 +0200 Message-Id: <20220709082644.664675-16-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 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 Those headers are for drivers as they include ethdev_driver.h, a driver-only header. Fixes: 19cc526d6c79 ("ethdev: install driver headers") Cc: stable@dpdk.org Signed-off-by: David Marchand --- lib/ethdev/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ethdev/meson.build b/lib/ethdev/meson.build index 47bb2625b0..c25762ce66 100644 --- a/lib/ethdev/meson.build +++ b/lib/ethdev/meson.build @@ -24,11 +24,8 @@ headers = files( 'rte_ethdev_trace_fp.h', 'rte_dev_info.h', 'rte_flow.h', - 'rte_flow_driver.h', 'rte_mtr.h', - 'rte_mtr_driver.h', 'rte_tm.h', - 'rte_tm_driver.h', ) indirect_headers += files( @@ -40,6 +37,9 @@ driver_sdk_headers += files( 'ethdev_driver.h', 'ethdev_pci.h', 'ethdev_vdev.h', + 'rte_flow_driver.h', + 'rte_mtr_driver.h', + 'rte_tm_driver.h', ) deps += ['net', 'kvargs', 'meter', 'telemetry'] From patchwork Sat Jul 9 08:26:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113873 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 18121A00C5; Sat, 9 Jul 2022 10:28:55 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C5F2842829; Sat, 9 Jul 2022 10:28:35 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id C898642B73 for ; Sat, 9 Jul 2022 10:28:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355312; 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=c4THCdi4CnEWnmtzqe87PFAohPGzcY/yBqbQ2mVgVus=; b=W4LB1ZTHO2C6d2kqm7HddrA8g2W5hd+lHnUNPae5hEUe2hQLGvaEeME8S/735TTEFfiykf Onn46bNs9nT0qOScqSacEMKlAKRg/n79ixUWAdPQ68Xv5AmfV6wkg3oJl+24PaO79NnudP TzD9J0k3EIQotJndwMuTZrq4Q5Li5p8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-257-ryLOo4JZP9OsDgONz8jFng-1; Sat, 09 Jul 2022 04:28:26 -0400 X-MC-Unique: ryLOo4JZP9OsDgONz8jFng-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 373A78032F6; Sat, 9 Jul 2022 08:28:26 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6F2922026D64; Sat, 9 Jul 2022 08:28:25 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Sachin Saxena , Hemant Agrawal Subject: [RFC v2 v2 16/29] rawdev: mark driver header Date: Sat, 9 Jul 2022 10:26:31 +0200 Message-Id: <20220709082644.664675-17-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 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 rte_rawdev_pmd.h is a driver only header. Signed-off-by: David Marchand --- lib/rawdev/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/rawdev/meson.build b/lib/rawdev/meson.build index 7dfc3d5cf9..ccfd922fda 100644 --- a/lib/rawdev/meson.build +++ b/lib/rawdev/meson.build @@ -8,6 +8,7 @@ if is_windows endif sources = files('rte_rawdev.c') -headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h') +headers = files('rte_rawdev.h') +driver_sdk_headers = files('rte_rawdev_pmd.h') deps += ['telemetry'] From patchwork Sat Jul 9 08:26:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113872 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id D7DF3A00C5; Sat, 9 Jul 2022 10:28:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C517142B72; Sat, 9 Jul 2022 10:28: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 AA4A642B6C for ; Sat, 9 Jul 2022 10:28:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355311; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KkQ1nh9ZKE99xj2zAxXJmvb7JJ9N3vrmLvKm17oXnQI=; b=KRFmjmm/XBMPYZ5wMycOs/+sx4WvdfLfPELxCvtQT1h2j9+JXZbJurno7ysnUKd3lL4KMV /xbHiwqi55yDFU50kSAoeqM4gLr40DJgFFPH9AL0JIYpwTBUOncobJPxe+viIMnvxMH9vR 4Hv/MUA7cJwaYBclSJTVHNcwfQnhtwY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-240-a6F_R9QxPceJEveOsK2NXg-1; Sat, 09 Jul 2022 04:28:30 -0400 X-MC-Unique: a6F_R9QxPceJEveOsK2NXg-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 B579C8032F1 for ; Sat, 9 Jul 2022 08:28:29 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 408222026D64 for ; Sat, 9 Jul 2022 08:28:29 +0000 (UTC) From: David Marchand To: dev@dpdk.org Subject: [RFC v2 v2 17/29] drivers: export drivers headers Date: Sat, 9 Jul 2022 10:26:32 +0200 Message-Id: <20220709082644.664675-18-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 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 Same as for device classes, external DPDK users may need to include some bus headers for their out of tree drivers. Signed-off-by: David Marchand --- drivers/meson.build | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/meson.build b/drivers/meson.build index b22c2adda7..7449643fa9 100644 --- a/drivers/meson.build +++ b/drivers/meson.build @@ -89,6 +89,7 @@ foreach subpath:subdirs name = drv sources = [] headers = [] + driver_sdk_headers = [] # public headers included by drivers objs = [] cflags = default_cflags includes = [include_directories(drv_path)] @@ -158,6 +159,9 @@ foreach subpath:subdirs dpdk_extra_ldflags += pkgconfig_extra_libs install_headers(headers) + if get_option('enable_driver_sdk') + install_headers(driver_sdk_headers) + endif # generate pmdinfo sources by building a temporary # lib and then running pmdinfogen on the contents of From patchwork Sat Jul 9 08:26:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113874 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9F6C4A00C5; Sat, 9 Jul 2022 10:29:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D4E0B406B4; Sat, 9 Jul 2022 10:28:39 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 8C00E40A7B for ; Sat, 9 Jul 2022 10:28:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355318; 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=oTGlU7MRrYFfFkm+2GswUNIjA01j/4V2ErtzDjew0JA=; b=ibGcTdiDzWA8cWpN3MY9WxYPShDuhRGmHMDx8s6WO83ejgXKSR6rHcLEWhPQiB7W7WJo2m 74aKXQhUcPnMdToQrvqPlgxvjSK0gKmrkHMfL7Dsm0jZsPiFWrcn1VcAgyIl6rDm+fpHJP CE83yhFWHEVFYicj5NNGN3nYwJVLSPE= 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-491-wbQyA4lNNmKaXnweFZqfXA-1; Sat, 09 Jul 2022 04:28:34 -0400 X-MC-Unique: wbQyA4lNNmKaXnweFZqfXA-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 3406C3C02B75; Sat, 9 Jul 2022 08:28:34 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id F22CB2026D64; Sat, 9 Jul 2022 08:28:32 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Parav Pandit , Xueming Li , Ray Kinsella , Matan Azrad , Viacheslav Ovsiienko Subject: [RFC v2 v2 18/29] bus/auxiliary: make driver-only headers private Date: Sat, 9 Jul 2022 10:26:33 +0200 Message-Id: <20220709082644.664675-19-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 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 auxiliary 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/auxiliary/auxiliary_common.c | 1 - drivers/bus/auxiliary/auxiliary_params.c | 1 - ...rte_bus_auxiliary.h => bus_auxiliary_driver.h} | 15 ++++++++------- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/auxiliary/meson.build | 4 +--- drivers/bus/auxiliary/private.h | 2 +- drivers/bus/auxiliary/version.map | 3 +-- drivers/common/mlx5/linux/mlx5_common_auxiliary.c | 2 +- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/common/mlx5/mlx5_common_private.h | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- 11 files changed, 15 insertions(+), 20 deletions(-) rename drivers/bus/auxiliary/{rte_bus_auxiliary.h => bus_auxiliary_driver.h} (94%) diff --git a/drivers/bus/auxiliary/auxiliary_common.c b/drivers/bus/auxiliary/auxiliary_common.c index 38d722e653..259ff152c4 100644 --- a/drivers/bus/auxiliary/auxiliary_common.c +++ b/drivers/bus/auxiliary/auxiliary_common.c @@ -23,7 +23,6 @@ #include #include "private.h" -#include "rte_bus_auxiliary.h" static struct rte_devargs * auxiliary_devargs_lookup(const char *name) diff --git a/drivers/bus/auxiliary/auxiliary_params.c b/drivers/bus/auxiliary/auxiliary_params.c index 542083dc89..a889e392c6 100644 --- a/drivers/bus/auxiliary/auxiliary_params.c +++ b/drivers/bus/auxiliary/auxiliary_params.c @@ -10,7 +10,6 @@ #include #include "private.h" -#include "rte_bus_auxiliary.h" enum auxiliary_params { RTE_AUXILIARY_PARAM_NAME, diff --git a/drivers/bus/auxiliary/rte_bus_auxiliary.h b/drivers/bus/auxiliary/bus_auxiliary_driver.h similarity index 94% rename from drivers/bus/auxiliary/rte_bus_auxiliary.h rename to drivers/bus/auxiliary/bus_auxiliary_driver.h index 3b3dbc866a..44bacc3c0e 100644 --- a/drivers/bus/auxiliary/rte_bus_auxiliary.h +++ b/drivers/bus/auxiliary/bus_auxiliary_driver.h @@ -22,6 +22,7 @@ extern "C" { #include #include +#include #include #include #include @@ -41,7 +42,7 @@ struct rte_auxiliary_device; * @return * Whether the driver can handle the auxiliary device. */ -typedef bool(rte_auxiliary_match_t)(const char *name); +typedef bool (rte_auxiliary_match_t)(const char *name); /** * Initialization function for the driver called during auxiliary probing. @@ -54,8 +55,8 @@ typedef bool(rte_auxiliary_match_t)(const char *name); * - 0 On success. * - Negative value and rte_errno is set otherwise. */ -typedef int(rte_auxiliary_probe_t)(struct rte_auxiliary_driver *drv, - struct rte_auxiliary_device *dev); +typedef int (rte_auxiliary_probe_t)(struct rte_auxiliary_driver *drv, + struct rte_auxiliary_device *dev); /** * Uninitialization function for the driver called during hotplugging. @@ -85,7 +86,7 @@ typedef int (rte_auxiliary_remove_t)(struct rte_auxiliary_device *dev); * - Negative value and rte_errno is set otherwise. */ typedef int (rte_auxiliary_dma_map_t)(struct rte_auxiliary_device *dev, - void *addr, uint64_t iova, size_t len); + void *addr, uint64_t iova, size_t len); /** * Driver-specific DMA un-mapping. After a successful call the device @@ -104,7 +105,7 @@ typedef int (rte_auxiliary_dma_map_t)(struct rte_auxiliary_device *dev, * - Negative value and rte_errno is set otherwise. */ typedef int (rte_auxiliary_dma_unmap_t)(struct rte_auxiliary_device *dev, - void *addr, uint64_t iova, size_t len); + void *addr, uint64_t iova, size_t len); /** * A structure describing an auxiliary device. @@ -157,7 +158,7 @@ struct rte_auxiliary_driver { * A pointer to a rte_auxiliary_driver structure describing the driver * to be registered. */ -__rte_experimental +__rte_internal void rte_auxiliary_register(struct rte_auxiliary_driver *driver); /** Helper for auxiliary device registration from driver instance */ @@ -179,7 +180,7 @@ void rte_auxiliary_register(struct rte_auxiliary_driver *driver); * A pointer to a rte_auxiliary_driver structure describing the driver * to be unregistered. */ -__rte_experimental +__rte_internal void rte_auxiliary_unregister(struct rte_auxiliary_driver *driver); #ifdef __cplusplus diff --git a/drivers/bus/auxiliary/linux/auxiliary.c b/drivers/bus/auxiliary/linux/auxiliary.c index 28092e31c4..d4c564cd78 100644 --- a/drivers/bus/auxiliary/linux/auxiliary.c +++ b/drivers/bus/auxiliary/linux/auxiliary.c @@ -11,7 +11,6 @@ #include #include -#include "../rte_bus_auxiliary.h" #include "../private.h" #define AUXILIARY_SYSFS_PATH "/sys/bus/auxiliary/devices" diff --git a/drivers/bus/auxiliary/meson.build b/drivers/bus/auxiliary/meson.build index e2b356f8d2..fcb1a349c4 100644 --- a/drivers/bus/auxiliary/meson.build +++ b/drivers/bus/auxiliary/meson.build @@ -1,9 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2021 NVIDIA Corporation & Affiliates -headers = files( - 'rte_bus_auxiliary.h', -) +driver_sdk_headers += files('bus_auxiliary_driver.h') sources = files( 'auxiliary_common.c', 'auxiliary_params.c', diff --git a/drivers/bus/auxiliary/private.h b/drivers/bus/auxiliary/private.h index 1e0e584039..3dee13e1d1 100644 --- a/drivers/bus/auxiliary/private.h +++ b/drivers/bus/auxiliary/private.h @@ -11,7 +11,7 @@ #include -#include "rte_bus_auxiliary.h" +#include "bus_auxiliary_driver.h" extern int auxiliary_bus_logtype; diff --git a/drivers/bus/auxiliary/version.map b/drivers/bus/auxiliary/version.map index dc993e84ff..e9322e0b11 100644 --- a/drivers/bus/auxiliary/version.map +++ b/drivers/bus/auxiliary/version.map @@ -1,7 +1,6 @@ -EXPERIMENTAL { +INTERNAL { global: - # added in 21.08 rte_auxiliary_register; rte_auxiliary_unregister; diff --git a/drivers/common/mlx5/linux/mlx5_common_auxiliary.c b/drivers/common/mlx5/linux/mlx5_common_auxiliary.c index a182a8bdde..33479ffd68 100644 --- a/drivers/common/mlx5/linux/mlx5_common_auxiliary.c +++ b/drivers/common/mlx5/linux/mlx5_common_auxiliary.c @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include "eal_filesystem.h" diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c index c57e1918d2..b42102e84c 100644 --- a/drivers/common/mlx5/linux/mlx5_common_os.c +++ b/drivers/common/mlx5/linux/mlx5_common_os.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include "mlx5_common.h" #include "mlx5_nl.h" diff --git a/drivers/common/mlx5/mlx5_common_private.h b/drivers/common/mlx5/mlx5_common_private.h index 04c0af3763..12a5bdb41b 100644 --- a/drivers/common/mlx5/mlx5_common_private.h +++ b/drivers/common/mlx5/mlx5_common_private.h @@ -6,7 +6,7 @@ #define MLX5_COMMON_PRIVATE_H #include -#include +#include #include "mlx5_common.h" diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 6899f430cb..62f654d18e 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include From patchwork Sat Jul 9 08:26:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113875 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B4F29A00C5; Sat, 9 Jul 2022 10:29:05 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D66A242826; Sat, 9 Jul 2022 10:28:43 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id EC40E410F2 for ; Sat, 9 Jul 2022 10:28:40 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355320; 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=KzddQPWFrPE8AEv5E9tuEsm5F2RSf0L1tQkn5T7kJb0=; b=E7N/aouTqFMuC8xtM1gvvXikrlWzeOrAdsX9itSOrLxkmBVkpehxhA1P5JKdweBSCEIcEI aSuGzdQTonEjQn0vbKvM7g9AegTfKqWBrrEFGTFCXxbHRtZiLl81ujs8yZFWIme70Rodk+ 2685tvTXwF5AWnDZB/TrvNfhSrWbEt4= 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-543-i3Ps11LwNO6a_pq12A6a7w-1; Sat, 09 Jul 2022 04:28:38 -0400 X-MC-Unique: i3Ps11LwNO6a_pq12A6a7w-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 59F4C3C025B4; Sat, 9 Jul 2022 08:28:38 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6CF0F2026D64; Sat, 9 Jul 2022 08:28:37 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Hemant Agrawal , Sachin Saxena , Gagandeep Singh Subject: [RFC v2 v2 19/29] bus/dpaa: make driver-only headers private Date: Sat, 9 Jul 2022 10:26:34 +0200 Message-Id: <20220709082644.664675-20-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 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 dpaa 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/dpaa/base/qbman/qman.c | 2 +- drivers/bus/dpaa/{rte_dpaa_bus.h => bus_dpaa_driver.h} | 9 ++++++--- drivers/bus/dpaa/dpaa_bus.c | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c | 2 +- drivers/dma/dpaa/dpaa_qdma.c | 2 +- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/mempool/dpaa/dpaa_mempool.h | 2 +- drivers/net/dpaa/dpaa_ethdev.c | 2 +- drivers/net/dpaa/dpaa_rxtx.c | 2 +- 10 files changed, 15 insertions(+), 12 deletions(-) rename drivers/bus/dpaa/{rte_dpaa_bus.h => bus_dpaa_driver.h} (97%) diff --git a/drivers/bus/dpaa/base/qbman/qman.c b/drivers/bus/dpaa/base/qbman/qman.c index 447c091770..3949bf8712 100644 --- a/drivers/bus/dpaa/base/qbman/qman.c +++ b/drivers/bus/dpaa/base/qbman/qman.c @@ -7,7 +7,7 @@ #include "qman.h" #include -#include +#include #include #include diff --git a/drivers/bus/dpaa/rte_dpaa_bus.h b/drivers/bus/dpaa/bus_dpaa_driver.h similarity index 97% rename from drivers/bus/dpaa/rte_dpaa_bus.h rename to drivers/bus/dpaa/bus_dpaa_driver.h index 69c759c68b..4360295335 100644 --- a/drivers/bus/dpaa/rte_dpaa_bus.h +++ b/drivers/bus/dpaa/bus_dpaa_driver.h @@ -3,9 +3,10 @@ * Copyright 2017-2022 NXP * */ -#ifndef __RTE_DPAA_BUS_H__ -#define __RTE_DPAA_BUS_H__ +#ifndef BUS_DPAA_DRIVER_H +#define BUS_DPAA_DRIVER_H +#include #include #include #include @@ -152,6 +153,7 @@ extern struct dpaa_memseg_list rte_dpaa_memsegs; /* Either iterate over the list of internal memseg references or fallback to * EAL memseg based iova2virt. */ +__rte_internal static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr) { struct dpaa_memseg *ms; @@ -178,6 +180,7 @@ static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr) return va; } +__rte_internal static inline rte_iova_t rte_dpaa_mem_vtop(void *vaddr) { @@ -249,4 +252,4 @@ struct fm_eth_port_cfg *dpaa_get_eth_port_cfg(int dev_id); } #endif -#endif /* __RTE_DPAA_BUS_H__ */ +#endif /* BUS_DPAA_DRIVER_H */ diff --git a/drivers/bus/dpaa/dpaa_bus.c b/drivers/bus/dpaa/dpaa_bus.c index ed3036a642..4b6473674f 100644 --- a/drivers/bus/dpaa/dpaa_bus.c +++ b/drivers/bus/dpaa/dpaa_bus.c @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 05415dbf3b..7e554cb2b1 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -41,7 +41,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c b/drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c index d081953e26..29c5935739 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/dma/dpaa/dpaa_qdma.c b/drivers/dma/dpaa/dpaa_qdma.c index 9386fe5698..10e65ef1d7 100644 --- a/drivers/dma/dpaa/dpaa_qdma.c +++ b/drivers/dma/dpaa/dpaa_qdma.c @@ -2,7 +2,7 @@ * Copyright 2021 NXP */ -#include +#include #include #include "dpaa_qdma.h" diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c index ff6cc0be18..aa403f9e06 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/mempool/dpaa/dpaa_mempool.h b/drivers/mempool/dpaa/dpaa_mempool.h index dc0058e6dd..3f0eafa7dd 100644 --- a/drivers/mempool/dpaa/dpaa_mempool.h +++ b/drivers/mempool/dpaa/dpaa_mempool.h @@ -14,7 +14,7 @@ #include -#include +#include #include #include diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c index e5a072cf49..f21cbba0d9 100644 --- a/drivers/net/dpaa/dpaa_ethdev.c +++ b/drivers/net/dpaa/dpaa_ethdev.c @@ -33,7 +33,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/net/dpaa/dpaa_rxtx.c b/drivers/net/dpaa/dpaa_rxtx.c index 956fe946fa..20b75efb63 100644 --- a/drivers/net/dpaa/dpaa_rxtx.c +++ b/drivers/net/dpaa/dpaa_rxtx.c @@ -37,7 +37,7 @@ #include "dpaa_ethdev.h" #include "dpaa_rxtx.h" -#include +#include #include #include From patchwork Sat Jul 9 08:26:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113876 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2B13BA00C5; Sat, 9 Jul 2022 10:29:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 237FF42B90; Sat, 9 Jul 2022 10:28:46 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 6F9B742B8F for ; Sat, 9 Jul 2022 10:28:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355325; 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=iBN6x9OQ7DjUF3IERo2BN4XXVZAi4P1+QS62e3a/06U=; b=guYtzwcM42wluDw11yn6w42g8cE6kbId25fl28MKpYTjFNdJDej2ON0iNlHCD6YQB6j4DF ManVybUK2dqFpAJNSZghkAMGJ3f8SnFwLUkIIR0Gj/w3Qa3PH1lSzuSdhJmzPWpjxfb7wt NAQlH160FnI0ua5hWtoO44FtbvrVBVY= 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-411-ATtuQRBYN6Kvw_Z5E-fDcg-1; Sat, 09 Jul 2022 04:28:43 -0400 X-MC-Unique: ATtuQRBYN6Kvw_Z5E-fDcg-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 A5F0129AA3B7; Sat, 9 Jul 2022 08:28:42 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id B36432026D64; Sat, 9 Jul 2022 08:28:41 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Hemant Agrawal , Sachin Saxena , Gagandeep Singh Subject: [RFC v2 v2 20/29] bus/fslmc: make driver-only headers private Date: Sat, 9 Jul 2022 10:26:35 +0200 Message-Id: <20220709082644.664675-21-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 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 fslmc 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/fslmc/{rte_fslmc.h => bus_fslmc_driver.h} | 7 ++++--- drivers/bus/fslmc/fslmc_bus.c | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 - drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 1 - drivers/bus/fslmc/private.h | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c | 2 +- drivers/dma/dpaa2/dpaa2_qdma.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 2 +- drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.h | 2 +- drivers/net/dpaa2/dpaa2_mux.c | 2 +- drivers/net/dpaa2/dpaa2_ptp.c | 2 +- drivers/net/dpaa2/dpaa2_recycle.c | 2 +- drivers/net/dpaa2/dpaa2_rxtx.c | 2 +- 20 files changed, 20 insertions(+), 22 deletions(-) rename drivers/bus/fslmc/{rte_fslmc.h => bus_fslmc_driver.h} (98%) diff --git a/drivers/bus/fslmc/rte_fslmc.h b/drivers/bus/fslmc/bus_fslmc_driver.h similarity index 98% rename from drivers/bus/fslmc/rte_fslmc.h rename to drivers/bus/fslmc/bus_fslmc_driver.h index 6bdee86aaf..798ddebf3a 100644 --- a/drivers/bus/fslmc/rte_fslmc.h +++ b/drivers/bus/fslmc/bus_fslmc_driver.h @@ -4,8 +4,8 @@ * */ -#ifndef _RTE_FSLMC_H_ -#define _RTE_FSLMC_H_ +#ifndef BUS_FSLMC_DRIVER_H +#define BUS_FSLMC_DRIVER_H /** * @file @@ -26,6 +26,7 @@ extern "C" { #include #include +#include #include #include #include @@ -209,4 +210,4 @@ RTE_PMD_EXPORT_NAME(nm, __COUNTER__) } #endif -#endif /* _RTE_FSLMC_H_ */ +#endif /* BUS_FSLMC_DRIVER_H */ diff --git a/drivers/bus/fslmc/fslmc_bus.c b/drivers/bus/fslmc/fslmc_bus.c index 0b52c8e46c..8503004e3d 100644 --- a/drivers/bus/fslmc/fslmc_bus.c +++ b/drivers/bus/fslmc/fslmc_bus.c @@ -17,7 +17,6 @@ #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 b172c84d52..8604e43947 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -32,7 +32,6 @@ #include #include "private.h" -#include "rte_fslmc.h" #include "fslmc_vfio.h" #include "fslmc_logs.h" #include diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c index 122aa1740d..cfe4280f87 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include "portal/dpaa2_hw_pvt.h" #include "portal/dpaa2_hw_dpio.h" diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c index 8ed969c7c0..b7d81b518c 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include "portal/dpaa2_hw_pvt.h" #include "portal/dpaa2_hw_dpio.h" diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 22c51c1a82..071b0d297d 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -33,7 +33,7 @@ #include #include -#include +#include #include "dpaa2_hw_pvt.h" #include "dpaa2_hw_dpio.h" #include diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c b/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c index 28780717bd..223e34bcba 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c @@ -14,7 +14,6 @@ #include "private.h" #include -#include #include #include "portal/dpaa2_hw_pvt.h" diff --git a/drivers/bus/fslmc/private.h b/drivers/bus/fslmc/private.h index f08dc7716b..e7425d819b 100644 --- a/drivers/bus/fslmc/private.h +++ b/drivers/bus/fslmc/private.h @@ -7,7 +7,7 @@ #include -#include +#include /* * FSLMC bus diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 8444f1a795..0cce861899 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c index e68a4875dd..b3242791ac 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 0500e8c225..d5a5f08ecc 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index ffc7b8b073..5de3e9e5f5 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c index b549bdfcbb..941fb8fc43 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c +++ b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "dpaa2_eventdev.h" #include "dpaa2_eventdev_logs.h" diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c index acc1fde771..3882a9cf1d 100644 --- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include "dpaa2_eventdev.h" diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 52eb6df310..f876f4790c 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include "rte_dpaa2_mempool.h" diff --git a/drivers/net/dpaa2/dpaa2_ethdev.h b/drivers/net/dpaa2/dpaa2_ethdev.h index a459181139..f69df95253 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.h +++ b/drivers/net/dpaa2/dpaa2_ethdev.h @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include "dpaa2_tm.h" diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c index e8689a7832..3289f388e1 100644 --- a/drivers/net/dpaa2/dpaa2_mux.c +++ b/drivers/net/dpaa2/dpaa2_mux.c @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/net/dpaa2/dpaa2_ptp.c b/drivers/net/dpaa2/dpaa2_ptp.c index 4e6d375d1c..c08aa0f3bf 100644 --- a/drivers/net/dpaa2/dpaa2_ptp.c +++ b/drivers/net/dpaa2/dpaa2_ptp.c @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/net/dpaa2/dpaa2_recycle.c b/drivers/net/dpaa2/dpaa2_recycle.c index 336506dc0d..932570c6e0 100644 --- a/drivers/net/dpaa2/dpaa2_recycle.c +++ b/drivers/net/dpaa2/dpaa2_recycle.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include "dpaa2_pmd_logs.h" diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index c17f6ebda9..7b9c528d13 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include #include From patchwork Sat Jul 9 08:26:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113877 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F1E07A00C5; Sat, 9 Jul 2022 10:29:16 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2883542825; Sat, 9 Jul 2022 10:28:53 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 9F9974280C for ; Sat, 9 Jul 2022 10:28:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355332; 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=uMMeLypNVlrLVgFJLA3kw15vZwmLwFbhT3prj9nL1BY=; b=CZ6YsZsh4nCjprAPqztxiqb5YNYoYfvjg02bZXYXY1+jnDw24s6qJJAhB1giLB6ejmE2YG AYboiCCyuOzxMYffM+ufAGbAFpDdsWRYkV54ejdwHPPIRcBsxCDOC7fjjmij2IR1omzBod 2WB2tlksrj2VkX9vqSqJv4OpJopCk7k= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-467-uVYSEj6qOmu_9j6bV5Lb0g-1; Sat, 09 Jul 2022 04:28:47 -0400 X-MC-Unique: uVYSEj6qOmu_9j6bV5Lb0g-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 B075C801590; Sat, 9 Jul 2022 08:28:46 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFF232026985; Sat, 9 Jul 2022 08:28:45 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Rosen Xu , Ray Kinsella , Tianfei zhang Subject: [RFC v2 v2 21/29] bus/ifpga: cleanup exported symbols Date: Sat, 9 Jul 2022 10:26:36 +0200 Message-Id: <20220709082644.664675-22-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 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 Remove unused symbols (exposed only in an internal header which guarantees that no application out there relied on them). Remove rte_ prefix and inline the rest to avoid having to expose them as global symbols for a relatively small added value. Signed-off-by: David Marchand --- drivers/bus/ifpga/ifpga_bus.c | 13 +++-- drivers/bus/ifpga/ifpga_common.c | 87 -------------------------------- drivers/bus/ifpga/ifpga_common.h | 54 ++++++++++++++++---- drivers/bus/ifpga/meson.build | 2 +- drivers/bus/ifpga/version.map | 2 - drivers/raw/ifpga/ifpga_rawdev.c | 2 +- 6 files changed, 53 insertions(+), 107 deletions(-) delete mode 100644 drivers/bus/ifpga/ifpga_common.c diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c index d962fb8362..988e336a1b 100644 --- a/drivers/bus/ifpga/ifpga_bus.c +++ b/drivers/bus/ifpga/ifpga_bus.c @@ -117,9 +117,9 @@ ifpga_scan_one(struct rte_rawdev *rawdev, if (rte_kvargs_count(kvlist, IFPGA_ARG_PORT) == 1) { if (rte_kvargs_process(kvlist, IFPGA_ARG_PORT, - &rte_ifpga_get_integer32_arg, &afu_pr_conf.afu_id.port) < 0) { - IFPGA_BUS_ERR("error to parse %s", - IFPGA_ARG_PORT); + ifpga_get_integer32_arg, + &afu_pr_conf.afu_id.port) < 0) { + IFPGA_BUS_ERR("error to parse %s", IFPGA_ARG_PORT); goto end; } } else { @@ -130,9 +130,8 @@ ifpga_scan_one(struct rte_rawdev *rawdev, if (rte_kvargs_count(kvlist, IFPGA_AFU_BTS) == 1) { if (rte_kvargs_process(kvlist, IFPGA_AFU_BTS, - &rte_ifpga_get_string_arg, &path) < 0) { - IFPGA_BUS_ERR("Failed to parse %s", - IFPGA_AFU_BTS); + ifpga_get_string_arg, &path) < 0) { + IFPGA_BUS_ERR("Failed to parse %s", IFPGA_AFU_BTS); goto end; } afu_pr_conf.pr_enable = 1; @@ -228,7 +227,7 @@ ifpga_scan(void) if (rte_kvargs_count(kvlist, IFPGA_ARG_NAME) == 1) { if (rte_kvargs_process(kvlist, IFPGA_ARG_NAME, - &rte_ifpga_get_string_arg, &name) < 0) { + ifpga_get_string_arg, &name) < 0) { IFPGA_BUS_ERR("error to parse %s", IFPGA_ARG_NAME); goto end; diff --git a/drivers/bus/ifpga/ifpga_common.c b/drivers/bus/ifpga/ifpga_common.c deleted file mode 100644 index 223660d6ff..0000000000 --- a/drivers/bus/ifpga/ifpga_common.c +++ /dev/null @@ -1,87 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2010-2018 Intel Corporation - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "rte_bus_ifpga.h" -#include "ifpga_logs.h" -#include "ifpga_common.h" - -int rte_ifpga_get_string_arg(const char *key __rte_unused, - const char *value, void *extra_args) -{ - if (!value || !extra_args) - return -EINVAL; - - *(char **)extra_args = strdup(value); - - if (!*(char **)extra_args) - return -ENOMEM; - - return 0; -} -int rte_ifpga_get_integer32_arg(const char *key __rte_unused, - const char *value, void *extra_args) -{ - if (!value || !extra_args) - return -EINVAL; - - *(int *)extra_args = strtoull(value, NULL, 0); - - return 0; -} -int ifpga_get_integer64_arg(const char *key __rte_unused, - const char *value, void *extra_args) -{ - if (!value || !extra_args) - return -EINVAL; - - *(uint64_t *)extra_args = strtoull(value, NULL, 0); - - return 0; -} -int ifpga_get_unsigned_long(const char *str, int base) -{ - unsigned long num; - char *end = NULL; - - errno = 0; - - num = strtoul(str, &end, base); - if ((str[0] == '\0') || (end == NULL) || (*end != '\0') || (errno != 0)) - return -1; - - return num; -} - -int ifpga_afu_id_cmp(const struct rte_afu_id *afu_id0, - const struct rte_afu_id *afu_id1) -{ - if ((afu_id0->uuid.uuid_low == afu_id1->uuid.uuid_low) && - (afu_id0->uuid.uuid_high == afu_id1->uuid.uuid_high) && - (afu_id0->port == afu_id1->port)) { - return 0; - } else - return 1; -} diff --git a/drivers/bus/ifpga/ifpga_common.h b/drivers/bus/ifpga/ifpga_common.h index f9254b9d5d..bb6524030f 100644 --- a/drivers/bus/ifpga/ifpga_common.h +++ b/drivers/bus/ifpga/ifpga_common.h @@ -5,14 +5,50 @@ #ifndef _IFPGA_COMMON_H_ #define _IFPGA_COMMON_H_ -int rte_ifpga_get_string_arg(const char *key __rte_unused, - const char *value, void *extra_args); -int rte_ifpga_get_integer32_arg(const char *key __rte_unused, - const char *value, void *extra_args); -int ifpga_get_integer64_arg(const char *key __rte_unused, - const char *value, void *extra_args); -int ifpga_get_unsigned_long(const char *str, int base); -int ifpga_afu_id_cmp(const struct rte_afu_id *afu_id0, - const struct rte_afu_id *afu_id1); +#include +#include +#include + +#include +#include + +static inline int +ifpga_get_string_arg(const char *key __rte_unused, const char *value, + void *extra_args) +{ + if (!value || !extra_args) + return -EINVAL; + + *(char **)extra_args = strdup(value); + + if (!*(char **)extra_args) + return -ENOMEM; + + return 0; +} + +static inline int +ifpga_get_integer32_arg(const char *key __rte_unused, const char *value, + void *extra_args) +{ + if (!value || !extra_args) + return -EINVAL; + + *(int *)extra_args = strtoull(value, NULL, 0); + + return 0; +} + +static inline int +ifpga_afu_id_cmp(const struct rte_afu_id *afu_id0, + const struct rte_afu_id *afu_id1) +{ + if ((afu_id0->uuid.uuid_low == afu_id1->uuid.uuid_low) && + (afu_id0->uuid.uuid_high == afu_id1->uuid.uuid_high) && + (afu_id0->port == afu_id1->port)) { + return 0; + } else + return 1; +} #endif /* _IFPGA_COMMON_H_ */ diff --git a/drivers/bus/ifpga/meson.build b/drivers/bus/ifpga/meson.build index cc5047e3ce..9d56a4bb2b 100644 --- a/drivers/bus/ifpga/meson.build +++ b/drivers/bus/ifpga/meson.build @@ -9,4 +9,4 @@ endif deps += ['pci', 'kvargs', 'rawdev'] headers = files('rte_bus_ifpga.h') -sources = files('ifpga_common.c', 'ifpga_bus.c') +sources = files('ifpga_bus.c') diff --git a/drivers/bus/ifpga/version.map b/drivers/bus/ifpga/version.map index 8ac3a4d258..c33537d39d 100644 --- a/drivers/bus/ifpga/version.map +++ b/drivers/bus/ifpga/version.map @@ -4,8 +4,6 @@ DPDK_22 { rte_ifpga_driver_register; rte_ifpga_driver_unregister; rte_ifpga_find_afu_by_name; - rte_ifpga_get_integer32_arg; - rte_ifpga_get_string_arg; local: *; }; diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index 78a7123528..93a7e74959 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -1752,7 +1752,7 @@ ifpga_vdev_parse_devargs(struct rte_devargs *devargs, if (rte_kvargs_count(kvlist, IFPGA_ARG_PORT) == 1) { if (rte_kvargs_process(kvlist, IFPGA_ARG_PORT, - &rte_ifpga_get_integer32_arg, &port) < 0) { + ifpga_get_integer32_arg, &port) < 0) { IFPGA_RAWDEV_PMD_ERR("error to parse %s", IFPGA_ARG_PORT); goto end; From patchwork Sat Jul 9 08:26:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113878 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C0133A00C5; Sat, 9 Jul 2022 10:29:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2A1BB42836; Sat, 9 Jul 2022 10:28:57 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id D49FD42847 for ; Sat, 9 Jul 2022 10:28:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355334; 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=5c63XXupZVdC0ig7Ftofb2TfSGmVf+5bpoNEkJFuNQE=; b=hLM+ksporjOjTd8A1fYc5JJyd1fNL/MsArSE3HI/clqP8z77YBPufuAdDmyoXgoJbzlOyX jOsfxNsbrlys15kC36sF4WpSooXn6J4+WNaH33tryBhEpUkNE4N5E+Y1FU5Nouh54xvbtN CJUwt29n/UVm4hxroSbodPGXlBdRC6E= 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-625-gl732wrOOp6rda0jV0PKBQ-1; Sat, 09 Jul 2022 04:28:51 -0400 X-MC-Unique: gl732wrOOp6rda0jV0PKBQ-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 9BE1E3806737; Sat, 9 Jul 2022 08:28:50 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF6182026D64; Sat, 9 Jul 2022 08:28:49 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Rosen Xu , Ray Kinsella , Tianfei zhang Subject: [RFC v2 v2 22/29] bus/ifpga: make driver-only headers private Date: Sat, 9 Jul 2022 10:26:37 +0200 Message-Id: <20220709082644.664675-23-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 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 ifpga bus interface is for drivers only. Mark as internal and move the header on the driver headers list. Signed-off-by: David Marchand --- .../bus/ifpga/{rte_bus_ifpga.h => bus_ifpga_driver.h} | 11 ++++++++--- drivers/bus/ifpga/ifpga_bus.c | 4 ++-- drivers/bus/ifpga/ifpga_common.h | 2 +- drivers/bus/ifpga/meson.build | 2 +- drivers/bus/ifpga/version.map | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.h | 2 +- drivers/net/ipn3ke/ipn3ke_flow.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/raw/ifpga/afu_pmd_core.h | 2 +- drivers/raw/ifpga/afu_pmd_he_hssi.c | 2 +- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 2 +- drivers/raw/ifpga/afu_pmd_he_mem.c | 2 +- drivers/raw/ifpga/afu_pmd_n3000.c | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- 16 files changed, 24 insertions(+), 19 deletions(-) rename drivers/bus/ifpga/{rte_bus_ifpga.h => bus_ifpga_driver.h} (95%) diff --git a/drivers/bus/ifpga/rte_bus_ifpga.h b/drivers/bus/ifpga/bus_ifpga_driver.h similarity index 95% rename from drivers/bus/ifpga/rte_bus_ifpga.h rename to drivers/bus/ifpga/bus_ifpga_driver.h index 8792e23dd0..7b75c2ddbc 100644 --- a/drivers/bus/ifpga/rte_bus_ifpga.h +++ b/drivers/bus/ifpga/bus_ifpga_driver.h @@ -2,8 +2,8 @@ * Copyright(c) 2010-2018 Intel Corporation */ -#ifndef _RTE_BUS_IFPGA_H_ -#define _RTE_BUS_IFPGA_H_ +#ifndef BUS_IFPGA_DRIVER_H +#define BUS_IFPGA_DRIVER_H /** * @file @@ -15,6 +15,7 @@ extern "C" { #endif /* __cplusplus */ +#include #include #include #include @@ -105,6 +106,7 @@ struct rte_afu_driver { const struct rte_afu_uuid *id_table; /**< AFU uuid within FPGA. */ }; +__rte_internal static inline const char * rte_ifpga_device_name(const struct rte_afu_device *afu) { @@ -119,6 +121,7 @@ rte_ifpga_device_name(const struct rte_afu_device *afu) * @param name * A pointer to AFU name string. */ +__rte_internal struct rte_afu_device * rte_ifpga_find_afu_by_name(const char *name); @@ -129,6 +132,7 @@ rte_ifpga_find_afu_by_name(const char *name); * A pointer to a rte_afu_driver structure describing the driver * to be registered. */ +__rte_internal void rte_ifpga_driver_register(struct rte_afu_driver *driver); /** @@ -138,6 +142,7 @@ void rte_ifpga_driver_register(struct rte_afu_driver *driver); * A pointer to a rte_afu_driver structure describing the driver * to be unregistered. */ +__rte_internal void rte_ifpga_driver_unregister(struct rte_afu_driver *driver); #define RTE_PMD_REGISTER_AFU(nm, afudrv)\ @@ -157,4 +162,4 @@ static const char *afudrvinit_ ## nm ## _alias = RTE_STR(alias) } #endif /* __cplusplus */ -#endif /* _RTE_BUS_IFPGA_H_ */ +#endif /* BUS_IFPGA_DRIVER_H */ diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c index 988e336a1b..8c3021cd1a 100644 --- a/drivers/bus/ifpga/ifpga_bus.c +++ b/drivers/bus/ifpga/ifpga_bus.c @@ -28,7 +28,7 @@ #include "rte_rawdev.h" #include "rte_rawdev_pmd.h" -#include "rte_bus_ifpga.h" +#include "bus_ifpga_driver.h" #include "ifpga_logs.h" #include "ifpga_common.h" @@ -65,7 +65,7 @@ ifpga_find_afu_dev(const struct rte_rawdev *rdev, TAILQ_FOREACH(afu_dev, &ifpga_afu_dev_list, next) { if (afu_dev->rawdev == rdev && - !ifpga_afu_id_cmp(&afu_dev->id, afu_id)) + !ifpga_afu_id_cmp(&afu_dev->id, afu_id)) return afu_dev; } return NULL; diff --git a/drivers/bus/ifpga/ifpga_common.h b/drivers/bus/ifpga/ifpga_common.h index bb6524030f..a41a1628f5 100644 --- a/drivers/bus/ifpga/ifpga_common.h +++ b/drivers/bus/ifpga/ifpga_common.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include static inline int diff --git a/drivers/bus/ifpga/meson.build b/drivers/bus/ifpga/meson.build index 9d56a4bb2b..dedc94db2d 100644 --- a/drivers/bus/ifpga/meson.build +++ b/drivers/bus/ifpga/meson.build @@ -8,5 +8,5 @@ if is_windows endif deps += ['pci', 'kvargs', 'rawdev'] -headers = files('rte_bus_ifpga.h') +driver_sdk_headers += files('bus_ifpga_driver.h') sources = files('ifpga_bus.c') diff --git a/drivers/bus/ifpga/version.map b/drivers/bus/ifpga/version.map index c33537d39d..3d1943afe4 100644 --- a/drivers/bus/ifpga/version.map +++ b/drivers/bus/ifpga/version.map @@ -1,4 +1,4 @@ -DPDK_22 { +INTERNAL { global: rte_ifpga_driver_register; diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke_ethdev.c index 550a8b0466..2e39113941 100644 --- a/drivers/net/ipn3ke/ipn3ke_ethdev.c +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.h b/drivers/net/ipn3ke/ipn3ke_ethdev.h index 58fcc50c57..dbf57f9ba8 100644 --- a/drivers/net/ipn3ke/ipn3ke_ethdev.h +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.h @@ -24,7 +24,7 @@ #include #include -#include +#include #include #define IPN3KE_TM_SCRATCH_RW 0 diff --git a/drivers/net/ipn3ke/ipn3ke_flow.c b/drivers/net/ipn3ke/ipn3ke_flow.c index 66ae31a5a9..5b57ee9341 100644 --- a/drivers/net/ipn3ke/ipn3ke_flow.c +++ b/drivers/net/ipn3ke/ipn3ke_flow.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c index abbecfdf2e..2f088d767f 100644 --- a/drivers/net/ipn3ke/ipn3ke_representor.c +++ b/drivers/net/ipn3ke/ipn3ke_representor.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include "ipn3ke_rawdev_api.h" diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c index 6a9b98fd7f..2f242b678a 100644 --- a/drivers/net/ipn3ke/ipn3ke_tm.c +++ b/drivers/net/ipn3ke/ipn3ke_tm.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include "ipn3ke_rawdev_api.h" diff --git a/drivers/raw/ifpga/afu_pmd_core.h b/drivers/raw/ifpga/afu_pmd_core.h index 91118a19ab..ab5a228147 100644 --- a/drivers/raw/ifpga/afu_pmd_core.h +++ b/drivers/raw/ifpga/afu_pmd_core.h @@ -15,7 +15,7 @@ extern "C" { #include #include -#include +#include #include #include "ifpga_rawdev.h" diff --git a/drivers/raw/ifpga/afu_pmd_he_hssi.c b/drivers/raw/ifpga/afu_pmd_he_hssi.c index 102de50812..eca1edc270 100644 --- a/drivers/raw/ifpga/afu_pmd_he_hssi.c +++ b/drivers/raw/ifpga/afu_pmd_he_hssi.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include "afu_pmd_core.h" diff --git a/drivers/raw/ifpga/afu_pmd_he_lpbk.c b/drivers/raw/ifpga/afu_pmd_he_lpbk.c index 8b2c85b5f8..da0aba6e00 100644 --- a/drivers/raw/ifpga/afu_pmd_he_lpbk.c +++ b/drivers/raw/ifpga/afu_pmd_he_lpbk.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include "afu_pmd_core.h" diff --git a/drivers/raw/ifpga/afu_pmd_he_mem.c b/drivers/raw/ifpga/afu_pmd_he_mem.c index 0f57a03b0e..3c41aa9ee8 100644 --- a/drivers/raw/ifpga/afu_pmd_he_mem.c +++ b/drivers/raw/ifpga/afu_pmd_he_mem.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include "afu_pmd_core.h" diff --git a/drivers/raw/ifpga/afu_pmd_n3000.c b/drivers/raw/ifpga/afu_pmd_n3000.c index 5120df5f77..b7438bd372 100644 --- a/drivers/raw/ifpga/afu_pmd_n3000.c +++ b/drivers/raw/ifpga/afu_pmd_n3000.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include "afu_pmd_core.h" diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index 93a7e74959..d9beb72db3 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -35,7 +35,7 @@ #include "base/ifpga_api.h" #include "rte_rawdev.h" #include "rte_rawdev_pmd.h" -#include "rte_bus_ifpga.h" +#include #include "ifpga_common.h" #include "ifpga_logs.h" #include "ifpga_rawdev.h" From patchwork Sat Jul 9 08:26:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113879 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1C30EA00C5; Sat, 9 Jul 2022 10:29:30 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C0CB942B6F; Sat, 9 Jul 2022 10:29:17 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id 230994280D for ; Sat, 9 Jul 2022 10:29:16 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355355; 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=A+cZqHj9DbnY7kjHb5JzU7nHDYtizNWSLoBek06RkZI=; b=IQzLqUIr/23GhvYVho85Vv3T2SGSTwiOWcBtenQteU7UvjnSnJ3YOaCMTBBzx90QJlkI1e ng2+eZUc0a8DqfJ83Q7S1pJsBKQtG5/HAnCHzqxcvd6FLisuM9Hf/0qEFSY8Dht5REB192 sTxQ0MrizxPYSN2tK21+bl/yNbXYjH8= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-379-ZzTxJGVlOVWds1V6wfy2rQ-1; Sat, 09 Jul 2022 04:29:12 -0400 X-MC-Unique: ZzTxJGVlOVWds1V6wfy2rQ-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 9E50F185A7B2; Sat, 9 Jul 2022 08:29:08 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 006F72026D64; Sat, 9 Jul 2022 08:28:54 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Aman Singh , Yuying Zhang , Nicolas Chautru , Ray Kinsella , Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao , Matan Azrad , Viacheslav Ovsiienko , Fan Zhang , Andrew Rybchenko , Ashish Gupta , Chandubabu Namburu , Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj , Nagadheeraj Rottela , Srikanth Jampala , Jay Zhou , Radha Mohan Chintakuntla , Veerasenareddy Burru , Chengwen Feng , Bruce Richardson , Kevin Laatz , Conor Walsh , Timothy McDaniel , Jerin Jacob , Pavan Nikhilesh , Elena Agostini , Ashwin Sekhar T K , Harman Kalra , Shepard Siegel , Ed Czeck , John Miller , Steven Webster , Matt Peters , Rasesh Mody , Shahed Shaikh , Ajit Khaparde , Somnath Kotur , Chas Williams , "Min Hu (Connor)" , Rahul Lakkireddy , Simei Su , Wenjun Wu , Marcin Wojtas , Michal Krawczyk , Shai Brandes , Evgeny Schemeilin , Igor Chauskin , John Daley , Hyong Youb Kim , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , Dongdong Liu , Yisen Zhuang , Beilei Xing , Junfeng Guo , Andrew Boyer , Rosen Xu , Qiming Yang , Stephen Hemminger , Long Li , Jiawen Wu , Devendra Singh Rawat , Maciej Czekaj , Jian Wang , Maxime Coquelin , Chenbo Xia , Jochen Behrens , Jakub Palider , Tomasz Duszynski , Tianfei zhang , Jingjing Wu , Ori Kam , Xiao Wang , Vijay Kumar Srivastava , Thomas Monjalon , Ferruh Yigit Subject: [RFC v2 v2 23/29] bus/pci: make driver-only headers private Date: Sat, 9 Jul 2022 10:26:38 +0200 Message-Id: <20220709082644.664675-24-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 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 pci bus interface is for drivers only. Mark as internal and move the header on the driver headers list. Signed-off-by: David Marchand --- app/test-pmd/testpmd.h | 2 +- app/test/virtual_pmd.c | 2 +- drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/pci/bsd/pci.c | 1 - drivers/bus/pci/bus_pci_driver.h | 200 ++++++++++++++++++ drivers/bus/pci/meson.build | 1 + drivers/bus/pci/private.h | 1 + drivers/bus/pci/rte_bus_pci.h | 178 +--------------- drivers/bus/pci/version.map | 11 +- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/common/mlx5/linux/mlx5_common_os.h | 2 +- drivers/common/mlx5/mlx5_common.h | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/common/mlx5/windows/mlx5_common_os.c | 2 +- drivers/common/qat/qat_device.h | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/common/sfc_efx/sfc_efx.h | 2 +- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip.h | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/crypto/ccp/ccp_dev.h | 2 +- drivers/crypto/ccp/ccp_pci.h | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/nitrox/nitrox_device.h | 2 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_pci.h | 2 +- drivers/dma/cnxk/cnxk_dmadev.c | 2 +- drivers/dma/hisilicon/hisi_dmadev.c | 2 +- drivers/dma/idxd/idxd_pci.c | 2 +- drivers/dma/ioat/ioat_dmadev.c | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/octeontx/ssovf_probe.c | 2 +- drivers/event/octeontx/timvf_probe.c | 2 +- drivers/gpu/cuda/cuda.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 2 +- drivers/net/hns3/hns3_common.c | 2 +- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/igc/igc_ethdev.c | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/ngbe/base/ngbe_osdep.h | 2 +- drivers/net/ngbe/ngbe_pf.c | 2 +- drivers/net/octeontx/base/octeontx_pkivf.c | 2 +- drivers/net/octeontx/base/octeontx_pkovf.c | 2 +- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sriov.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_pf.c | 2 +- drivers/net/virtio/virtio_pci.h | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +- drivers/raw/ifpga/afu_pmd_he_hssi.c | 2 +- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 2 +- drivers/raw/ifpga/afu_pmd_he_mem.c | 2 +- drivers/raw/ifpga/afu_pmd_n3000.c | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/ifpga/rte_pmd_ifpga.c | 2 +- drivers/raw/ioat/idxd_pci.c | 2 +- drivers/raw/ioat/ioat_rawdev.c | 2 +- drivers/raw/ntb/ntb.c | 2 +- drivers/raw/ntb/ntb_hw_intel.c | 2 +- drivers/regex/mlx5/mlx5_regex.c | 2 +- drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- drivers/vdpa/sfc/sfc_vdpa.h | 2 +- lib/ethdev/ethdev_pci.h | 4 +- lib/eventdev/eventdev_pmd_pci.h | 2 +- 123 files changed, 329 insertions(+), 299 deletions(-) create mode 100644 drivers/bus/pci/bus_pci_driver.h diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h index 59a8a429c5..d71c9ce107 100644 --- a/app/test-pmd/testpmd.h +++ b/app/test-pmd/testpmd.h @@ -7,9 +7,9 @@ #include +#include #include #include -#include #ifdef RTE_LIB_GRO #include #endif diff --git a/app/test/virtual_pmd.c b/app/test/virtual_pmd.c index cd4611ab48..2b55c85fd8 100644 --- a/app/test/virtual_pmd.c +++ b/app/test/virtual_pmd.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c index a8482bd411..801e8920df 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.c +++ b/drivers/baseband/acc100/rte_acc100_pmd.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #ifdef RTE_BBDEV_OFFLOAD_COST #include #endif diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c index 82ae6ba678..c1d877c87f 100644 --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #ifdef RTE_BBDEV_OFFLOAD_COST #include diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c index 21d35292a3..f16814e241 100644 --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #ifdef RTE_BBDEV_OFFLOAD_COST #include diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c index bcd772427b..bc560a2a56 100644 --- a/drivers/bus/pci/bsd/pci.c +++ b/drivers/bus/pci/bsd/pci.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/bus/pci/bus_pci_driver.h b/drivers/bus/pci/bus_pci_driver.h new file mode 100644 index 0000000000..b5c7dee617 --- /dev/null +++ b/drivers/bus/pci/bus_pci_driver.h @@ -0,0 +1,200 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2010-2015 Intel Corporation. + * Copyright 2013-2014 6WIND S.A. + */ + +#ifndef BUS_PCI_DRIVER_H +#define BUS_PCI_DRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +/** Pathname of PCI devices directory. */ +__rte_internal +const char *rte_pci_get_sysfs_path(void); + +enum rte_pci_kernel_driver { + RTE_PCI_KDRV_UNKNOWN = 0, /* may be misc UIO or bifurcated driver */ + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */ + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */ + RTE_PCI_KDRV_UIO_GENERIC, /* uio_pci_generic for Linux */ + RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */ + RTE_PCI_KDRV_NONE, /* no attached driver */ + RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */ +}; + +/** + * A structure describing a PCI device. + */ +struct rte_pci_device { + RTE_TAILQ_ENTRY(rte_pci_device) next; /**< Next probed PCI device. */ + struct rte_device device; /**< Inherit core device */ + struct rte_pci_addr addr; /**< PCI location. */ + struct rte_pci_id id; /**< PCI ID. */ + struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE]; + /**< PCI Memory Resource */ + struct rte_intr_handle *intr_handle; /**< Interrupt handle */ + struct rte_pci_driver *driver; /**< PCI driver used in probing */ + uint16_t max_vfs; /**< sriov enable if not zero */ + enum rte_pci_kernel_driver kdrv; /**< Kernel driver passthrough */ + char name[PCI_PRI_STR_SIZE+1]; /**< PCI location (ASCII) */ + struct rte_intr_handle *vfio_req_intr_handle; + /**< Handler of VFIO request interrupt */ +}; + +/** + * @internal + * Helper macro for drivers that need to convert to struct rte_pci_device. + */ +#define RTE_DEV_TO_PCI(ptr) container_of(ptr, struct rte_pci_device, device) + +#define RTE_DEV_TO_PCI_CONST(ptr) \ + container_of(ptr, const struct rte_pci_device, device) + +#define RTE_ETH_DEV_TO_PCI(eth_dev) RTE_DEV_TO_PCI((eth_dev)->device) + +#ifdef __cplusplus +/** C++ macro used to help building up tables of device IDs */ +#define RTE_PCI_DEVICE(vend, dev) \ + RTE_CLASS_ANY_ID, \ + (vend), \ + (dev), \ + RTE_PCI_ANY_ID, \ + RTE_PCI_ANY_ID +#else +/** Macro used to help building up tables of device IDs */ +#define RTE_PCI_DEVICE(vend, dev) \ + .class_id = RTE_CLASS_ANY_ID, \ + .vendor_id = (vend), \ + .device_id = (dev), \ + .subsystem_vendor_id = RTE_PCI_ANY_ID, \ + .subsystem_device_id = RTE_PCI_ANY_ID +#endif + +/** + * Initialisation function for the driver called during PCI probing. + */ +typedef int (rte_pci_probe_t)(struct rte_pci_driver *, struct rte_pci_device *); + +/** + * Uninitialisation function for the driver called during hotplugging. + */ +typedef int (rte_pci_remove_t)(struct rte_pci_device *); + +/** + * Driver-specific DMA mapping. After a successful call the device + * will be able to read/write from/to this segment. + * + * @param dev + * Pointer to the PCI device. + * @param addr + * Starting virtual address of memory to be mapped. + * @param iova + * Starting IOVA address of memory to be mapped. + * @param len + * Length of memory segment being mapped. + * @return + * - 0 On success. + * - Negative value and rte_errno is set otherwise. + */ +typedef int (pci_dma_map_t)(struct rte_pci_device *dev, void *addr, + uint64_t iova, size_t len); + +/** + * Driver-specific DMA un-mapping. After a successful call the device + * will not be able to read/write from/to this segment. + * + * @param dev + * Pointer to the PCI device. + * @param addr + * Starting virtual address of memory to be unmapped. + * @param iova + * Starting IOVA address of memory to be unmapped. + * @param len + * Length of memory segment being unmapped. + * @return + * - 0 On success. + * - Negative value and rte_errno is set otherwise. + */ +typedef int (pci_dma_unmap_t)(struct rte_pci_device *dev, void *addr, + uint64_t iova, size_t len); + +/** + * A structure describing a PCI driver. + */ +struct rte_pci_driver { + RTE_TAILQ_ENTRY(rte_pci_driver) next; /**< Next in list. */ + struct rte_driver driver; /**< Inherit core driver. */ + rte_pci_probe_t *probe; /**< Device probe function. */ + rte_pci_remove_t *remove; /**< Device remove function. */ + pci_dma_map_t *dma_map; /**< device dma map function. */ + pci_dma_unmap_t *dma_unmap; /**< device dma unmap function. */ + const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */ + uint32_t drv_flags; /**< Flags RTE_PCI_DRV_*. */ +}; + +/** 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) */ +#define RTE_PCI_DRV_WC_ACTIVATE 0x0002 +/** Device already probed can be probed again to check for new ports. */ +#define RTE_PCI_DRV_PROBE_AGAIN 0x0004 +/** Device driver supports link state interrupt */ +#define RTE_PCI_DRV_INTR_LSC 0x0008 +/** Device driver supports device removal interrupt */ +#define RTE_PCI_DRV_INTR_RMV 0x0010 +/** Device driver needs to keep mapped resources if unsupported dev detected */ +#define RTE_PCI_DRV_KEEP_MAPPED_RES 0x0020 +/** Device driver needs IOVA as VA and cannot work with IOVA as PA */ +#define RTE_PCI_DRV_NEED_IOVA_AS_VA 0x0040 + +/** + * Register a PCI driver. + * + * @param driver + * A pointer to a rte_pci_driver structure describing the driver + * to be registered. + */ +__rte_internal +void rte_pci_register(struct rte_pci_driver *driver); + +/** Helper for PCI device registration from driver (eth, crypto) instance */ +#define RTE_PMD_REGISTER_PCI(nm, pci_drv) \ +RTE_INIT(pciinitfn_ ##nm) \ +{\ + (pci_drv).driver.name = RTE_STR(nm);\ + rte_pci_register(&pci_drv); \ +} \ +RTE_PMD_EXPORT_NAME(nm, __COUNTER__) + +/** + * Unregister a PCI driver. + * + * @param driver + * A pointer to a rte_pci_driver structure describing the driver + * to be unregistered. + */ +__rte_internal +void rte_pci_unregister(struct rte_pci_driver *driver); + +/* + * A structure used to access io resources for a pci device. + * rte_pci_ioport is arch, os, driver specific, and should not be used outside + * of pci ioport api. + */ +struct rte_pci_ioport { + struct rte_pci_device *dev; + uint64_t base; + uint64_t len; /* only filled for memory mapped ports */ +}; + +#ifdef __cplusplus +} +#endif + +#endif /* BUS_PCI_DRIVER_H */ diff --git a/drivers/bus/pci/meson.build b/drivers/bus/pci/meson.build index 81c7e94c00..f50f039a68 100644 --- a/drivers/bus/pci/meson.build +++ b/drivers/bus/pci/meson.build @@ -3,6 +3,7 @@ deps += ['pci'] headers = files('rte_bus_pci.h') +driver_sdk_headers = files('bus_pci_driver.h') sources = files('pci_common.c', 'pci_params.c') if is_linux diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h index 0cefed5edf..fddf49251d 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h @@ -9,6 +9,7 @@ #include #include +#include #include #include diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h index 01d834e3cc..60e50ca875 100644 --- a/drivers/bus/pci/rte_bus_pci.h +++ b/drivers/bus/pci/rte_bus_pci.h @@ -24,153 +24,15 @@ extern "C" { #include #include -#include #include -/** Pathname of PCI devices directory. */ -const char *rte_pci_get_sysfs_path(void); - /* Forward declarations */ struct rte_pci_device; struct rte_pci_driver; +struct rte_pci_ioport; struct rte_devargs; -enum rte_pci_kernel_driver { - RTE_PCI_KDRV_UNKNOWN = 0, /* may be misc UIO or bifurcated driver */ - RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */ - RTE_PCI_KDRV_VFIO, /* VFIO for Linux */ - RTE_PCI_KDRV_UIO_GENERIC, /* uio_pci_generic for Linux */ - RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */ - RTE_PCI_KDRV_NONE, /* no attached driver */ - RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */ -}; - -/** - * A structure describing a PCI device. - */ -struct rte_pci_device { - RTE_TAILQ_ENTRY(rte_pci_device) next; /**< Next probed PCI device. */ - struct rte_device device; /**< Inherit core device */ - struct rte_pci_addr addr; /**< PCI location. */ - struct rte_pci_id id; /**< PCI ID. */ - struct rte_mem_resource mem_resource[PCI_MAX_RESOURCE]; - /**< PCI Memory Resource */ - struct rte_intr_handle *intr_handle; /**< Interrupt handle */ - struct rte_pci_driver *driver; /**< PCI driver used in probing */ - uint16_t max_vfs; /**< sriov enable if not zero */ - enum rte_pci_kernel_driver kdrv; /**< Kernel driver passthrough */ - char name[PCI_PRI_STR_SIZE+1]; /**< PCI location (ASCII) */ - struct rte_intr_handle *vfio_req_intr_handle; - /**< Handler of VFIO request interrupt */ -}; - -/** - * @internal - * Helper macro for drivers that need to convert to struct rte_pci_device. - */ -#define RTE_DEV_TO_PCI(ptr) container_of(ptr, struct rte_pci_device, device) - -#define RTE_DEV_TO_PCI_CONST(ptr) \ - container_of(ptr, const struct rte_pci_device, device) - -#define RTE_ETH_DEV_TO_PCI(eth_dev) RTE_DEV_TO_PCI((eth_dev)->device) - -#ifdef __cplusplus -/** C++ macro used to help building up tables of device IDs */ -#define RTE_PCI_DEVICE(vend, dev) \ - RTE_CLASS_ANY_ID, \ - (vend), \ - (dev), \ - RTE_PCI_ANY_ID, \ - RTE_PCI_ANY_ID -#else -/** Macro used to help building up tables of device IDs */ -#define RTE_PCI_DEVICE(vend, dev) \ - .class_id = RTE_CLASS_ANY_ID, \ - .vendor_id = (vend), \ - .device_id = (dev), \ - .subsystem_vendor_id = RTE_PCI_ANY_ID, \ - .subsystem_device_id = RTE_PCI_ANY_ID -#endif - -/** - * Initialisation function for the driver called during PCI probing. - */ -typedef int (rte_pci_probe_t)(struct rte_pci_driver *, struct rte_pci_device *); - -/** - * Uninitialisation function for the driver called during hotplugging. - */ -typedef int (rte_pci_remove_t)(struct rte_pci_device *); - -/** - * Driver-specific DMA mapping. After a successful call the device - * will be able to read/write from/to this segment. - * - * @param dev - * Pointer to the PCI device. - * @param addr - * Starting virtual address of memory to be mapped. - * @param iova - * Starting IOVA address of memory to be mapped. - * @param len - * Length of memory segment being mapped. - * @return - * - 0 On success. - * - Negative value and rte_errno is set otherwise. - */ -typedef int (pci_dma_map_t)(struct rte_pci_device *dev, void *addr, - uint64_t iova, size_t len); - -/** - * Driver-specific DMA un-mapping. After a successful call the device - * will not be able to read/write from/to this segment. - * - * @param dev - * Pointer to the PCI device. - * @param addr - * Starting virtual address of memory to be unmapped. - * @param iova - * Starting IOVA address of memory to be unmapped. - * @param len - * Length of memory segment being unmapped. - * @return - * - 0 On success. - * - Negative value and rte_errno is set otherwise. - */ -typedef int (pci_dma_unmap_t)(struct rte_pci_device *dev, void *addr, - uint64_t iova, size_t len); - -/** - * A structure describing a PCI driver. - */ -struct rte_pci_driver { - RTE_TAILQ_ENTRY(rte_pci_driver) next; /**< Next in list. */ - struct rte_driver driver; /**< Inherit core driver. */ - rte_pci_probe_t *probe; /**< Device probe function. */ - rte_pci_remove_t *remove; /**< Device remove function. */ - pci_dma_map_t *dma_map; /**< device dma map function. */ - pci_dma_unmap_t *dma_unmap; /**< device dma unmap function. */ - const struct rte_pci_id *id_table; /**< ID table, NULL terminated. */ - uint32_t drv_flags; /**< Flags RTE_PCI_DRV_*. */ -}; - -/** 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) */ -#define RTE_PCI_DRV_WC_ACTIVATE 0x0002 -/** Device already probed can be probed again to check for new ports. */ -#define RTE_PCI_DRV_PROBE_AGAIN 0x0004 -/** Device driver supports link state interrupt */ -#define RTE_PCI_DRV_INTR_LSC 0x0008 -/** Device driver supports device removal interrupt */ -#define RTE_PCI_DRV_INTR_RMV 0x0010 -/** Device driver needs to keep mapped resources if unsupported dev detected */ -#define RTE_PCI_DRV_KEEP_MAPPED_RES 0x0020 -/** Device driver needs IOVA as VA and cannot work with IOVA as PA */ -#define RTE_PCI_DRV_NEED_IOVA_AS_VA 0x0040 - /** * Map the PCI device resources in user space virtual memory address * @@ -238,33 +100,6 @@ off_t rte_pci_find_ext_capability(struct rte_pci_device *dev, uint32_t cap); __rte_experimental int rte_pci_set_bus_master(struct rte_pci_device *dev, bool enable); -/** - * Register a PCI driver. - * - * @param driver - * A pointer to a rte_pci_driver structure describing the driver - * to be registered. - */ -void rte_pci_register(struct rte_pci_driver *driver); - -/** Helper for PCI device registration from driver (eth, crypto) instance */ -#define RTE_PMD_REGISTER_PCI(nm, pci_drv) \ -RTE_INIT(pciinitfn_ ##nm) \ -{\ - (pci_drv).driver.name = RTE_STR(nm);\ - rte_pci_register(&pci_drv); \ -} \ -RTE_PMD_EXPORT_NAME(nm, __COUNTER__) - -/** - * Unregister a PCI driver. - * - * @param driver - * A pointer to a rte_pci_driver structure describing the driver - * to be unregistered. - */ -void rte_pci_unregister(struct rte_pci_driver *driver); - /** * Read PCI config space. * @@ -299,17 +134,6 @@ int rte_pci_read_config(const struct rte_pci_device *device, int rte_pci_write_config(const struct rte_pci_device *device, const void *buf, size_t len, off_t offset); -/** - * A structure used to access io resources for a pci device. - * rte_pci_ioport is arch, os, driver specific, and should not be used outside - * of pci ioport api. - */ -struct rte_pci_ioport { - struct rte_pci_device *dev; - uint64_t base; - uint64_t len; /* only filled for memory mapped ports */ -}; - /** * Initialize a rte_pci_ioport object for a pci device io resource. * diff --git a/drivers/bus/pci/version.map b/drivers/bus/pci/version.map index aa56439c2b..c823c1fe45 100644 --- a/drivers/bus/pci/version.map +++ b/drivers/bus/pci/version.map @@ -2,16 +2,13 @@ DPDK_22 { global: rte_pci_dump; - rte_pci_get_sysfs_path; rte_pci_ioport_map; rte_pci_ioport_read; rte_pci_ioport_unmap; rte_pci_ioport_write; rte_pci_map_device; rte_pci_read_config; - rte_pci_register; rte_pci_unmap_device; - rte_pci_unregister; rte_pci_write_config; local: *; @@ -25,3 +22,11 @@ EXPERIMENTAL { # added in 21.08 rte_pci_set_bus_master; }; + +INTERNAL { + global: + + rte_pci_get_sysfs_path; + rte_pci_register; + rte_pci_unregister; +}; diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h index 502f243a81..a7cbe444ae 100644 --- a/drivers/common/cnxk/roc_platform.h +++ b/drivers/common/cnxk/roc_platform.h @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/common/mlx5/linux/mlx5_common_os.c b/drivers/common/mlx5/linux/mlx5_common_os.c index b42102e84c..aafff60eeb 100644 --- a/drivers/common/mlx5/linux/mlx5_common_os.c +++ b/drivers/common/mlx5/linux/mlx5_common_os.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include "mlx5_common.h" diff --git a/drivers/common/mlx5/linux/mlx5_common_os.h b/drivers/common/mlx5/linux/mlx5_common_os.h index 479bb3c7cb..81702b8768 100644 --- a/drivers/common/mlx5/linux/mlx5_common_os.h +++ b/drivers/common/mlx5/linux/mlx5_common_os.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/common/mlx5/mlx5_common.h b/drivers/common/mlx5/mlx5_common.h index 63f31437da..629a639a81 100644 --- a/drivers/common/mlx5/mlx5_common.h +++ b/drivers/common/mlx5/mlx5_common.h @@ -8,7 +8,7 @@ #include #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 838b62b81c..73178ce0f3 100644 --- a/drivers/common/mlx5/mlx5_common_pci.c +++ b/drivers/common/mlx5/mlx5_common_pci.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "mlx5_common_log.h" #include "mlx5_common_private.h" diff --git a/drivers/common/mlx5/windows/mlx5_common_os.c b/drivers/common/mlx5/windows/mlx5_common_os.c index f2fc7cd494..2b6058eb3e 100644 --- a/drivers/common/mlx5/windows/mlx5_common_os.c +++ b/drivers/common/mlx5/windows/mlx5_common_os.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/common/qat/qat_device.h b/drivers/common/qat/qat_device.h index e1a32a7e87..d1512f3b89 100644 --- a/drivers/common/qat/qat_device.h +++ b/drivers/common/qat/qat_device.h @@ -4,7 +4,7 @@ #ifndef _QAT_DEVICE_H_ #define _QAT_DEVICE_H_ -#include +#include #include "qat_common.h" #include "qat_logs.h" diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c index 08ac91eac4..4a1be35b47 100644 --- a/drivers/common/qat/qat_qp.c +++ b/drivers/common/qat/qat_qp.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/common/sfc_efx/sfc_efx.h b/drivers/common/sfc_efx/sfc_efx.h index c16eca60f3..d3ea586cb8 100644 --- a/drivers/common/sfc_efx/sfc_efx.h +++ b/drivers/common/sfc_efx/sfc_efx.h @@ -10,7 +10,7 @@ #ifndef _SFC_EFX_H_ #define _SFC_EFX_H_ -#include +#include #include "efx.h" #include "efsys.h" diff --git a/drivers/compress/mlx5/mlx5_compress.c b/drivers/compress/mlx5/mlx5_compress.c index d64a628c74..3d2c45fcee 100644 --- a/drivers/compress/mlx5/mlx5_compress.c +++ b/drivers/compress/mlx5/mlx5_compress.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/compress/octeontx/otx_zip.h b/drivers/compress/octeontx/otx_zip.h index 46c80c8dc2..cdef8cc6cb 100644 --- a/drivers/compress/octeontx/otx_zip.h +++ b/drivers/compress/octeontx/otx_zip.h @@ -7,7 +7,7 @@ #include -#include +#include #include #include #include diff --git a/drivers/compress/qat/qat_comp.c b/drivers/compress/qat/qat_comp.c index e8f57c3cc4..fe4a4999c6 100644 --- a/drivers/compress/qat/qat_comp.c +++ b/drivers/compress/qat/qat_comp.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/ccp/ccp_dev.h b/drivers/crypto/ccp/ccp_dev.h index 2a205cd446..9deaae7980 100644 --- a/drivers/crypto/ccp/ccp_dev.h +++ b/drivers/crypto/ccp/ccp_dev.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/ccp/ccp_pci.h b/drivers/crypto/ccp/ccp_pci.h index 7ed3bac406..6736bf8ad3 100644 --- a/drivers/crypto/ccp/ccp_pci.h +++ b/drivers/crypto/ccp/ccp_pci.h @@ -7,7 +7,7 @@ #include -#include +#include #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices" #define PROC_MODULES "/proc/modules" diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c index a35a8cd775..4957f11e97 100644 --- a/drivers/crypto/ccp/rte_ccp_pmd.c +++ b/drivers/crypto/ccp/rte_ccp_pmd.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/crypto/cnxk/cn10k_cryptodev.c b/drivers/crypto/cnxk/cn10k_cryptodev.c index 1e0a7b91c9..3fd9f3c426 100644 --- a/drivers/crypto/cnxk/cn10k_cryptodev.c +++ b/drivers/crypto/cnxk/cn10k_cryptodev.c @@ -2,7 +2,7 @@ * Copyright(C) 2021 Marvell. */ -#include +#include #include #include #include diff --git a/drivers/crypto/cnxk/cn9k_cryptodev.c b/drivers/crypto/cnxk/cn9k_cryptodev.c index 54cd77e575..bd425f95ff 100644 --- a/drivers/crypto/cnxk/cn9k_cryptodev.c +++ b/drivers/crypto/cnxk/cn9k_cryptodev.c @@ -2,7 +2,7 @@ * Copyright(C) 2021 Marvell. */ -#include +#include #include #include #include diff --git a/drivers/crypto/mlx5/mlx5_crypto.c b/drivers/crypto/mlx5/mlx5_crypto.c index eb7616257e..dc8e291f50 100644 --- a/drivers/crypto/mlx5/mlx5_crypto.c +++ b/drivers/crypto/mlx5/mlx5_crypto.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/crypto/nitrox/nitrox_device.h b/drivers/crypto/nitrox/nitrox_device.h index 6b8095f42b..1ff7c59b63 100644 --- a/drivers/crypto/nitrox/nitrox_device.h +++ b/drivers/crypto/nitrox/nitrox_device.h @@ -5,7 +5,7 @@ #ifndef _NITROX_DEVICE_H_ #define _NITROX_DEVICE_H_ -#include +#include #include struct nitrox_sym_device; diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c index 337d06aab8..b5ab937c3a 100644 --- a/drivers/crypto/octeontx/otx_cryptodev.c +++ b/drivers/crypto/octeontx/otx_cryptodev.c @@ -2,7 +2,7 @@ * Copyright(c) 2018 Cavium, Inc */ -#include +#include #include #include #include diff --git a/drivers/crypto/octeontx/otx_cryptodev_ops.c b/drivers/crypto/octeontx/otx_cryptodev_ops.c index 7aee67ab09..11840f5ecf 100644 --- a/drivers/crypto/octeontx/otx_cryptodev_ops.c +++ b/drivers/crypto/octeontx/otx_cryptodev_ops.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.c index db6316fbe9..f3a99ae15c 100644 --- a/drivers/crypto/qat/qat_sym.c +++ b/drivers/crypto/qat/qat_sym.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include "qat_sym.h" diff --git a/drivers/crypto/virtio/virtio_cryptodev.c b/drivers/crypto/virtio/virtio_cryptodev.c index ed64866758..21bd996064 100644 --- a/drivers/crypto/virtio/virtio_cryptodev.c +++ b/drivers/crypto/virtio/virtio_cryptodev.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/virtio/virtio_pci.h b/drivers/crypto/virtio/virtio_pci.h index 0a7ea1bb64..41949c3d13 100644 --- a/drivers/crypto/virtio/virtio_pci.h +++ b/drivers/crypto/virtio/virtio_pci.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include "virtio_crypto.h" diff --git a/drivers/dma/cnxk/cnxk_dmadev.c b/drivers/dma/cnxk/cnxk_dmadev.c index 3e8c15d617..9f0de60861 100644 --- a/drivers/dma/cnxk/cnxk_dmadev.c +++ b/drivers/dma/cnxk/cnxk_dmadev.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/dma/hisilicon/hisi_dmadev.c b/drivers/dma/hisilicon/hisi_dmadev.c index 9494b60779..0e11ca14cc 100644 --- a/drivers/dma/hisilicon/hisi_dmadev.c +++ b/drivers/dma/hisilicon/hisi_dmadev.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/dma/idxd/idxd_pci.c b/drivers/dma/idxd/idxd_pci.c index 2f8ec06d9e..781fa02db3 100644 --- a/drivers/dma/idxd/idxd_pci.c +++ b/drivers/dma/idxd/idxd_pci.c @@ -2,7 +2,7 @@ * Copyright(c) 2021 Intel Corporation */ -#include +#include #include #include #include diff --git a/drivers/dma/ioat/ioat_dmadev.c b/drivers/dma/ioat/ioat_dmadev.c index a230496b11..5906eb45aa 100644 --- a/drivers/dma/ioat/ioat_dmadev.c +++ b/drivers/dma/ioat/ioat_dmadev.c @@ -2,7 +2,7 @@ * Copyright(c) 2021 Intel Corporation */ -#include +#include #include #include #include diff --git a/drivers/event/dlb2/pf/dlb2_main.h b/drivers/event/dlb2/pf/dlb2_main.h index 9eeda482a3..5aa51b1616 100644 --- a/drivers/event/dlb2/pf/dlb2_main.h +++ b/drivers/event/dlb2/pf/dlb2_main.h @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "base/dlb2_hw_types.h" diff --git a/drivers/event/dlb2/pf/dlb2_pf.c b/drivers/event/dlb2/pf/dlb2_pf.c index dd3f2b8ece..9f8c6cd8b8 100644 --- a/drivers/event/dlb2/pf/dlb2_pf.c +++ b/drivers/event/dlb2/pf/dlb2_pf.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/event/octeontx/ssovf_probe.c b/drivers/event/octeontx/ssovf_probe.c index 4da7d1ae45..2c9601a8ff 100644 --- a/drivers/event/octeontx/ssovf_probe.c +++ b/drivers/event/octeontx/ssovf_probe.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include "octeontx_mbox.h" #include "ssovf_evdev.h" diff --git a/drivers/event/octeontx/timvf_probe.c b/drivers/event/octeontx/timvf_probe.c index 59bba31e8e..7ce3eddd7e 100644 --- a/drivers/event/octeontx/timvf_probe.c +++ b/drivers/event/octeontx/timvf_probe.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include diff --git a/drivers/gpu/cuda/cuda.c b/drivers/gpu/cuda/cuda.c index 664605d9fb..2be7b8d2df 100644 --- a/drivers/gpu/cuda/cuda.c +++ b/drivers/gpu/cuda/cuda.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/mempool/cnxk/cnxk_mempool.c b/drivers/mempool/cnxk/cnxk_mempool.c index 54a1a7d3ae..78caf987d0 100644 --- a/drivers/mempool/cnxk/cnxk_mempool.c +++ b/drivers/mempool/cnxk/cnxk_mempool.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c index 8fd9edced2..1513c632c6 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.c +++ b/drivers/mempool/octeontx/octeontx_fpavf.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c index e8e4092be6..c654a229f7 100644 --- a/drivers/net/ark/ark_ethdev.c +++ b/drivers/net/ark/ark_ethdev.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index 7ac55584ff..7c0cb666fb 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h index d7e1729e68..89414ac88a 100644 --- a/drivers/net/bnx2x/bnx2x.h +++ b/drivers/net/bnx2x/bnx2x.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include "bnx2x_osal.h" diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h index e86e51e1fa..c9aa45ed3b 100644 --- a/drivers/net/bnxt/bnxt.h +++ b/drivers/net/bnxt/bnxt.h @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/bonding/rte_eth_bond_args.c b/drivers/net/bonding/rte_eth_bond_args.c index cc3805baba..4adf2d51f7 100644 --- a/drivers/net/bonding/rte_eth_bond_args.c +++ b/drivers/net/bonding/rte_eth_bond_args.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include "rte_eth_bond.h" diff --git a/drivers/net/cxgbe/base/adapter.h b/drivers/net/cxgbe/base/adapter.h index 1c016a7115..16cbc1a345 100644 --- a/drivers/net/cxgbe/base/adapter.h +++ b/drivers/net/cxgbe/base/adapter.h @@ -8,7 +8,7 @@ #ifndef __T4_ADAPTER_H__ #define __T4_ADAPTER_H__ -#include +#include #include #include #include diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index cf9a2fdc19..fd71a50a58 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 794496abfc..409de50083 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/e1000/em_rxtx.c b/drivers/net/e1000/em_rxtx.c index cea5b490ba..d48fd52404 100644 --- a/drivers/net/e1000/em_rxtx.c +++ b/drivers/net/e1000/em_rxtx.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index a9c18b27e8..43979992d3 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/e1000/igb_pf.c b/drivers/net/e1000/igb_pf.c index 3f3fd0d61e..c7588ea57e 100644 --- a/drivers/net/e1000/igb_pf.c +++ b/drivers/net/e1000/igb_pf.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h index 0db0918b43..4709675af8 100644 --- a/drivers/net/ena/ena_ethdev.h +++ b/drivers/net/ena/ena_ethdev.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/enic/base/vnic_dev.h b/drivers/net/enic/base/vnic_dev.h index 4b9f75b65f..44ca5c739f 100644 --- a/drivers/net/enic/base/vnic_dev.h +++ b/drivers/net/enic/base/vnic_dev.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include "enic_compat.h" #include "vnic_resource.h" diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index a8d470e8ac..998436e5e8 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -8,7 +8,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 9f351de72e..19a99a82c5 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/enic/enic_vf_representor.c b/drivers/net/enic/enic_vf_representor.c index 1ad6ad3dfb..7312c411bd 100644 --- a/drivers/net/enic/enic_vf_representor.c +++ b/drivers/net/enic/enic_vf_representor.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/hinic/base/hinic_pmd_hwdev.c b/drivers/net/hinic/base/hinic_pmd_hwdev.c index 5eb022297e..818698dcb3 100644 --- a/drivers/net/hinic/base/hinic_pmd_hwdev.c +++ b/drivers/net/hinic/base/hinic_pmd_hwdev.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/net/hinic/base/hinic_pmd_hwif.c b/drivers/net/hinic/base/hinic_pmd_hwif.c index 26fa1e27d4..2d3f192b21 100644 --- a/drivers/net/hinic/base/hinic_pmd_hwif.c +++ b/drivers/net/hinic/base/hinic_pmd_hwif.c @@ -2,7 +2,7 @@ * Copyright(c) 2017 Huawei Technologies Co., Ltd */ -#include +#include #include "hinic_compat.h" #include "hinic_csr.h" diff --git a/drivers/net/hinic/base/hinic_pmd_nicio.c b/drivers/net/hinic/base/hinic_pmd_nicio.c index ad5db9f1de..ad42773bd3 100644 --- a/drivers/net/hinic/base/hinic_pmd_nicio.c +++ b/drivers/net/hinic/base/hinic_pmd_nicio.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Huawei Technologies Co., Ltd */ -#include +#include #include "hinic_compat.h" #include "hinic_pmd_hwdev.h" diff --git a/drivers/net/hinic/hinic_pmd_ethdev.c b/drivers/net/hinic/hinic_pmd_ethdev.c index 35788f46eb..7aa5e7d8e9 100644 --- a/drivers/net/hinic/hinic_pmd_ethdev.c +++ b/drivers/net/hinic/hinic_pmd_ethdev.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/net/hns3/hns3_common.c b/drivers/net/hns3/hns3_common.c index 424205356e..e8e5aa2c86 100644 --- a/drivers/net/hns3/hns3_common.c +++ b/drivers/net/hns3/hns3_common.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c index 6b1d1a5fb1..144daf1636 100644 --- a/drivers/net/hns3/hns3_ethdev.c +++ b/drivers/net/hns3/hns3_ethdev.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include "hns3_ethdev.h" diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c index 95f711e7eb..cd0c91f3a3 100644 --- a/drivers/net/hns3/hns3_rxtx.c +++ b/drivers/net/hns3/hns3_rxtx.c @@ -2,7 +2,7 @@ * Copyright(c) 2018-2021 HiSilicon Limited. */ -#include +#include #include #include #include diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 7ab788246c..87c22b6b54 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c index 7f8e81858e..cc0f992453 100644 --- a/drivers/net/i40e/i40e_vf_representor.c +++ b/drivers/net/i40e/i40e_vf_representor.c @@ -2,7 +2,7 @@ * Copyright(c) 2018 Intel Corporation. */ -#include +#include #include #include #include diff --git a/drivers/net/igc/igc_ethdev.c b/drivers/net/igc/igc_ethdev.c index 7f221a5d34..e3727b7b41 100644 --- a/drivers/net/igc/igc_ethdev.c +++ b/drivers/net/igc/igc_ethdev.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/ionic/ionic.h b/drivers/net/ionic/ionic.h index 49b90d1b7c..a55202b178 100644 --- a/drivers/net/ionic/ionic.h +++ b/drivers/net/ionic/ionic.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include "ionic_dev.h" #include "ionic_if.h" diff --git a/drivers/net/ionic/ionic_ethdev.c b/drivers/net/ionic/ionic_ethdev.c index 28280c5377..d72033c32c 100644 --- a/drivers/net/ionic/ionic_ethdev.c +++ b/drivers/net/ionic/ionic_ethdev.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.c b/drivers/net/ipn3ke/ipn3ke_ethdev.c index 2e39113941..70a06a3b15 100644 --- a/drivers/net/ipn3ke/ipn3ke_ethdev.c +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.c @@ -4,7 +4,7 @@ #include -#include +#include #include #include #include diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c b/drivers/net/ipn3ke/ipn3ke_representor.c index 2f088d767f..2ef96a984a 100644 --- a/drivers/net/ipn3ke/ipn3ke_representor.c +++ b/drivers/net/ipn3ke/ipn3ke_representor.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/ipn3ke/ipn3ke_tm.c b/drivers/net/ipn3ke/ipn3ke_tm.c index 2f242b678a..0260227900 100644 --- a/drivers/net/ipn3ke/ipn3ke_tm.c +++ b/drivers/net/ipn3ke/ipn3ke_tm.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index f31bbb7895..552e41692c 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/ixgbe/ixgbe_ethdev.h b/drivers/net/ixgbe/ixgbe_ethdev.h index cc6049a66a..ff34fd1515 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.h +++ b/drivers/net/ixgbe/ixgbe_ethdev.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include /* need update link, bit flag */ diff --git a/drivers/net/mlx4/mlx4_ethdev.c b/drivers/net/mlx4/mlx4_ethdev.c index ce74c51ce2..bb1dd33e7c 100644 --- a/drivers/net/mlx4/mlx4_ethdev.c +++ b/drivers/net/mlx4/mlx4_ethdev.c @@ -32,7 +32,7 @@ #pragma GCC diagnostic error "-Wpedantic" #endif -#include +#include #include #include #include diff --git a/drivers/net/mlx5/linux/mlx5_ethdev_os.c b/drivers/net/mlx5/linux/mlx5_ethdev_os.c index aaf636aa0d..661d362dc0 100644 --- a/drivers/net/mlx5/linux/mlx5_ethdev_os.c +++ b/drivers/net/mlx5/linux/mlx5_ethdev_os.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 62f654d18e..4f0a6f4d55 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index 998846adbe..30923b0732 100644 --- a/drivers/net/mlx5/mlx5.c +++ b/drivers/net/mlx5/mlx5.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c index 05c919ed39..a5c7ca8c52 100644 --- a/drivers/net/mlx5/mlx5_ethdev.c +++ b/drivers/net/mlx5/mlx5_ethdev.c @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index bee9363515..e122b39cb3 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 0140f8b3b2..9150ced72d 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/netvsc/hn_vf.c b/drivers/net/netvsc/hn_vf.c index 62948bf889..cce0a79edb 100644 --- a/drivers/net/netvsc/hn_vf.c +++ b/drivers/net/netvsc/hn_vf.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/ngbe/base/ngbe_osdep.h b/drivers/net/ngbe/base/ngbe_osdep.h index bf1fa30312..8783fce4dd 100644 --- a/drivers/net/ngbe/base/ngbe_osdep.h +++ b/drivers/net/ngbe/base/ngbe_osdep.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "../ngbe_logs.h" diff --git a/drivers/net/ngbe/ngbe_pf.c b/drivers/net/ngbe/ngbe_pf.c index 12a18de31d..947ae7fe94 100644 --- a/drivers/net/ngbe/ngbe_pf.c +++ b/drivers/net/ngbe/ngbe_pf.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include "base/ngbe.h" #include "ngbe_ethdev.h" diff --git a/drivers/net/octeontx/base/octeontx_pkivf.c b/drivers/net/octeontx/base/octeontx_pkivf.c index 0ddff54886..6a48a22de6 100644 --- a/drivers/net/octeontx/base/octeontx_pkivf.c +++ b/drivers/net/octeontx/base/octeontx_pkivf.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include "../octeontx_logs.h" #include "octeontx_io.h" diff --git a/drivers/net/octeontx/base/octeontx_pkovf.c b/drivers/net/octeontx/base/octeontx_pkovf.c index bf28bc7992..5d445dfb49 100644 --- a/drivers/net/octeontx/base/octeontx_pkovf.c +++ b/drivers/net/octeontx/base/octeontx_pkovf.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include "../octeontx_logs.h" diff --git a/drivers/net/qede/base/bcm_osal.h b/drivers/net/qede/base/bcm_osal.h index 9ea579bfc8..67e7f759fe 100644 --- a/drivers/net/qede/base/bcm_osal.h +++ b/drivers/net/qede/base/bcm_osal.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include /* Forward declaration */ struct ecore_dev; diff --git a/drivers/net/sfc/sfc.h b/drivers/net/sfc/sfc.h index a0979618be..0a1e224fa2 100644 --- a/drivers/net/sfc/sfc.h +++ b/drivers/net/sfc/sfc.h @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 39f85e8b84..506c62a726 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/sfc/sfc_sriov.c b/drivers/net/sfc/sfc_sriov.c index 385b172e2e..009b884d8d 100644 --- a/drivers/net/sfc/sfc_sriov.c +++ b/drivers/net/sfc/sfc_sriov.c @@ -8,7 +8,7 @@ */ #include -#include +#include #include "sfc.h" #include "sfc_log.h" diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 262c024560..28183ec740 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/txgbe/txgbe_ethdev.h b/drivers/net/txgbe/txgbe_ethdev.h index 262dbb5e38..6fb22ca7d9 100644 --- a/drivers/net/txgbe/txgbe_ethdev.h +++ b/drivers/net/txgbe/txgbe_ethdev.h @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include /* need update link, bit flag */ diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c index d0093c0163..f19bdf36dc 100644 --- a/drivers/net/txgbe/txgbe_flow.c +++ b/drivers/net/txgbe/txgbe_flow.c @@ -4,7 +4,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/net/txgbe/txgbe_pf.c b/drivers/net/txgbe/txgbe_pf.c index 0b82fb1a88..176f79005c 100644 --- a/drivers/net/txgbe/txgbe_pf.c +++ b/drivers/net/txgbe/txgbe_pf.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "base/txgbe.h" #include "txgbe_ethdev.h" diff --git a/drivers/net/virtio/virtio_pci.h b/drivers/net/virtio/virtio_pci.h index 11e25a0142..6d4a8712c2 100644 --- a/drivers/net/virtio/virtio_pci.h +++ b/drivers/net/virtio/virtio_pci.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include "virtio.h" diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c index 1f6bdeddda..2b9e35cef5 100644 --- a/drivers/net/virtio/virtio_pci_ethdev.c +++ b/drivers/net/virtio/virtio_pci_ethdev.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 2af67dc0a3..101b1cb500 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c index 349d551839..db029cbf34 100644 --- a/drivers/raw/cnxk_bphy/cnxk_bphy.c +++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2021 Marvell. */ -#include +#include #include #include #include diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c index 26def43564..2d8466ef91 100644 --- a/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c index bbe7f74def..b424d6127d 100644 --- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.c @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2021 Marvell. */ -#include +#include #include #include #include diff --git a/drivers/raw/ifpga/afu_pmd_he_hssi.c b/drivers/raw/ifpga/afu_pmd_he_hssi.c index eca1edc270..859f28dcc1 100644 --- a/drivers/raw/ifpga/afu_pmd_he_hssi.c +++ b/drivers/raw/ifpga/afu_pmd_he_hssi.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/raw/ifpga/afu_pmd_he_lpbk.c b/drivers/raw/ifpga/afu_pmd_he_lpbk.c index da0aba6e00..c7c5cda48c 100644 --- a/drivers/raw/ifpga/afu_pmd_he_lpbk.c +++ b/drivers/raw/ifpga/afu_pmd_he_lpbk.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/raw/ifpga/afu_pmd_he_mem.c b/drivers/raw/ifpga/afu_pmd_he_mem.c index 3c41aa9ee8..a1db533eeb 100644 --- a/drivers/raw/ifpga/afu_pmd_he_mem.c +++ b/drivers/raw/ifpga/afu_pmd_he_mem.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/raw/ifpga/afu_pmd_n3000.c b/drivers/raw/ifpga/afu_pmd_n3000.c index b7438bd372..67b3941265 100644 --- a/drivers/raw/ifpga/afu_pmd_n3000.c +++ b/drivers/raw/ifpga/afu_pmd_n3000.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index d9beb72db3..f6e07dc37b 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/raw/ifpga/rte_pmd_ifpga.c b/drivers/raw/ifpga/rte_pmd_ifpga.c index 1ca248123b..a47d5a0350 100644 --- a/drivers/raw/ifpga/rte_pmd_ifpga.c +++ b/drivers/raw/ifpga/rte_pmd_ifpga.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include "rte_pmd_ifpga.h" diff --git a/drivers/raw/ioat/idxd_pci.c b/drivers/raw/ioat/idxd_pci.c index 13515dbc6c..90ec0222e6 100644 --- a/drivers/raw/ioat/idxd_pci.c +++ b/drivers/raw/ioat/idxd_pci.c @@ -2,7 +2,7 @@ * Copyright(c) 2020 Intel Corporation */ -#include +#include #include #include diff --git a/drivers/raw/ioat/ioat_rawdev.c b/drivers/raw/ioat/ioat_rawdev.c index 11341fcf5d..f58006bbda 100644 --- a/drivers/raw/ioat/ioat_rawdev.c +++ b/drivers/raw/ioat/ioat_rawdev.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/raw/ntb/ntb.c b/drivers/raw/ntb/ntb.c index f5e773c53b..76e98fe515 100644 --- a/drivers/raw/ntb/ntb.c +++ b/drivers/raw/ntb/ntb.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/raw/ntb/ntb_hw_intel.c b/drivers/raw/ntb/ntb_hw_intel.c index 20cdb761a3..9b4465176a 100644 --- a/drivers/raw/ntb/ntb_hw_intel.c +++ b/drivers/raw/ntb/ntb_hw_intel.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/regex/mlx5/mlx5_regex.c b/drivers/regex/mlx5/mlx5_regex.c index 9f79c6907c..4c20daac94 100644 --- a/drivers/regex/mlx5/mlx5_regex.c +++ b/drivers/regex/mlx5/mlx5_regex.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/regex/mlx5/mlx5_regex_fastpath.c b/drivers/regex/mlx5/mlx5_regex_fastpath.c index 9a2db7e43f..0a8c83fe14 100644 --- a/drivers/regex/mlx5/mlx5_regex_fastpath.c +++ b/drivers/regex/mlx5/mlx5_regex_fastpath.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/vdpa/ifc/base/ifcvf_osdep.h b/drivers/vdpa/ifc/base/ifcvf_osdep.h index 6aef25ea45..f462193f55 100644 --- a/drivers/vdpa/ifc/base/ifcvf_osdep.h +++ b/drivers/vdpa/ifc/base/ifcvf_osdep.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c index ac42de9c79..d5ac583589 100644 --- a/drivers/vdpa/ifc/ifcvf_vdpa.c +++ b/drivers/vdpa/ifc/ifcvf_vdpa.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.c b/drivers/vdpa/mlx5/mlx5_vdpa.c index 91af792a3a..026daa3f24 100644 --- a/drivers/vdpa/mlx5/mlx5_vdpa.c +++ b/drivers/vdpa/mlx5/mlx5_vdpa.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/vdpa/sfc/sfc_vdpa.h b/drivers/vdpa/sfc/sfc_vdpa.h index daeb27d4cd..b25eb3a5fe 100644 --- a/drivers/vdpa/sfc/sfc_vdpa.h +++ b/drivers/vdpa/sfc/sfc_vdpa.h @@ -8,7 +8,7 @@ #include #include -#include +#include #include "sfc_efx.h" #include "sfc_efx_mcdi.h" diff --git a/lib/ethdev/ethdev_pci.h b/lib/ethdev/ethdev_pci.h index b4bb460dcb..7e4ff46684 100644 --- a/lib/ethdev/ethdev_pci.h +++ b/lib/ethdev/ethdev_pci.h @@ -10,12 +10,12 @@ extern "C" { #endif +#include +#include #include #include #include -#include #include -#include /** * Copy pci device info to the Ethernet device data. diff --git a/lib/eventdev/eventdev_pmd_pci.h b/lib/eventdev/eventdev_pmd_pci.h index 24b56faaa9..7bbec40c71 100644 --- a/lib/eventdev/eventdev_pmd_pci.h +++ b/lib/eventdev/eventdev_pmd_pci.h @@ -23,7 +23,7 @@ extern "C" { #include #include #include -#include +#include #include "eventdev_pmd.h" From patchwork Sat Jul 9 08:26:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113880 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8E0C0A00C5; Sat, 9 Jul 2022 10:29:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3700C42B6D; Sat, 9 Jul 2022 10:29:28 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id D8260410F2 for ; Sat, 9 Jul 2022 10:29:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355366; 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=NDWhmiP9ULiXKxwlwUIzzrdhKy/vURs6zLy4FEShI0s=; b=Tgkt0n+ZRYDGXjQcOa6V+G5FDaVcyZgrrkutsU8E8OdPGRBEZ/lM3orCEDmUadlMSWJ8k2 /daRyglgERnfDB44zEbhnYxac+zPwJwRQSJseEtewqGOimgJAw8f4WdUN2x9t81VNd3SUx SukY1urJ+3g85Xl2jdYPDZ6F7TybTaY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-99-6jzmzPWkOleyEgW78asFTw-1; Sat, 09 Jul 2022 04:29:23 -0400 X-MC-Unique: 6jzmzPWkOleyEgW78asFTw-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 E6E89811E80; Sat, 9 Jul 2022 08:29:20 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2CB382026D64; Sat, 9 Jul 2022 08:29:13 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Gagandeep Singh , Hemant Agrawal , Nicolas Chautru , Ray Kinsella , Lee Daly , Fan Zhang , Ashish Gupta , Sunila Sahu , Ruifeng Wang , Ajit Khaparde , Raveendra Padasalagi , Vikas Gupta , Chandubabu Namburu , Pablo de Lara , Michael Shamis , Liron Himi , Chengwen Feng , Kevin Laatz , Bruce Richardson , Sachin Saxena , Jerin Jacob , Liang Ma , Peter Mccarthy , Harry van Haaren , "John W. Linville" , Ciara Loftus , Qi Zhang , Chas Williams , "Min Hu (Connor)" , Gaetan Rivet , Rosen Xu , Jakub Grajciar , Zyta Szpak , Tetsuya Mukawa , Harman Kalra , Jasvinder Singh , Cristian Dumitrescu , Matan Azrad , Maxime Coquelin , Chenbo Xia , Jakub Palider , Tomasz Duszynski , Tianfei zhang , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Subject: [RFC v2 v2 24/29] bus/vdev: make driver-only headers private Date: Sat, 9 Jul 2022 10:26:39 +0200 Message-Id: <20220709082644.664675-25-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 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 vdev bus interface is for drivers only. Mark as internal and move the header on the driver headers list. Signed-off-by: David Marchand --- app/test/test_vdev.c | 2 +- drivers/baseband/la12xx/bbdev_la12xx.c | 2 +- drivers/baseband/null/bbdev_null.c | 2 +- .../baseband/turbo_sw/bbdev_turbo_software.c | 2 +- drivers/bus/vdev/bus_vdev_driver.h | 151 ++++++++++++++++++ drivers/bus/vdev/meson.build | 1 + drivers/bus/vdev/rte_bus_vdev.h | 131 --------------- drivers/bus/vdev/vdev.c | 2 +- drivers/bus/vdev/version.map | 9 +- drivers/compress/isal/isal_compress_pmd.c | 2 +- drivers/compress/zlib/zlib_pmd.c | 2 +- drivers/crypto/armv8/rte_armv8_pmd.c | 2 +- drivers/crypto/bcmfs/bcmfs_device.h | 2 +- drivers/crypto/caam_jr/caam_jr.c | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/ipsec_mb/ipsec_mb_private.c | 2 +- drivers/crypto/ipsec_mb/ipsec_mb_private.h | 2 +- drivers/crypto/ipsec_mb/pmd_kasumi.c | 2 +- drivers/crypto/mvsam/rte_mrvl_pmd.c | 2 +- drivers/crypto/null/null_crypto_pmd.c | 2 +- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- drivers/crypto/scheduler/scheduler_pmd.c | 2 +- drivers/dma/skeleton/skeleton_dmadev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 2 +- drivers/event/octeontx/ssovf_evdev.c | 2 +- drivers/event/octeontx/ssovf_evdev_selftest.c | 2 +- drivers/event/opdl/opdl_evdev.c | 2 +- drivers/event/opdl/opdl_evdev_init.c | 2 +- drivers/event/opdl/opdl_test.c | 2 +- drivers/event/skeleton/skeleton_eventdev.c | 2 +- drivers/event/sw/sw_evdev.c | 2 +- drivers/event/sw/sw_evdev_selftest.c | 2 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/bonding/rte_eth_bond_api.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 2 +- drivers/net/failsafe/failsafe.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.h | 2 +- drivers/net/kni/rte_eth_kni.c | 2 +- drivers/net/memif/memif_socket.c | 2 +- drivers/net/memif/rte_eth_memif.c | 2 +- drivers/net/mvneta/mvneta_ethdev.c | 2 +- drivers/net/mvpp2/mrvl_ethdev.c | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/octeontx/octeontx_ethdev.c | 2 +- drivers/net/pcap/pcap_ethdev.c | 2 +- drivers/net/pfe/pfe_ethdev.c | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/softnic/rte_eth_softnic.c | 2 +- drivers/net/tap/rte_eth_tap.c | 2 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_user_ethdev.c | 2 +- drivers/raw/cnxk_gpio/cnxk_gpio.c | 2 +- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/skeleton/skeleton_rawdev.c | 2 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 2 +- lib/ethdev/ethdev_vdev.h | 2 +- lib/eventdev/eventdev_pmd_vdev.h | 2 +- 61 files changed, 216 insertions(+), 190 deletions(-) create mode 100644 drivers/bus/vdev/bus_vdev_driver.h diff --git a/app/test/test_vdev.c b/app/test/test_vdev.c index 9e39993e90..0b71e9329b 100644 --- a/app/test/test_vdev.c +++ b/app/test/test_vdev.c @@ -7,9 +7,9 @@ #include #include +#include #include #include -#include #include "test.h" diff --git a/drivers/baseband/la12xx/bbdev_la12xx.c b/drivers/baseband/la12xx/bbdev_la12xx.c index 4d1bd16751..f0927d9fca 100644 --- a/drivers/baseband/la12xx/bbdev_la12xx.c +++ b/drivers/baseband/la12xx/bbdev_la12xx.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/baseband/null/bbdev_null.c b/drivers/baseband/null/bbdev_null.c index 248e12987f..e76ef2313f 100644 --- a/drivers/baseband/null/bbdev_null.c +++ b/drivers/baseband/null/bbdev_null.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/baseband/turbo_sw/bbdev_turbo_software.c b/drivers/baseband/turbo_sw/bbdev_turbo_software.c index af7bc416f9..e8d0c43e6f 100644 --- a/drivers/baseband/turbo_sw/bbdev_turbo_software.c +++ b/drivers/baseband/turbo_sw/bbdev_turbo_software.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/bus/vdev/bus_vdev_driver.h b/drivers/bus/vdev/bus_vdev_driver.h new file mode 100644 index 0000000000..36748cdfae --- /dev/null +++ b/drivers/bus/vdev/bus_vdev_driver.h @@ -0,0 +1,151 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2016 RehiveTech. All rights reserved. + */ + +#ifndef BUS_VDEV_DRIVER_H +#define BUS_VDEV_DRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include +#include + +struct rte_vdev_device { + RTE_TAILQ_ENTRY(rte_vdev_device) next; /**< Next attached vdev */ + struct rte_device device; /**< Inherit core device */ +}; + +/** + * @internal + * Helper macro for drivers that need to convert to struct rte_vdev_device. + */ +#define RTE_DEV_TO_VDEV(ptr) \ + container_of(ptr, struct rte_vdev_device, device) + +#define RTE_DEV_TO_VDEV_CONST(ptr) \ + container_of(ptr, const struct rte_vdev_device, device) + +#define RTE_ETH_DEV_TO_VDEV(eth_dev) RTE_DEV_TO_VDEV((eth_dev)->device) + +static inline const char * +rte_vdev_device_name(const struct rte_vdev_device *dev) +{ + if (dev && dev->device.name) + return dev->device.name; + return NULL; +} + +static inline const char * +rte_vdev_device_args(const struct rte_vdev_device *dev) +{ + if (dev && dev->device.devargs) + return dev->device.devargs->args; + return ""; +} + +/** + * Probe function called for each virtual device driver once. + */ +typedef int (rte_vdev_probe_t)(struct rte_vdev_device *dev); + +/** + * Remove function called for each virtual device driver once. + */ +typedef int (rte_vdev_remove_t)(struct rte_vdev_device *dev); + +/** + * Driver-specific DMA mapping. After a successful call the device + * will be able to read/write from/to this segment. + * + * @param dev + * Pointer to the Virtual device. + * @param addr + * Starting virtual address of memory to be mapped. + * @param iova + * Starting IOVA address of memory to be mapped. + * @param len + * Length of memory segment being mapped. + * @return + * - 0 On success. + * - Negative value and rte_errno is set otherwise. + */ +typedef int (rte_vdev_dma_map_t)(struct rte_vdev_device *dev, void *addr, + uint64_t iova, size_t len); + +/** + * Driver-specific DMA un-mapping. After a successful call the device + * will not be able to read/write from/to this segment. + * + * @param dev + * Pointer to the Virtual device. + * @param addr + * Starting virtual address of memory to be unmapped. + * @param iova + * Starting IOVA address of memory to be unmapped. + * @param len + * Length of memory segment being unmapped. + * @return + * - 0 On success. + * - Negative value and rte_errno is set otherwise. + */ +typedef int (rte_vdev_dma_unmap_t)(struct rte_vdev_device *dev, void *addr, + uint64_t iova, size_t len); + +/** + * A virtual device driver abstraction. + */ +struct rte_vdev_driver { + RTE_TAILQ_ENTRY(rte_vdev_driver) next; /**< Next in list. */ + struct rte_driver driver; /**< Inherited general driver. */ + rte_vdev_probe_t *probe; /**< Virtual device probe function. */ + rte_vdev_remove_t *remove; /**< Virtual device remove function. */ + rte_vdev_dma_map_t *dma_map; /**< Virtual device DMA map function. */ + rte_vdev_dma_unmap_t *dma_unmap; /**< Virtual device DMA unmap function. */ + uint32_t drv_flags; /**< Flags RTE_VDEV_DRV_*. */ +}; + +/** Device driver needs IOVA as VA and cannot work with IOVA as PA */ +#define RTE_VDEV_DRV_NEED_IOVA_AS_VA 0x0001 + +/** + * Register a virtual device driver. + * + * @param driver + * A pointer to a rte_vdev_driver structure describing the driver + * to be registered. + */ +__rte_internal +void rte_vdev_register(struct rte_vdev_driver *driver); + +/** + * Unregister a virtual device driver. + * + * @param driver + * A pointer to a rte_vdev_driver structure describing the driver + * to be unregistered. + */ +__rte_internal +void rte_vdev_unregister(struct rte_vdev_driver *driver); + +#define RTE_PMD_REGISTER_VDEV(nm, vdrv)\ +static const char *vdrvinit_ ## nm ## _alias;\ +RTE_INIT(vdrvinitfn_ ##vdrv)\ +{\ + (vdrv).driver.name = RTE_STR(nm);\ + (vdrv).driver.alias = vdrvinit_ ## nm ## _alias;\ + rte_vdev_register(&vdrv);\ +} \ +RTE_PMD_EXPORT_NAME(nm, __COUNTER__) + +#define RTE_PMD_REGISTER_ALIAS(nm, alias)\ +static const char *vdrvinit_ ## nm ## _alias = RTE_STR(alias) + +#ifdef __cplusplus +} +#endif + +#endif /* BUS_VDEV_DRIVER_H */ diff --git a/drivers/bus/vdev/meson.build b/drivers/bus/vdev/meson.build index 8adf674530..1532ed4f35 100644 --- a/drivers/bus/vdev/meson.build +++ b/drivers/bus/vdev/meson.build @@ -6,5 +6,6 @@ sources = files( 'vdev_params.c', ) headers = files('rte_bus_vdev.h') +driver_sdk_headers = files('bus_vdev_driver.h') deps += ['kvargs'] diff --git a/drivers/bus/vdev/rte_bus_vdev.h b/drivers/bus/vdev/rte_bus_vdev.h index ce20faf649..f48dd24e5e 100644 --- a/drivers/bus/vdev/rte_bus_vdev.h +++ b/drivers/bus/vdev/rte_bus_vdev.h @@ -15,137 +15,6 @@ extern "C" { #endif -#include -#include - -struct rte_vdev_device { - RTE_TAILQ_ENTRY(rte_vdev_device) next; /**< Next attached vdev */ - struct rte_device device; /**< Inherit core device */ -}; - -/** - * @internal - * Helper macro for drivers that need to convert to struct rte_vdev_device. - */ -#define RTE_DEV_TO_VDEV(ptr) \ - container_of(ptr, struct rte_vdev_device, device) - -#define RTE_DEV_TO_VDEV_CONST(ptr) \ - container_of(ptr, const struct rte_vdev_device, device) - -#define RTE_ETH_DEV_TO_VDEV(eth_dev) RTE_DEV_TO_VDEV((eth_dev)->device) - -static inline const char * -rte_vdev_device_name(const struct rte_vdev_device *dev) -{ - if (dev && dev->device.name) - return dev->device.name; - return NULL; -} - -static inline const char * -rte_vdev_device_args(const struct rte_vdev_device *dev) -{ - if (dev && dev->device.devargs) - return dev->device.devargs->args; - return ""; -} - -/** - * Probe function called for each virtual device driver once. - */ -typedef int (rte_vdev_probe_t)(struct rte_vdev_device *dev); - -/** - * Remove function called for each virtual device driver once. - */ -typedef int (rte_vdev_remove_t)(struct rte_vdev_device *dev); - -/** - * Driver-specific DMA mapping. After a successful call the device - * will be able to read/write from/to this segment. - * - * @param dev - * Pointer to the Virtual device. - * @param addr - * Starting virtual address of memory to be mapped. - * @param iova - * Starting IOVA address of memory to be mapped. - * @param len - * Length of memory segment being mapped. - * @return - * - 0 On success. - * - Negative value and rte_errno is set otherwise. - */ -typedef int (rte_vdev_dma_map_t)(struct rte_vdev_device *dev, void *addr, - uint64_t iova, size_t len); - -/** - * Driver-specific DMA un-mapping. After a successful call the device - * will not be able to read/write from/to this segment. - * - * @param dev - * Pointer to the Virtual device. - * @param addr - * Starting virtual address of memory to be unmapped. - * @param iova - * Starting IOVA address of memory to be unmapped. - * @param len - * Length of memory segment being unmapped. - * @return - * - 0 On success. - * - Negative value and rte_errno is set otherwise. - */ -typedef int (rte_vdev_dma_unmap_t)(struct rte_vdev_device *dev, void *addr, - uint64_t iova, size_t len); - -/** - * A virtual device driver abstraction. - */ -struct rte_vdev_driver { - RTE_TAILQ_ENTRY(rte_vdev_driver) next; /**< Next in list. */ - struct rte_driver driver; /**< Inherited general driver. */ - rte_vdev_probe_t *probe; /**< Virtual device probe function. */ - rte_vdev_remove_t *remove; /**< Virtual device remove function. */ - rte_vdev_dma_map_t *dma_map; /**< Virtual device DMA map function. */ - rte_vdev_dma_unmap_t *dma_unmap; /**< Virtual device DMA unmap function. */ - uint32_t drv_flags; /**< Flags RTE_VDEV_DRV_*. */ -}; - -/** Device driver needs IOVA as VA and cannot work with IOVA as PA */ -#define RTE_VDEV_DRV_NEED_IOVA_AS_VA 0x0001 - -/** - * Register a virtual device driver. - * - * @param driver - * A pointer to a rte_vdev_driver structure describing the driver - * to be registered. - */ -void rte_vdev_register(struct rte_vdev_driver *driver); - -/** - * Unregister a virtual device driver. - * - * @param driver - * A pointer to a rte_vdev_driver structure describing the driver - * to be unregistered. - */ -void rte_vdev_unregister(struct rte_vdev_driver *driver); - -#define RTE_PMD_REGISTER_VDEV(nm, vdrv)\ -static const char *vdrvinit_ ## nm ## _alias;\ -RTE_INIT(vdrvinitfn_ ##vdrv)\ -{\ - (vdrv).driver.name = RTE_STR(nm);\ - (vdrv).driver.alias = vdrvinit_ ## nm ## _alias;\ - rte_vdev_register(&vdrv);\ -} \ -RTE_PMD_EXPORT_NAME(nm, __COUNTER__) - -#define RTE_PMD_REGISTER_ALIAS(nm, alias)\ -static const char *vdrvinit_ ## nm ## _alias = RTE_STR(alias) - typedef void (*rte_vdev_scan_callback)(void *user_arg); /** diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index ee569fcdf2..1b8410fe5b 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -21,7 +22,6 @@ #include #include -#include "rte_bus_vdev.h" #include "vdev_logs.h" #include "vdev_private.h" diff --git a/drivers/bus/vdev/version.map b/drivers/bus/vdev/version.map index 0d60b7e2bc..594646d550 100644 --- a/drivers/bus/vdev/version.map +++ b/drivers/bus/vdev/version.map @@ -3,10 +3,15 @@ DPDK_22 { rte_vdev_add_custom_scan; rte_vdev_init; - rte_vdev_register; rte_vdev_remove_custom_scan; rte_vdev_uninit; - rte_vdev_unregister; local: *; }; + +INTERNAL { + global: + + rte_vdev_register; + rte_vdev_unregister; +}; diff --git a/drivers/compress/isal/isal_compress_pmd.c b/drivers/compress/isal/isal_compress_pmd.c index b7ba61c434..cb23e929ed 100644 --- a/drivers/compress/isal/isal_compress_pmd.c +++ b/drivers/compress/isal/isal_compress_pmd.c @@ -3,7 +3,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/compress/zlib/zlib_pmd.c b/drivers/compress/zlib/zlib_pmd.c index 0220c6d038..98abd41013 100644 --- a/drivers/compress/zlib/zlib_pmd.c +++ b/drivers/compress/zlib/zlib_pmd.c @@ -2,7 +2,7 @@ * Copyright(c) 2018 Cavium Networks */ -#include +#include #include #include "zlib_pmd_private.h" diff --git a/drivers/crypto/armv8/rte_armv8_pmd.c b/drivers/crypto/armv8/rte_armv8_pmd.c index 32127a874c..5c060e71a3 100644 --- a/drivers/crypto/armv8/rte_armv8_pmd.c +++ b/drivers/crypto/armv8/rte_armv8_pmd.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/crypto/bcmfs/bcmfs_device.h b/drivers/crypto/bcmfs/bcmfs_device.h index 4901a6cfd9..610454dd5e 100644 --- a/drivers/crypto/bcmfs/bcmfs_device.h +++ b/drivers/crypto/bcmfs/bcmfs_device.h @@ -9,7 +9,7 @@ #include #include -#include +#include #include "bcmfs_logs.h" #include "bcmfs_qp.h" diff --git a/drivers/crypto/caam_jr/caam_jr.c b/drivers/crypto/caam_jr/caam_jr.c index 8e9cfe73d8..8c0b4909cf 100644 --- a/drivers/crypto/caam_jr/caam_jr.c +++ b/drivers/crypto/caam_jr/caam_jr.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c index 4957f11e97..6c3e45e333 100644 --- a/drivers/crypto/ccp/rte_ccp_pmd.c +++ b/drivers/crypto/ccp/rte_ccp_pmd.c @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.c b/drivers/crypto/ipsec_mb/ipsec_mb_private.c index aab42c360c..2e7347fa79 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_private.c +++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.c @@ -2,7 +2,7 @@ * Copyright(c) 2021 Intel Corporation */ -#include +#include #include #include diff --git a/drivers/crypto/ipsec_mb/ipsec_mb_private.h b/drivers/crypto/ipsec_mb/ipsec_mb_private.h index e2c240dfc0..d0d4258ee1 100644 --- a/drivers/crypto/ipsec_mb/ipsec_mb_private.h +++ b/drivers/crypto/ipsec_mb/ipsec_mb_private.h @@ -7,7 +7,7 @@ #include #include -#include +#include #if defined(RTE_LIB_SECURITY) #define IPSEC_MB_DOCSIS_SEC_ENABLED 1 diff --git a/drivers/crypto/ipsec_mb/pmd_kasumi.c b/drivers/crypto/ipsec_mb/pmd_kasumi.c index c9d4f9d0ae..fba10b8cf4 100644 --- a/drivers/crypto/ipsec_mb/pmd_kasumi.c +++ b/drivers/crypto/ipsec_mb/pmd_kasumi.c @@ -2,7 +2,7 @@ * Copyright(c) 2016-2021 Intel Corporation */ -#include +#include #include #include #include diff --git a/drivers/crypto/mvsam/rte_mrvl_pmd.c b/drivers/crypto/mvsam/rte_mrvl_pmd.c index 04efd9aaa8..c35876c8b4 100644 --- a/drivers/crypto/mvsam/rte_mrvl_pmd.c +++ b/drivers/crypto/mvsam/rte_mrvl_pmd.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c index 9ecb434fd0..eab74ad45f 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include "null_crypto_pmd_private.h" diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index e01dacc98d..ed6d215f1b 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/crypto/scheduler/scheduler_pmd.c b/drivers/crypto/scheduler/scheduler_pmd.c index dd198080bf..a15c02b4d8 100644 --- a/drivers/crypto/scheduler/scheduler_pmd.c +++ b/drivers/crypto/scheduler/scheduler_pmd.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/dma/skeleton/skeleton_dmadev.c b/drivers/dma/skeleton/skeleton_dmadev.c index 82b4661323..09068a9521 100644 --- a/drivers/dma/skeleton/skeleton_dmadev.c +++ b/drivers/dma/skeleton/skeleton_dmadev.c @@ -4,7 +4,7 @@ #include -#include +#include #include #include #include diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 5de3e9e5f5..08df6e223a 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c index 941fb8fc43..427aff4b11 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev_selftest.c +++ b/drivers/event/dpaa2/dpaa2_eventdev_selftest.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index 9e14e35d10..fe157c59d5 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include "ssovf_evdev.h" #include "timvf_evdev.h" diff --git a/drivers/event/octeontx/ssovf_evdev_selftest.c b/drivers/event/octeontx/ssovf_evdev_selftest.c index b55523632a..3dbf31efa9 100644 --- a/drivers/event/octeontx/ssovf_evdev_selftest.c +++ b/drivers/event/octeontx/ssovf_evdev_selftest.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include "ssovf_evdev.h" diff --git a/drivers/event/opdl/opdl_evdev.c b/drivers/event/opdl/opdl_evdev.c index 8b6890b220..368e5a9657 100644 --- a/drivers/event/opdl/opdl_evdev.c +++ b/drivers/event/opdl/opdl_evdev.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/event/opdl/opdl_evdev_init.c b/drivers/event/opdl/opdl_evdev_init.c index 15aae47524..be3437fc2f 100644 --- a/drivers/event/opdl/opdl_evdev_init.c +++ b/drivers/event/opdl/opdl_evdev_init.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/event/opdl/opdl_test.c b/drivers/event/opdl/opdl_test.c index 24b92df476..50c12a18b0 100644 --- a/drivers/event/opdl/opdl_test.c +++ b/drivers/event/opdl/opdl_test.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include "opdl_evdev.h" diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c index bf3b01ebc8..6bd8fec6d4 100644 --- a/drivers/event/skeleton/skeleton_eventdev.c +++ b/drivers/event/skeleton/skeleton_eventdev.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include "skeleton_eventdev.h" diff --git a/drivers/event/sw/sw_evdev.c b/drivers/event/sw/sw_evdev.c index f93313b31b..22cba1e74b 100644 --- a/drivers/event/sw/sw_evdev.c +++ b/drivers/event/sw/sw_evdev.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c index cb97a4d615..59bcdf5734 100644 --- a/drivers/event/sw/sw_evdev_selftest.c +++ b/drivers/event/sw/sw_evdev_selftest.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "sw_evdev.h" diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c index 1396f32c3d..e2771e6765 100644 --- a/drivers/net/af_packet/rte_eth_af_packet.c +++ b/drivers/net/af_packet/rte_eth_af_packet.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index fce649c2a1..fd7be47311 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c index 4ac191c468..b44dd219cb 100644 --- a/drivers/net/bonding/rte_eth_bond_api.c +++ b/drivers/net/bonding/rte_eth_bond_api.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include "rte_eth_bond.h" diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c index 73e6972035..cd80a0af46 100644 --- a/drivers/net/bonding/rte_eth_bond_pmd.c +++ b/drivers/net/bonding/rte_eth_bond_pmd.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c index 7fe77cfe8e..32811403b4 100644 --- a/drivers/net/failsafe/failsafe.c +++ b/drivers/net/failsafe/failsafe.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include "failsafe_private.h" diff --git a/drivers/net/ipn3ke/ipn3ke_ethdev.h b/drivers/net/ipn3ke/ipn3ke_ethdev.h index dbf57f9ba8..4b93d2649e 100644 --- a/drivers/net/ipn3ke/ipn3ke_ethdev.h +++ b/drivers/net/ipn3ke/ipn3ke_ethdev.h @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c index 0532de5315..c0e1f8db40 100644 --- a/drivers/net/kni/rte_eth_kni.c +++ b/drivers/net/kni/rte_eth_kni.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include /* Only single queue supported */ #define KNI_MAX_QUEUE_PER_PORT 1 diff --git a/drivers/net/memif/memif_socket.c b/drivers/net/memif/memif_socket.c index 7886644412..4700ce2e77 100644 --- a/drivers/net/memif/memif_socket.c +++ b/drivers/net/memif/memif_socket.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c index dd951b8296..a574bce49e 100644 --- a/drivers/net/memif/rte_eth_memif.c +++ b/drivers/net/memif/rte_eth_memif.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c index eef016aa0b..6a0dd6091d 100644 --- a/drivers/net/mvneta/mvneta_ethdev.c +++ b/drivers/net/mvneta/mvneta_ethdev.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 735efb6cfc..310e3e5acf 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c index bb89c1abc4..a517376d40 100644 --- a/drivers/net/null/rte_eth_null.c +++ b/drivers/net/null/rte_eth_null.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 3aca53fb98..9ada22e2ff 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/pcap/pcap_ethdev.c b/drivers/net/pcap/pcap_ethdev.c index ec29fd6bc5..7fb4abb20b 100644 --- a/drivers/net/pcap/pcap_ethdev.c +++ b/drivers/net/pcap/pcap_ethdev.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include "pcap_osdep.h" diff --git a/drivers/net/pfe/pfe_ethdev.c b/drivers/net/pfe/pfe_ethdev.c index c2991ab1cc..0352a57950 100644 --- a/drivers/net/pfe/pfe_ethdev.c +++ b/drivers/net/pfe/pfe_ethdev.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index cfb81da5fe..37e7ccfda0 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c index 8c098cad5b..fa89940735 100644 --- a/drivers/net/softnic/rte_eth_softnic.c +++ b/drivers/net/softnic/rte_eth_softnic.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c index 9e1032fe72..d047489e94 100644 --- a/drivers/net/tap/rte_eth_tap.c +++ b/drivers/net/tap/rte_eth_tap.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index 9d65f75048..5c7430718b 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c index 7e512d94bf..6c81967c6f 100644 --- a/drivers/net/vhost/rte_eth_vhost.c +++ b/drivers/net/vhost/rte_eth_vhost.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c index a7d7063c2a..3edfd7439e 100644 --- a/drivers/net/virtio/virtio_user_ethdev.c +++ b/drivers/net/virtio/virtio_user_ethdev.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/raw/cnxk_gpio/cnxk_gpio.c b/drivers/raw/cnxk_gpio/cnxk_gpio.c index d759ed82d4..e2907c18b5 100644 --- a/drivers/raw/cnxk_gpio/cnxk_gpio.c +++ b/drivers/raw/cnxk_gpio/cnxk_gpio.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c index c7bddbc6cc..aeee4ac289 100644 --- a/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +++ b/drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/raw/ifpga/ifpga_rawdev.c b/drivers/raw/ifpga/ifpga_rawdev.c index f6e07dc37b..dea68d5764 100644 --- a/drivers/raw/ifpga/ifpga_rawdev.c +++ b/drivers/raw/ifpga/ifpga_rawdev.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c index 16ecae3d92..19b523a815 100644 --- a/drivers/raw/skeleton/skeleton_rawdev.c +++ b/drivers/raw/skeleton/skeleton_rawdev.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c index 693b24c415..fc257c5f44 100644 --- a/drivers/raw/skeleton/skeleton_rawdev_test.c +++ b/drivers/raw/skeleton/skeleton_rawdev_test.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include /* Using relative path as skeleton_rawdev is not part of exported headers */ diff --git a/lib/ethdev/ethdev_vdev.h b/lib/ethdev/ethdev_vdev.h index f5f536ce64..364f140f91 100644 --- a/lib/ethdev/ethdev_vdev.h +++ b/lib/ethdev/ethdev_vdev.h @@ -12,7 +12,7 @@ extern "C" { #include #include -#include +#include #include /** diff --git a/lib/eventdev/eventdev_pmd_vdev.h b/lib/eventdev/eventdev_pmd_vdev.h index 77904910a2..cf2333cf41 100644 --- a/lib/eventdev/eventdev_pmd_vdev.h +++ b/lib/eventdev/eventdev_pmd_vdev.h @@ -22,7 +22,7 @@ extern "C" { #include #include #include -#include +#include #include "eventdev_pmd.h" From patchwork Sat Jul 9 08:26:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113881 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org 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 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 From patchwork Sat Jul 9 08:26:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113882 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 012B2A00C5; Sat, 9 Jul 2022 10:29:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 89E0A42B8B; Sat, 9 Jul 2022 10:29:35 +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 587F14280C for ; Sat, 9 Jul 2022 10:29:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355372; 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=cNemJsj8SJl8QsMeKii2Rv6GtpYdhjyjEhpRulWRzME=; b=A/QJI45X40meNLvjGmSXCnwtABTy0toa0/XRNmJJFe3s8UmbKQn1T2cBima4DmDHOa55Aj SrKsFIxzDeUADD6hfaEEivwa40FhSikao7xcIksHrErwAY2T9u1kPoEUf+uxYhAHzOYqYA mmk6w6IogYMj/45WIVVUpM4b+K6dFRY= 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-292-gOlFzWayMdymoQ-EqYjg3w-1; Sat, 09 Jul 2022 04:29:31 -0400 X-MC-Unique: gOlFzWayMdymoQ-EqYjg3w-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 312863806720; Sat, 9 Jul 2022 08:29:31 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAEE52026D64; Sat, 9 Jul 2022 08:29:29 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Aman Singh , Yuying Zhang , Ray Kinsella , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Subject: [RFC v2 v2 26/29] dev: introduce driver name Date: Sat, 9 Jul 2022 10:26:41 +0200 Message-Id: <20220709082644.664675-27-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 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 Add a helper to get a rte_driver object name. This will be used externally. Internal users may still dereference a rte_driver object. Signed-off-by: David Marchand --- app/test-pmd/config.c | 2 +- lib/eal/common/eal_common_dev.c | 6 ++++++ lib/eal/include/rte_dev.h | 13 +++++++++++++ lib/eal/version.map | 1 + lib/ethdev/rte_ethdev.h | 2 +- 5 files changed, 22 insertions(+), 2 deletions(-) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index bc154e8bf7..22aa086ef1 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -654,7 +654,7 @@ device_infos_display(const char *identifier) printf("\n%s Infos for device %s %s\n", info_border, dev->name, info_border); printf("Bus name: %s", rte_bus_name(dev->bus)); - printf("\nDriver name: %s", dev->driver->name); + printf("\nDriver name: %s", rte_driver_name(dev->driver)); printf("\nDevargs: %s", dev->devargs ? dev->devargs->args : ""); printf("\nConnect to socket: %d", dev->numa_node); diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c index 62a598957c..16c5aef1d8 100644 --- a/lib/eal/common/eal_common_dev.c +++ b/lib/eal/common/eal_common_dev.c @@ -19,6 +19,12 @@ #include "eal_private.h" #include "hotplug_mp.h" +const char * +rte_driver_name(const struct rte_driver *driver) +{ + return driver->name; +} + /** * The device event callback description. * diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h index 24f9122558..871a046ffe 100644 --- a/lib/eal/include/rte_dev.h +++ b/lib/eal/include/rte_dev.h @@ -62,6 +62,19 @@ struct rte_driver { const char *alias; /**< Driver alias. */ }; +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * @param driver + * A pointer to a driver structure. + * @return + * A pointer to the driver name string. + */ +__rte_experimental +const char * +rte_driver_name(const struct rte_driver *driver); + /* * Internal identifier length * Sufficiently large to allow for UUID or PCI address diff --git a/lib/eal/version.map b/lib/eal/version.map index 48c8a2f511..54f85ab01f 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -425,6 +425,7 @@ EXPERIMENTAL { # added in 22.11 rte_bus_name; + rte_driver_name; }; INTERNAL { diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index de9e970d4d..e9574f646f 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -3380,7 +3380,7 @@ int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, * exists for the device and the rte_eth_dev 'dev' has been populated * successfully with a call to it: * - * driver_name = dev->device->driver->name + * driver_name = rte_driver_name(dev->device->driver) * nb_rx_queues = dev->data->nb_rx_queues * nb_tx_queues = dev->data->nb_tx_queues * dev_flags = &dev->data->dev_flags From patchwork Sat Jul 9 08:26:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113883 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4322AA00C5; Sat, 9 Jul 2022 10:29:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2FF884282E; Sat, 9 Jul 2022 10:29:56 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id BC52B42B72 for ; Sat, 9 Jul 2022 10:29:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355394; 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=aC3aIG71Cv3mOQ2cn3qF/J5dnl3y5SrwJkXV7wp/7vU=; b=M2HReR1ID/5k7Xlxadf2b8PyLFOGkRlrR7N+LPkAum9d6eBTebm9w9HQsdL03Pksv2qQbv uLR7ak/FcUM1B+p7seQt7JeCJIqEPh0/dQwNJx+Fpi76T0rv0pnGm66yVNHMry5p8eTp5I M8A7mFyDd9hc1Nk7QIGuPBPC7pNF3tw= 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-381-5DwFjSu1PruI6dWxGjCgjw-1; Sat, 09 Jul 2022 04:29:49 -0400 X-MC-Unique: 5DwFjSu1PruI6dWxGjCgjw-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 0A32B3806737; Sat, 9 Jul 2022 08:29:47 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F1BD2026D64; Sat, 9 Jul 2022 08:29:35 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Nicolas Chautru , Parav Pandit , Xueming Li , Hemant Agrawal , Sachin Saxena , Rosen Xu , Stephen Hemminger , Long Li , Fan Zhang , Sunila Sahu , Ashish Gupta , Ajit Khaparde , Raveendra Padasalagi , Vikas Gupta , Chandubabu Namburu , Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj , Gagandeep Singh , Bruce Richardson , Kevin Laatz , Timothy McDaniel , Jerin Jacob , Elena Agostini , Ciara Loftus , Qi Zhang , Shepard Siegel , Ed Czeck , John Miller , Steven Webster , Matt Peters , Rasesh Mody , Shahed Shaikh , Somnath Kotur , Rahul Lakkireddy , Simei Su , Wenjun Wu , Marcin Wojtas , Michal Krawczyk , Shai Brandes , Evgeny Schemeilin , Igor Chauskin , John Daley , Hyong Youb Kim , Gaetan Rivet , Xiao Wang , Yuying Zhang , Beilei Xing , Jingjing Wu , Qiming Yang , Matan Azrad , Viacheslav Ovsiienko , Chaoyong He , Niklas Soderlund , Harman Kalra , Devendra Singh Rawat , Andrew Rybchenko , Maciej Czekaj , Maxime Coquelin , Chenbo Xia , Jochen Behrens , Jakub Palider , Tomasz Duszynski , Ori Kam , Akhil Goyal , Chengwen Feng , Thomas Monjalon , Ferruh Yigit , Abhinandan Gujjar , Jay Jayatheerthan , Olivier Matz , Reshma Pattan Subject: [RFC v2 v2 27/29] dev: hide driver object Date: Sat, 9 Jul 2022 10:26:42 +0200 Message-Id: <20220709082644.664675-28-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 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 Make rte_driver opaque for non internal users. This will make extending this object possible without breaking the ABI. Introduce a new driver header and move rte_driver definition. Update drivers and library to use the internal header. Signed-off-by: David Marchand --- drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/auxiliary/auxiliary_params.c | 2 +- drivers/bus/auxiliary/bus_auxiliary_driver.h | 2 +- drivers/bus/dpaa/bus_dpaa_driver.h | 2 ++ drivers/bus/fslmc/bus_fslmc_driver.h | 2 +- drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 2 +- drivers/bus/ifpga/bus_ifpga_driver.h | 1 + drivers/bus/pci/bus_pci_driver.h | 2 +- drivers/bus/pci/pci_params.c | 2 +- drivers/bus/vdev/bus_vdev_driver.h | 2 +- drivers/bus/vdev/vdev.c | 2 +- drivers/bus/vdev/vdev_params.c | 2 +- drivers/bus/vmbus/bus_vmbus_driver.h | 2 +- drivers/common/qat/dev/qat_dev_gen4.c | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/compress/zlib/zlib_pmd_ops.c | 2 +- drivers/crypto/bcmfs/bcmfs_qp.c | 2 +- drivers/crypto/bcmfs/bcmfs_sym_pmd.c | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/scheduler/scheduler_pmd_ops.c | 2 +- drivers/dma/idxd/idxd_bus.c | 1 + drivers/event/dlb2/dlb2.c | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +- drivers/event/octeontx/ssovf_evdev.c | 2 +- drivers/event/skeleton/skeleton_eventdev.c | 2 +- drivers/gpu/cuda/cuda.c | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/ark/ark_global.h | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/axgbe/axgbe_common.h | 2 +- drivers/net/bnx2x/bnx2x_ethdev.c | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 2 +- drivers/net/cxgbe/base/t4_hw.c | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/cxgbe/cxgbe_main.c | 2 +- drivers/net/cxgbe/sge.c | 2 +- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_recycle.c | 2 +- drivers/net/dpaa2/dpaa2_rxtx.c | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_flow.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/failsafe/failsafe_private.h | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/iavf/iavf_ethdev.c | 2 +- drivers/net/iavf/iavf_vchnl.c | 2 +- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_flow.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- 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/nfp/nfp_common.c | 2 +- drivers/net/nfp/nfp_ethdev.c | 2 +- drivers/net/octeontx/octeontx_ethdev.c | 2 +- drivers/net/qede/qede_ethdev.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sw_stats.c | 2 +- drivers/net/sfc/sfc_sw_stats.h | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/skeleton/skeleton_rawdev.c | 2 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 2 +- drivers/regex/mlx5/mlx5_regex_control.c | 2 +- lib/compressdev/rte_compressdev.c | 2 +- lib/compressdev/rte_compressdev_pmd.c | 2 +- lib/compressdev/rte_compressdev_pmd.h | 1 + lib/cryptodev/cryptodev_pmd.c | 2 +- lib/cryptodev/cryptodev_pmd.h | 1 + lib/cryptodev/rte_cryptodev.c | 2 +- lib/dmadev/rte_dmadev_pmd.h | 2 +- lib/eal/common/eal_common_dev.c | 2 +- lib/eal/include/dev_driver.h | 28 +++++++++++++++++++ lib/eal/include/meson.build | 1 + lib/eal/include/rte_dev.h | 11 ++------ lib/ethdev/ethdev_driver.h | 1 + lib/eventdev/eventdev_pmd.h | 2 +- lib/eventdev/rte_event_crypto_adapter.c | 2 +- lib/eventdev/rte_event_eth_rx_adapter.c | 2 +- lib/eventdev/rte_eventdev.c | 2 +- lib/gpudev/gpudev_driver.h | 2 +- lib/mempool/rte_mempool_ops.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- lib/rawdev/rte_rawdev.c | 2 +- lib/rawdev/rte_rawdev_pmd.h | 2 +- lib/security/rte_security.c | 2 +- 114 files changed, 143 insertions(+), 114 deletions(-) create mode 100644 lib/eal/include/dev_driver.h diff --git a/drivers/baseband/acc100/rte_acc100_pmd.c b/drivers/baseband/acc100/rte_acc100_pmd.c index 801e8920df..e2d9409185 100644 --- a/drivers/baseband/acc100/rte_acc100_pmd.c +++ b/drivers/baseband/acc100/rte_acc100_pmd.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c index c1d877c87f..51dd090c1b 100644 --- a/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +++ b/drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c index f16814e241..036579e3ec 100644 --- a/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +++ b/drivers/baseband/fpga_lte_fec/fpga_lte_fec.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/bus/auxiliary/auxiliary_params.c b/drivers/bus/auxiliary/auxiliary_params.c index a889e392c6..e4c7ee0c3b 100644 --- a/drivers/bus/auxiliary/auxiliary_params.c +++ b/drivers/bus/auxiliary/auxiliary_params.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include diff --git a/drivers/bus/auxiliary/bus_auxiliary_driver.h b/drivers/bus/auxiliary/bus_auxiliary_driver.h index 44bacc3c0e..13c18418bd 100644 --- a/drivers/bus/auxiliary/bus_auxiliary_driver.h +++ b/drivers/bus/auxiliary/bus_auxiliary_driver.h @@ -22,10 +22,10 @@ extern "C" { #include #include +#include #include #include #include -#include #include #define RTE_BUS_AUXILIARY_NAME "auxiliary" diff --git a/drivers/bus/dpaa/bus_dpaa_driver.h b/drivers/bus/dpaa/bus_dpaa_driver.h index 4360295335..937a742525 100644 --- a/drivers/bus/dpaa/bus_dpaa_driver.h +++ b/drivers/bus/dpaa/bus_dpaa_driver.h @@ -6,9 +6,11 @@ #ifndef BUS_DPAA_DRIVER_H #define BUS_DPAA_DRIVER_H +#include #include #include #include + #include #include diff --git a/drivers/bus/fslmc/bus_fslmc_driver.h b/drivers/bus/fslmc/bus_fslmc_driver.h index 798ddebf3a..ac3d98dcc0 100644 --- a/drivers/bus/fslmc/bus_fslmc_driver.h +++ b/drivers/bus/fslmc/bus_fslmc_driver.h @@ -26,10 +26,10 @@ extern "C" { #include #include +#include #include #include #include -#include #include #include #include diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 8604e43947..5966776a85 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include "private.h" diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c index cfe4280f87..d7f6e45b7d 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c index b7d81b518c..07256ed7ec 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpci.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c index 071b0d297d..4aec7b2cd8 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c b/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c index 223e34bcba..65e2d799c3 100644 --- a/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c +++ b/drivers/bus/fslmc/portal/dpaa2_hw_dprc.c @@ -10,7 +10,7 @@ #include #include -#include +#include #include "private.h" #include diff --git a/drivers/bus/ifpga/bus_ifpga_driver.h b/drivers/bus/ifpga/bus_ifpga_driver.h index 7b75c2ddbc..10bf2f92ce 100644 --- a/drivers/bus/ifpga/bus_ifpga_driver.h +++ b/drivers/bus/ifpga/bus_ifpga_driver.h @@ -15,6 +15,7 @@ extern "C" { #endif /* __cplusplus */ +#include #include #include #include diff --git a/drivers/bus/pci/bus_pci_driver.h b/drivers/bus/pci/bus_pci_driver.h index b5c7dee617..9c56307405 100644 --- a/drivers/bus/pci/bus_pci_driver.h +++ b/drivers/bus/pci/bus_pci_driver.h @@ -10,8 +10,8 @@ extern "C" { #endif +#include #include -#include #include /** Pathname of PCI devices directory. */ diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c index 39d702a418..d24cc201b8 100644 --- a/drivers/bus/pci/pci_params.c +++ b/drivers/bus/pci/pci_params.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/bus/vdev/bus_vdev_driver.h b/drivers/bus/vdev/bus_vdev_driver.h index 36748cdfae..d05a7f7115 100644 --- a/drivers/bus/vdev/bus_vdev_driver.h +++ b/drivers/bus/vdev/bus_vdev_driver.h @@ -9,9 +9,9 @@ extern "C" { #endif +#include #include #include -#include #include struct rte_vdev_device { diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c index 1b8410fe5b..7c8170e5a6 100644 --- a/drivers/bus/vdev/vdev.c +++ b/drivers/bus/vdev/vdev.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/bus/vdev/vdev_params.c b/drivers/bus/vdev/vdev_params.c index 2c72614776..2d10a1e8ad 100644 --- a/drivers/bus/vdev/vdev_params.c +++ b/drivers/bus/vdev/vdev_params.c @@ -4,7 +4,7 @@ #include -#include +#include #include #include diff --git a/drivers/bus/vmbus/bus_vmbus_driver.h b/drivers/bus/vmbus/bus_vmbus_driver.h index 3424e791c9..e60290c835 100644 --- a/drivers/bus/vmbus/bus_vmbus_driver.h +++ b/drivers/bus/vmbus/bus_vmbus_driver.h @@ -10,9 +10,9 @@ extern "C" { #endif +#include #include #include -#include struct vmbus_channel; struct vmbus_mon_page; diff --git a/drivers/common/qat/dev/qat_dev_gen4.c b/drivers/common/qat/dev/qat_dev_gen4.c index 7ffde5f4c8..85d6ddfcf4 100644 --- a/drivers/common/qat/dev/qat_dev_gen4.c +++ b/drivers/common/qat/dev/qat_dev_gen4.c @@ -2,7 +2,7 @@ * Copyright(c) 2021 Intel Corporation */ -#include +#include #include #include "qat_device.h" diff --git a/drivers/common/qat/qat_qp.c b/drivers/common/qat/qat_qp.c index 4a1be35b47..e58e4ceec0 100644 --- a/drivers/common/qat/qat_qp.c +++ b/drivers/common/qat/qat_qp.c @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/compress/zlib/zlib_pmd_ops.c b/drivers/compress/zlib/zlib_pmd_ops.c index 7d657d81bc..445a3baa67 100644 --- a/drivers/compress/zlib/zlib_pmd_ops.c +++ b/drivers/compress/zlib/zlib_pmd_ops.c @@ -4,7 +4,7 @@ #include -#include +#include #include #include diff --git a/drivers/crypto/bcmfs/bcmfs_qp.c b/drivers/crypto/bcmfs/bcmfs_qp.c index 61d457f4e0..d1ede5e990 100644 --- a/drivers/crypto/bcmfs/bcmfs_qp.c +++ b/drivers/crypto/bcmfs/bcmfs_qp.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/bcmfs/bcmfs_sym_pmd.c b/drivers/crypto/bcmfs/bcmfs_sym_pmd.c index bc7fb67218..78272d616c 100644 --- a/drivers/crypto/bcmfs/bcmfs_sym_pmd.c +++ b/drivers/crypto/bcmfs/bcmfs_sym_pmd.c @@ -4,7 +4,7 @@ */ #include -#include +#include #include #include #include diff --git a/drivers/crypto/ccp/rte_ccp_pmd.c b/drivers/crypto/ccp/rte_ccp_pmd.c index 6c3e45e333..013f3be1e6 100644 --- a/drivers/crypto/ccp/rte_ccp_pmd.c +++ b/drivers/crypto/ccp/rte_ccp_pmd.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include "ccp_crypto.h" diff --git a/drivers/crypto/cnxk/cn10k_cryptodev.c b/drivers/crypto/cnxk/cn10k_cryptodev.c index 3fd9f3c426..db11ac7444 100644 --- a/drivers/crypto/cnxk/cn10k_cryptodev.c +++ b/drivers/crypto/cnxk/cn10k_cryptodev.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include "cn10k_cryptodev.h" diff --git a/drivers/crypto/cnxk/cn9k_cryptodev.c b/drivers/crypto/cnxk/cn9k_cryptodev.c index bd425f95ff..4cfc1f2150 100644 --- a/drivers/crypto/cnxk/cn9k_cryptodev.c +++ b/drivers/crypto/cnxk/cn9k_cryptodev.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include "cn9k_cryptodev.h" diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 0cce861899..3b13578de0 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 7e554cb2b1..c6bd785262 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -19,7 +19,7 @@ #include #endif #include -#include +#include #include #include #include diff --git a/drivers/crypto/scheduler/scheduler_pmd_ops.c b/drivers/crypto/scheduler/scheduler_pmd_ops.c index f3a1bd626c..971f82897c 100644 --- a/drivers/crypto/scheduler/scheduler_pmd_ops.c +++ b/drivers/crypto/scheduler/scheduler_pmd_ops.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/dma/idxd/idxd_bus.c b/drivers/dma/idxd/idxd_bus.c index e30dcfc281..9b7b16c6e3 100644 --- a/drivers/dma/idxd/idxd_bus.c +++ b/drivers/dma/idxd/idxd_bus.c @@ -9,6 +9,7 @@ #include #include +#include #include #include #include diff --git a/drivers/event/dlb2/dlb2.c b/drivers/event/dlb2/dlb2.c index 26af75beb8..d7ac58bfde 100644 --- a/drivers/event/dlb2/dlb2.c +++ b/drivers/event/dlb2/dlb2.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/event/dlb2/pf/dlb2_pf.c b/drivers/event/dlb2/pf/dlb2_pf.c index 9f8c6cd8b8..71ac141b66 100644 --- a/drivers/event/dlb2/pf/dlb2_pf.c +++ b/drivers/event/dlb2/pf/dlb2_pf.c @@ -15,7 +15,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/event/dpaa/dpaa_eventdev.c b/drivers/event/dpaa/dpaa_eventdev.c index aa403f9e06..8e470584ea 100644 --- a/drivers/event/dpaa/dpaa_eventdev.c +++ b/drivers/event/dpaa/dpaa_eventdev.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/event/dpaa2/dpaa2_eventdev.c b/drivers/event/dpaa2/dpaa2_eventdev.c index 08df6e223a..1001297cda 100644 --- a/drivers/event/dpaa2/dpaa2_eventdev.c +++ b/drivers/event/dpaa2/dpaa2_eventdev.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/event/dpaa2/dpaa2_hw_dpcon.c b/drivers/event/dpaa2/dpaa2_hw_dpcon.c index 3882a9cf1d..a68d3ac154 100644 --- a/drivers/event/dpaa2/dpaa2_hw_dpcon.c +++ b/drivers/event/dpaa2/dpaa2_hw_dpcon.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/event/octeontx/ssovf_evdev.c b/drivers/event/octeontx/ssovf_evdev.c index fe157c59d5..99fa326ad5 100644 --- a/drivers/event/octeontx/ssovf_evdev.c +++ b/drivers/event/octeontx/ssovf_evdev.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/event/skeleton/skeleton_eventdev.c b/drivers/event/skeleton/skeleton_eventdev.c index 6bd8fec6d4..8513b9a013 100644 --- a/drivers/event/skeleton/skeleton_eventdev.c +++ b/drivers/event/skeleton/skeleton_eventdev.c @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/gpu/cuda/cuda.c b/drivers/gpu/cuda/cuda.c index 2be7b8d2df..a552aabeb8 100644 --- a/drivers/gpu/cuda/cuda.c +++ b/drivers/gpu/cuda/cuda.c @@ -8,7 +8,7 @@ #include #include #include -#include +#include #include diff --git a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c index 56c629c681..84371d5d1a 100644 --- a/drivers/mempool/dpaa2/dpaa2_hw_mempool.c +++ b/drivers/mempool/dpaa2/dpaa2_hw_mempool.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "rte_dpaa2_mempool.h" #include "fslmc_vfio.h" diff --git a/drivers/net/af_xdp/rte_eth_af_xdp.c b/drivers/net/af_xdp/rte_eth_af_xdp.c index fd7be47311..9957de2314 100644 --- a/drivers/net/af_xdp/rte_eth_af_xdp.c +++ b/drivers/net/af_xdp/rte_eth_af_xdp.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/ark/ark_global.h b/drivers/net/ark/ark_global.h index 748db590c1..71d0b53e03 100644 --- a/drivers/net/ark/ark_global.h +++ b/drivers/net/ark/ark_global.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include "ark_pktdir.h" diff --git a/drivers/net/avp/avp_ethdev.c b/drivers/net/avp/avp_ethdev.c index 7c0cb666fb..b2a08f5635 100644 --- a/drivers/net/avp/avp_ethdev.c +++ b/drivers/net/avp/avp_ethdev.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h index b9ebf64fb8..a5d11c5832 100644 --- a/drivers/net/axgbe/axgbe_common.h +++ b/drivers/net/axgbe/axgbe_common.h @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c index f36ad30e17..4448cf2de2 100644 --- a/drivers/net/bnx2x/bnx2x_ethdev.c +++ b/drivers/net/bnx2x/bnx2x_ethdev.c @@ -9,7 +9,7 @@ #include "bnx2x_rxtx.h" #include -#include +#include #include #include diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c index e275d3a53f..1460dce2ab 100644 --- a/drivers/net/bnxt/bnxt_ethdev.c +++ b/drivers/net/bnxt/bnxt_ethdev.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/bnxt/rte_pmd_bnxt.c b/drivers/net/bnxt/rte_pmd_bnxt.c index 77ecbef04c..fd1506ddd4 100644 --- a/drivers/net/bnxt/rte_pmd_bnxt.c +++ b/drivers/net/bnxt/rte_pmd_bnxt.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/cxgbe/base/t4_hw.c b/drivers/net/cxgbe/base/t4_hw.c index 384080e6d3..bed755f5d9 100644 --- a/drivers/net/cxgbe/base/t4_hw.c +++ b/drivers/net/cxgbe/base/t4_hw.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include "common.h" diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c index fd71a50a58..45bbeaef0c 100644 --- a/drivers/net/cxgbe/cxgbe_ethdev.c +++ b/drivers/net/cxgbe/cxgbe_ethdev.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "cxgbe.h" #include "cxgbe_pfvf.h" diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c index 3c02c98b3d..f8dd833032 100644 --- a/drivers/net/cxgbe/cxgbe_main.c +++ b/drivers/net/cxgbe/cxgbe_main.c @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include "base/common.h" diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c index 5d91355c9a..5b13cb5c94 100644 --- a/drivers/net/cxgbe/sge.c +++ b/drivers/net/cxgbe/sge.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "base/common.h" #include "base/t4_regs.h" diff --git a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c index 9509f6e8a3..4d33b51fea 100644 --- a/drivers/net/dpaa2/base/dpaa2_hw_dpni.c +++ b/drivers/net/dpaa2/base/dpaa2_hw_dpni.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index f876f4790c..37a8b43114 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include "rte_dpaa2_mempool.h" diff --git a/drivers/net/dpaa2/dpaa2_recycle.c b/drivers/net/dpaa2/dpaa2_recycle.c index 932570c6e0..fbfdf360d1 100644 --- a/drivers/net/dpaa2/dpaa2_recycle.c +++ b/drivers/net/dpaa2/dpaa2_recycle.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/dpaa2/dpaa2_rxtx.c b/drivers/net/dpaa2/dpaa2_rxtx.c index 7b9c528d13..9436a95ac8 100644 --- a/drivers/net/dpaa2/dpaa2_rxtx.c +++ b/drivers/net/dpaa2/dpaa2_rxtx.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/dpaa2/dpaa2_sparser.c b/drivers/net/dpaa2/dpaa2_sparser.c index ba0d500f74..63463c4fbf 100644 --- a/drivers/net/dpaa2/dpaa2_sparser.c +++ b/drivers/net/dpaa2/dpaa2_sparser.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/e1000/em_ethdev.c b/drivers/net/e1000/em_ethdev.c index 409de50083..8ee9be12ad 100644 --- a/drivers/net/e1000/em_ethdev.c +++ b/drivers/net/e1000/em_ethdev.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "e1000_logs.h" #include "base/e1000_api.h" diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 43979992d3..d6bcc5bf58 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "e1000_logs.h" #include "base/e1000_api.h" diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c index e46697b6a1..b775310651 100644 --- a/drivers/net/e1000/igb_flow.c +++ b/drivers/net/e1000/igb_flow.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/ena/ena_ethdev.h b/drivers/net/ena/ena_ethdev.h index 4709675af8..4d27fba585 100644 --- a/drivers/net/ena/ena_ethdev.h +++ b/drivers/net/ena/ena_ethdev.h @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include "ena_com.h" diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 998436e5e8..cdf0915591 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/enic/enic_vf_representor.c b/drivers/net/enic/enic_vf_representor.c index 7312c411bd..46f85964e9 100644 --- a/drivers/net/enic/enic_vf_representor.c +++ b/drivers/net/enic/enic_vf_representor.c @@ -7,7 +7,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index a80f5e2caf..53a451c1b1 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 8bbd8b445d..7adb20bff9 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -7,7 +7,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index 87c22b6b54..1775be63c6 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c index 506fcff6e3..ef2ab06475 100644 --- a/drivers/net/iavf/iavf_ethdev.c +++ b/drivers/net/iavf/iavf_ethdev.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "iavf.h" #include "iavf_rxtx.h" diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c index 21bd1e2193..15f695682d 100644 --- a/drivers/net/iavf/iavf_vchnl.c +++ b/drivers/net/iavf/iavf_vchnl.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include "iavf.h" #include "iavf_rxtx.h" diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c index 885d58c0f4..1c3d22ae0f 100644 --- a/drivers/net/ice/ice_dcf.c +++ b/drivers/net/ice/ice_dcf.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include "ice_dcf.h" #include "ice_rxtx.h" diff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c index 0da267db1f..dee712af98 100644 --- a/drivers/net/ice/ice_dcf_ethdev.c +++ b/drivers/net/ice/ice_dcf_ethdev.c @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 552e41692c..04c9ce78a2 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #ifdef RTE_LIB_SECURITY #include diff --git a/drivers/net/ixgbe/ixgbe_flow.c b/drivers/net/ixgbe/ixgbe_flow.c index 368342872a..67373a7b78 100644 --- a/drivers/net/ixgbe/ixgbe_flow.c +++ b/drivers/net/ixgbe/ixgbe_flow.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 910b76a92c..7e7e1824ef 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -31,7 +31,7 @@ #endif #include -#include +#include #include #include #include diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c index ccc06bdda6..d0bbc0a4c0 100644 --- a/drivers/net/netvsc/hn_ethdev.c +++ b/drivers/net/netvsc/hn_ethdev.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/netvsc/hn_nvs.c b/drivers/net/netvsc/hn_nvs.c index 817fb06dfb..7db82af9f3 100644 --- a/drivers/net/netvsc/hn_nvs.c +++ b/drivers/net/netvsc/hn_nvs.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include "hn_logs.h" diff --git a/drivers/net/netvsc/hn_rndis.c b/drivers/net/netvsc/hn_rndis.c index 20f75a17b0..e6f1f28768 100644 --- a/drivers/net/netvsc/hn_rndis.c +++ b/drivers/net/netvsc/hn_rndis.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include "hn_logs.h" diff --git a/drivers/net/netvsc/hn_rxtx.c b/drivers/net/netvsc/hn_rxtx.c index 61cf374224..bc6f60c64a 100644 --- a/drivers/net/netvsc/hn_rxtx.c +++ b/drivers/net/netvsc/hn_rxtx.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/nfp/nfp_common.c b/drivers/net/nfp/nfp_common.c index 0e55f0c792..eaafe11fb9 100644 --- a/drivers/net/nfp/nfp_common.c +++ b/drivers/net/nfp/nfp_common.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/nfp/nfp_ethdev.c b/drivers/net/nfp/nfp_ethdev.c index 5cdd34e588..47359501bc 100644 --- a/drivers/net/nfp/nfp_ethdev.c +++ b/drivers/net/nfp/nfp_ethdev.c @@ -16,7 +16,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 9ada22e2ff..0eee191566 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h index a38b701183..b781bcdcfd 100644 --- a/drivers/net/qede/qede_ethdev.h +++ b/drivers/net/qede/qede_ethdev.h @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include /* ecore includes */ diff --git a/drivers/net/sfc/sfc_ethdev.c b/drivers/net/sfc/sfc_ethdev.c index 506c62a726..2ec743ebce 100644 --- a/drivers/net/sfc/sfc_ethdev.c +++ b/drivers/net/sfc/sfc_ethdev.c @@ -7,7 +7,7 @@ * for Solarflare) and Solarflare Communications, Inc. */ -#include +#include #include #include #include diff --git a/drivers/net/sfc/sfc_sw_stats.c b/drivers/net/sfc/sfc_sw_stats.c index 81f5aa3cc4..3ae5023b6f 100644 --- a/drivers/net/sfc/sfc_sw_stats.c +++ b/drivers/net/sfc/sfc_sw_stats.c @@ -2,7 +2,7 @@ * * Copyright(c) 2021 Xilinx, Inc. */ -#include +#include #include #include "sfc.h" diff --git a/drivers/net/sfc/sfc_sw_stats.h b/drivers/net/sfc/sfc_sw_stats.h index 1abded8018..d9738e5214 100644 --- a/drivers/net/sfc/sfc_sw_stats.h +++ b/drivers/net/sfc/sfc_sw_stats.h @@ -5,7 +5,7 @@ #ifndef _SFC_SW_STATS_H #define _SFC_SW_STATS_H -#include +#include #include "sfc.h" diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c index 28183ec740..9f57cb1a20 100644 --- a/drivers/net/thunderx/nicvf_ethdev.c +++ b/drivers/net/thunderx/nicvf_ethdev.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index 5c7430718b..32b7296877 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index d180162abd..edf3becd32 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/drivers/net/virtio/virtio_pci_ethdev.c b/drivers/net/virtio/virtio_pci_ethdev.c index 2b9e35cef5..abc63b0935 100644 --- a/drivers/net/virtio/virtio_pci_ethdev.c +++ b/drivers/net/virtio/virtio_pci_ethdev.c @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include "virtio.h" diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c index 101b1cb500..fd946dec5c 100644 --- a/drivers/net/vmxnet3/vmxnet3_ethdev.c +++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "base/vmxnet3_defs.h" diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c b/drivers/raw/cnxk_bphy/cnxk_bphy.c index db029cbf34..909fb8faab 100644 --- a/drivers/raw/cnxk_bphy/cnxk_bphy.c +++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c @@ -3,7 +3,7 @@ */ #include #include -#include +#include #include #include #include diff --git a/drivers/raw/skeleton/skeleton_rawdev.c b/drivers/raw/skeleton/skeleton_rawdev.c index 19b523a815..a06b724866 100644 --- a/drivers/raw/skeleton/skeleton_rawdev.c +++ b/drivers/raw/skeleton/skeleton_rawdev.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/raw/skeleton/skeleton_rawdev_test.c b/drivers/raw/skeleton/skeleton_rawdev_test.c index fc257c5f44..8ef7a6b127 100644 --- a/drivers/raw/skeleton/skeleton_rawdev_test.c +++ b/drivers/raw/skeleton/skeleton_rawdev_test.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/regex/mlx5/mlx5_regex_control.c b/drivers/regex/mlx5/mlx5_regex_control.c index 6ab62a12fc..92cf5f495e 100644 --- a/drivers/regex/mlx5/mlx5_regex_control.c +++ b/drivers/regex/mlx5/mlx5_regex_control.c @@ -11,7 +11,7 @@ #include #include #include -#include +#include #include #include diff --git a/lib/compressdev/rte_compressdev.c b/lib/compressdev/rte_compressdev.c index 7f6dedbc52..639a0d66ca 100644 --- a/lib/compressdev/rte_compressdev.c +++ b/lib/compressdev/rte_compressdev.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/lib/compressdev/rte_compressdev_pmd.c b/lib/compressdev/rte_compressdev_pmd.c index 9bfae077db..41f1415bea 100644 --- a/lib/compressdev/rte_compressdev_pmd.c +++ b/lib/compressdev/rte_compressdev_pmd.c @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include "rte_compressdev_internal.h" diff --git a/lib/compressdev/rte_compressdev_pmd.h b/lib/compressdev/rte_compressdev_pmd.h index 9fabc399c5..72e52f876f 100644 --- a/lib/compressdev/rte_compressdev_pmd.h +++ b/lib/compressdev/rte_compressdev_pmd.h @@ -19,6 +19,7 @@ extern "C" { #include +#include #include "rte_compressdev.h" #include "rte_compressdev_internal.h" diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c index 75d0075b86..f07b92dfd7 100644 --- a/lib/cryptodev/cryptodev_pmd.c +++ b/lib/cryptodev/cryptodev_pmd.c @@ -4,7 +4,7 @@ #include -#include +#include #include #include #include diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h index 3dcc3cb7ed..96d7e225b0 100644 --- a/lib/cryptodev/cryptodev_pmd.h +++ b/lib/cryptodev/cryptodev_pmd.h @@ -19,6 +19,7 @@ extern "C" { #include +#include #include #include #include diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c index 42f3221052..1dad092317 100644 --- a/lib/cryptodev/rte_cryptodev.c +++ b/lib/cryptodev/rte_cryptodev.c @@ -13,7 +13,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/dmadev/rte_dmadev_pmd.h b/lib/dmadev/rte_dmadev_pmd.h index 82ab7a8cc7..acd7f71cd1 100644 --- a/lib/dmadev/rte_dmadev_pmd.h +++ b/lib/dmadev/rte_dmadev_pmd.h @@ -14,7 +14,7 @@ * by any application. */ -#include +#include #include "rte_dmadev.h" diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c index 16c5aef1d8..5b64b80cb9 100644 --- a/lib/eal/common/eal_common_dev.c +++ b/lib/eal/common/eal_common_dev.c @@ -8,8 +8,8 @@ #include #include +#include #include -#include #include #include #include diff --git a/lib/eal/include/dev_driver.h b/lib/eal/include/dev_driver.h new file mode 100644 index 0000000000..015188abd5 --- /dev/null +++ b/lib/eal/include/dev_driver.h @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2022 Red Hat, Inc. + */ + +#ifndef DEV_DRIVER_H +#define DEV_DRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +/** + * A structure describing a device driver. + */ +struct rte_driver { + RTE_TAILQ_ENTRY(rte_driver) next; /**< Next in list. */ + const char *name; /**< Driver name. */ + const char *alias; /**< Driver alias. */ +}; + +#ifdef __cplusplus +} +#endif + +#endif /* DEV_DRIVER_H */ diff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build index 77d8621a51..cfcd40aaed 100644 --- a/lib/eal/include/meson.build +++ b/lib/eal/include/meson.build @@ -57,6 +57,7 @@ headers += files( driver_sdk_headers = files( 'bus_driver.h', + 'dev_driver.h', ) # special case install the generic headers, since they go in a subdir diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h index 871a046ffe..875ecee371 100644 --- a/lib/eal/include/rte_dev.h +++ b/lib/eal/include/rte_dev.h @@ -23,6 +23,8 @@ extern "C" { #include #include +struct rte_driver; + /** * The device event type. */ @@ -53,15 +55,6 @@ struct rte_mem_resource { void *addr; /**< Virtual address, NULL when not mapped. */ }; -/** - * A structure describing a device driver. - */ -struct rte_driver { - RTE_TAILQ_ENTRY(rte_driver) next; /**< Next in list. */ - const char *name; /**< Driver name. */ - const char *alias; /**< Driver alias. */ -}; - /** * @warning * @b EXPERIMENTAL: this API may change without prior notice diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h index 5101868ea7..47a55a419e 100644 --- a/lib/ethdev/ethdev_driver.h +++ b/lib/ethdev/ethdev_driver.h @@ -19,6 +19,7 @@ extern "C" { * */ +#include #include /** diff --git a/lib/eventdev/eventdev_pmd.h b/lib/eventdev/eventdev_pmd.h index 69402668d8..def6cd0876 100644 --- a/lib/eventdev/eventdev_pmd.h +++ b/lib/eventdev/eventdev_pmd.h @@ -22,7 +22,7 @@ extern "C" { #include #include #include -#include +#include #include #include #include diff --git a/lib/eventdev/rte_event_crypto_adapter.c b/lib/eventdev/rte_event_crypto_adapter.c index 7c695176f4..5bc10312fc 100644 --- a/lib/eventdev/rte_event_crypto_adapter.c +++ b/lib/eventdev/rte_event_crypto_adapter.c @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c b/lib/eventdev/rte_event_eth_rx_adapter.c index bf8741d2ea..4f4efdae9f 100644 --- a/lib/eventdev/rte_event_eth_rx_adapter.c +++ b/lib/eventdev/rte_event_eth_rx_adapter.c @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c index 1dc4f966be..54abee2b3f 100644 --- a/lib/eventdev/rte_eventdev.c +++ b/lib/eventdev/rte_eventdev.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/gpudev/gpudev_driver.h b/lib/gpudev/gpudev_driver.h index 0e55b00bfe..23972b3dbd 100644 --- a/lib/gpudev/gpudev_driver.h +++ b/lib/gpudev/gpudev_driver.h @@ -14,7 +14,7 @@ #include #include -#include +#include #include "rte_gpudev.h" diff --git a/lib/mempool/rte_mempool_ops.c b/lib/mempool/rte_mempool_ops.c index d60235a7e3..058ad147a5 100644 --- a/lib/mempool/rte_mempool_ops.c +++ b/lib/mempool/rte_mempool_ops.c @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include "rte_mempool_trace.h" diff --git a/lib/pcapng/rte_pcapng.c b/lib/pcapng/rte_pcapng.c index 72aabd4dd0..af2b814251 100644 --- a/lib/pcapng/rte_pcapng.c +++ b/lib/pcapng/rte_pcapng.c @@ -14,7 +14,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/lib/rawdev/rte_rawdev.c b/lib/rawdev/rte_rawdev.c index 2f0a4f132e..bc51258143 100644 --- a/lib/rawdev/rte_rawdev.c +++ b/lib/rawdev/rte_rawdev.c @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include #include diff --git a/lib/rawdev/rte_rawdev_pmd.h b/lib/rawdev/rte_rawdev_pmd.h index 3b7be57d3e..a51944c8ff 100644 --- a/lib/rawdev/rte_rawdev_pmd.h +++ b/lib/rawdev/rte_rawdev_pmd.h @@ -19,7 +19,7 @@ extern "C" { #include -#include +#include #include #include #include diff --git a/lib/security/rte_security.c b/lib/security/rte_security.c index 046b6496d2..d036ed33f6 100644 --- a/lib/security/rte_security.c +++ b/lib/security/rte_security.c @@ -6,7 +6,7 @@ #include #include -#include +#include #include #include "rte_security.h" #include "rte_security_driver.h" From patchwork Sat Jul 9 08:26:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113884 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AFA44A0542; Sat, 9 Jul 2022 10:30:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BCF4042B71; Sat, 9 Jul 2022 10:29:59 +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 A226442B96 for ; Sat, 9 Jul 2022 10:29:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355397; 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=gzqSbQriWwYI7/csEd/Pp8wlRQ2adEVA5uGLprkjekk=; b=CTIqGYcxcjdj6eOsvJHeDqHymEBS0m+wrGdyZU7nV8VHwixVYu9QKNOffYBIgb2g6oFm9c BJJ1YtsIRZBm84iK39sxa4btB5KWZjxOqttuOPVwUKWD6P5f42aKiLiRzv1M3PJW78QHgy 0Kvrc23n4bOs0QfO6dhUQGfqvGLzecQ= 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-650-4Q0glFlROoOjF5qlxos4-Q-1; Sat, 09 Jul 2022 04:29:53 -0400 X-MC-Unique: 4Q0glFlROoOjF5qlxos4-Q-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 9AEB63806737; Sat, 9 Jul 2022 08:29:52 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id E860C2026D64; Sat, 9 Jul 2022 08:29:50 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Maryam Tahhan , Reshma Pattan , Maxime Coquelin , Chenbo Xia , Ray Kinsella , Thomas Monjalon , Ferruh Yigit , Andrew Rybchenko Subject: [RFC v2 v2 28/29] dev: introduce device accessors Date: Sat, 9 Jul 2022 10:26:43 +0200 Message-Id: <20220709082644.664675-29-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 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 Prepare for making the device object opaque by adding accessors. Update existing "external" users. Signed-off-by: David Marchand --- app/proc-info/main.c | 6 ++-- examples/ethtool/lib/rte_ethtool.c | 2 +- examples/l3fwd/l3fwd_em.c | 4 +-- examples/l3fwd/l3fwd_fib.c | 8 ++--- examples/l3fwd/l3fwd_lpm.c | 4 +-- examples/vdpa/main.c | 16 ++++----- lib/eal/common/eal_common_dev.c | 24 ++++++++++++++ lib/eal/include/rte_dev.h | 53 ++++++++++++++++++++++++++++++ lib/eal/version.map | 4 +++ lib/ethdev/rte_ethdev.h | 2 +- 10 files changed, 102 insertions(+), 21 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 1bfba5f60d..d52ac8a038 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -755,7 +755,7 @@ show_port(void) } printf("\t -- driver %s device %s socket %d\n", - dev_info.driver_name, dev_info.device->name, + dev_info.driver_name, rte_dev_name(dev_info.device), rte_eth_dev_socket_id(i)); ret = rte_eth_dev_owner_get(i, &owner); @@ -1254,7 +1254,7 @@ show_crypto(void) rte_cryptodev_name_get(i), dev_info.driver_name, dev_info.driver_id, - dev_info.device->numa_node, + rte_dev_numa_node(dev_info.device), rte_cryptodev_queue_pair_count(i)); display_crypto_feature_info(dev_info.feature_flags); @@ -1466,7 +1466,7 @@ dump_regs(char *file_prefix) else printf("Device (%s) regs dumped successfully, " "driver:%s version:0X%08X\n", - dev_info.device->name, + rte_dev_name(dev_info.device), dev_info.driver_name, reg_info.version); fclose(fp_regs); diff --git a/examples/ethtool/lib/rte_ethtool.c b/examples/ethtool/lib/rte_ethtool.c index 88dc917b73..33acc5e3cc 100644 --- a/examples/ethtool/lib/rte_ethtool.c +++ b/examples/ethtool/lib/rte_ethtool.c @@ -49,7 +49,7 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) strlcpy(drvinfo->driver, dev_info.driver_name, sizeof(drvinfo->driver)); strlcpy(drvinfo->version, rte_version(), sizeof(drvinfo->version)); - strlcpy(drvinfo->bus_info, dev_info.device->name, + strlcpy(drvinfo->bus_info, rte_dev_name(dev_info.device), sizeof(drvinfo->bus_info)); memset(®_info, 0, sizeof(reg_info)); diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c index 10be24c61d..0531282a1f 100644 --- a/examples/l3fwd/l3fwd_em.c +++ b/examples/l3fwd/l3fwd_em.c @@ -403,7 +403,7 @@ populate_ipv4_flow_into_table(const struct rte_hash *h) em_route_base_v4[i].v4_key.port_dst, em_route_base_v4[i].v4_key.port_src, em_route_base_v4[i].v4_key.proto, - em_route_base_v4[i].if_out, dev_info.device->name); + em_route_base_v4[i].if_out, rte_dev_name(dev_info.device)); } printf("Hash: Adding 0x%" PRIx64 " keys\n", (uint64_t)route_num_v4); @@ -455,7 +455,7 @@ populate_ipv6_flow_into_table(const struct rte_hash *h) em_route_base_v6[i].v6_key.port_dst, em_route_base_v6[i].v6_key.port_src, em_route_base_v6[i].v6_key.proto, - em_route_base_v6[i].if_out, dev_info.device->name); + em_route_base_v6[i].if_out, rte_dev_name(dev_info.device)); } printf("Hash: Adding 0x%" PRIx64 "keys\n", (uint64_t)route_num_v6); diff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c index e02e4b3f5a..b82e0c0354 100644 --- a/examples/l3fwd/l3fwd_fib.c +++ b/examples/l3fwd/l3fwd_fib.c @@ -640,11 +640,11 @@ setup_fib(const int socketid) printf("FIB: Adding route %s / %d (%d) [%s]\n", abuf, route_base_v4[i].depth, route_base_v4[i].if_out, - dev_info.device->name); + rte_dev_name(dev_info.device)); } else { printf("FIB: IPv4 route added to port %d [%s]\n", route_base_v4[i].if_out, - dev_info.device->name); + rte_dev_name(dev_info.device)); } } /* >8 End of setup fib. */ @@ -695,11 +695,11 @@ setup_fib(const int socketid) printf("FIB: Adding route %s / %d (%d) [%s]\n", abuf, route_base_v6[i].depth, route_base_v6[i].if_out, - dev_info.device->name); + rte_dev_name(dev_info.device)); } else { printf("FIB: IPv6 route added to port %d [%s]\n", route_base_v6[i].if_out, - dev_info.device->name); + rte_dev_name(dev_info.device)); } } } diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c index d1b850dd5b..22d7f61a42 100644 --- a/examples/l3fwd/l3fwd_lpm.c +++ b/examples/l3fwd/l3fwd_lpm.c @@ -598,7 +598,7 @@ setup_lpm(const int socketid) printf("LPM: Adding route %s / %d (%d) [%s]\n", inet_ntop(AF_INET, &in, abuf, sizeof(abuf)), route_base_v4[i].depth, - route_base_v4[i].if_out, dev_info.device->name); + route_base_v4[i].if_out, rte_dev_name(dev_info.device)); } /* create the LPM6 table */ @@ -642,7 +642,7 @@ setup_lpm(const int socketid) inet_ntop(AF_INET6, route_base_v6[i].ip_8, abuf, sizeof(abuf)), route_base_v6[i].depth, - route_base_v6[i].if_out, dev_info.device->name); + route_base_v6[i].if_out, rte_dev_name(dev_info.device)); } } diff --git a/examples/vdpa/main.c b/examples/vdpa/main.c index 7e11ef4e26..ee240dd15a 100644 --- a/examples/vdpa/main.c +++ b/examples/vdpa/main.c @@ -119,7 +119,7 @@ new_device(int vid) "Failed to get generic device for port %d\n", i); continue; } - printf("\nnew port %s, device : %s\n", ifname, dev->name); + printf("\nnew port %s, device : %s\n", ifname, rte_dev_name(dev)); vports[i].vid = vid; break; } @@ -149,7 +149,7 @@ destroy_device(int vid) continue; } - printf("\ndestroy port %s, device: %s\n", ifname, dev->name); + printf("\ndestroy port %s, device: %s\n", ifname, rte_dev_name(dev)); break; } } @@ -353,23 +353,23 @@ static void cmd_list_vdpa_devices_parsed( cmdline_printf(cl, "device name\tqueue num\tsupported features\n"); RTE_DEV_FOREACH(dev, "class=vdpa", &dev_iter) { - vdev = rte_vdpa_find_device_by_name(dev->name); + vdev = rte_vdpa_find_device_by_name(rte_dev_name(dev)); if (!vdev) continue; if (rte_vdpa_get_queue_num(vdev, &queue_num) < 0) { RTE_LOG(ERR, VDPA, "failed to get vdpa queue number " - "for device %s.\n", dev->name); + "for device %s.\n", rte_dev_name(dev)); continue; } if (rte_vdpa_get_features(vdev, &features) < 0) { RTE_LOG(ERR, VDPA, "failed to get vdpa features " - "for device %s.\n", dev->name); + "for device %s.\n", rte_dev_name(dev)); continue; } cmdline_printf(cl, "%s\t\t%" PRIu32 "\t\t0x%" PRIx64 "\n", - dev->name, queue_num, features); + rte_dev_name(dev), queue_num, features); } } @@ -606,10 +606,10 @@ main(int argc, char *argv[]) cmdline_stdin_exit(cl); } else { RTE_DEV_FOREACH(dev, "class=vdpa", &dev_iter) { - vdev = rte_vdpa_find_device_by_name(dev->name); + vdev = rte_vdpa_find_device_by_name(rte_dev_name(dev)); if (vdev == NULL) { rte_panic("Failed to find vDPA dev for %s\n", - dev->name); + rte_dev_name(dev)); } vports[devcnt].dev = vdev; snprintf(vports[devcnt].ifname, MAX_PATH_LEN, "%s%d", diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c index 5b64b80cb9..e2d77e02a5 100644 --- a/lib/eal/common/eal_common_dev.c +++ b/lib/eal/common/eal_common_dev.c @@ -25,6 +25,30 @@ rte_driver_name(const struct rte_driver *driver) return driver->name; } +const struct rte_bus * +rte_dev_bus(const struct rte_device *dev) +{ + return dev->bus; +} + +const struct rte_driver * +rte_dev_driver(const struct rte_device *dev) +{ + return dev->driver; +} + +const char * +rte_dev_name(const struct rte_device *dev) +{ + return dev->name; +} + +int +rte_dev_numa_node(const struct rte_device *dev) +{ + return dev->numa_node; +} + /** * The device event callback description. * diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h index 875ecee371..a80447a645 100644 --- a/lib/eal/include/rte_dev.h +++ b/lib/eal/include/rte_dev.h @@ -23,6 +23,7 @@ extern "C" { #include #include +struct rte_bus; struct rte_driver; /** @@ -68,12 +69,64 @@ __rte_experimental const char * rte_driver_name(const struct rte_driver *driver); +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * @param dev + * A pointer to a device structure. + * @return + * A pointer to this device bus. + */ +__rte_experimental +const struct rte_bus * +rte_dev_bus(const struct rte_device *dev); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * @param dev + * A pointer to a device structure. + * @return + * A pointer to this device driver. + */ +__rte_experimental +const struct rte_driver * +rte_dev_driver(const struct rte_device *dev); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * @param dev + * A pointer to a device structure. + * @return + * A pointer to this device name. + */ +__rte_experimental +const char * +rte_dev_name(const struct rte_device *dev); + /* * Internal identifier length * Sufficiently large to allow for UUID or PCI address */ #define RTE_DEV_NAME_MAX_LEN 64 +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice + * + * @param dev + * A pointer to a device structure. + * @return + * A pointer to this device numa node. + */ +__rte_experimental +int +rte_dev_numa_node(const struct rte_device *dev); + /** * A structure describing a generic device. */ diff --git a/lib/eal/version.map b/lib/eal/version.map index 54f85ab01f..660d3c7433 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -426,6 +426,10 @@ EXPERIMENTAL { # added in 22.11 rte_bus_name; rte_driver_name; + rte_dev_bus; + rte_dev_driver; + rte_dev_name; + rte_dev_numa_node; }; INTERNAL { diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index e9574f646f..2197525315 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -3380,7 +3380,7 @@ int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma, * exists for the device and the rte_eth_dev 'dev' has been populated * successfully with a call to it: * - * driver_name = rte_driver_name(dev->device->driver) + * driver_name = rte_driver_name(rte_dev_driver(dev->device)); * nb_rx_queues = dev->data->nb_rx_queues * nb_tx_queues = dev->data->nb_tx_queues * dev_flags = &dev->data->dev_flags From patchwork Sat Jul 9 08:26:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 113885 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id ED0D0A00C5; Sat, 9 Jul 2022 10:30:08 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D2CCD42B72; Sat, 9 Jul 2022 10:30:07 +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 A203F42826 for ; Sat, 9 Jul 2022 10:30:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1657355405; 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=muSipBFPyyTOtNoWWK/ZNnZ0z2UovzWWmCpBKcvHndo=; b=fZ2fkPJ2SyNH3R3w4F4cD7dt0EWSSRKlyICkZzeRpQad+TcAjSSmx5NbsTuhvvjc8FrcOc Xl6g3oI54o4or2/FBAse2rNcOKE3/YhOOgPeTMwofXgvTf1j11n3cIqUQt1mLrNTh+N7j2 +WcyBIe10CZcQx6QIfZLuPctFPHrYhU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-668-casbJu92N8a6SbhqzTxW-Q-1; Sat, 09 Jul 2022 04:29:56 -0400 X-MC-Unique: casbJu92N8a6SbhqzTxW-Q-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 3218C811E80; Sat, 9 Jul 2022 08:29:56 +0000 (UTC) Received: from localhost.localdomain (unknown [10.40.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6933C2026D2D; Sat, 9 Jul 2022 08:29:55 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Maxime Coquelin , Chenbo Xia Subject: [RFC v2 v2 29/29] dev: hide device object Date: Sat, 9 Jul 2022 10:26:44 +0200 Message-Id: <20220709082644.664675-30-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 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 Make rte_device opaque for non internal users. This will make extending this object possible without breaking the ABI. Signed-off-by: David Marchand --- lib/eal/common/eal_private.h | 2 +- lib/eal/include/dev_driver.h | 14 ++++++++++++++ lib/eal/include/rte_dev.h | 13 +------------ lib/vhost/vdpa.c | 1 + 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h index 44d14241f0..3ca9ce2ffc 100644 --- a/lib/eal/common/eal_private.h +++ b/lib/eal/common/eal_private.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/lib/eal/include/dev_driver.h b/lib/eal/include/dev_driver.h index 015188abd5..01c3e30994 100644 --- a/lib/eal/include/dev_driver.h +++ b/lib/eal/include/dev_driver.h @@ -12,6 +12,8 @@ extern "C" { #include #include +struct rte_devargs; + /** * A structure describing a device driver. */ @@ -21,6 +23,18 @@ struct rte_driver { const char *alias; /**< Driver alias. */ }; +/** + * A structure describing a generic device. + */ +struct rte_device { + RTE_TAILQ_ENTRY(rte_device) next; /**< Next device */ + const char *name; /**< Device name */ + const struct rte_driver *driver; /**< Driver assigned after probing */ + const struct rte_bus *bus; /**< Bus handle assigned on scan */ + int numa_node; /**< NUMA node connection */ + struct rte_devargs *devargs; /**< Arguments for latest probing */ +}; + #ifdef __cplusplus } #endif diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h index a80447a645..3077cf3f0f 100644 --- a/lib/eal/include/rte_dev.h +++ b/lib/eal/include/rte_dev.h @@ -25,6 +25,7 @@ extern "C" { struct rte_bus; struct rte_driver; +struct rte_device; /** * The device event type. @@ -127,18 +128,6 @@ __rte_experimental int rte_dev_numa_node(const struct rte_device *dev); -/** - * A structure describing a generic device. - */ -struct rte_device { - RTE_TAILQ_ENTRY(rte_device) next; /**< Next device */ - const char *name; /**< Device name */ - const struct rte_driver *driver; /**< Driver assigned after probing */ - const struct rte_bus *bus; /**< Bus handle assigned on scan */ - int numa_node; /**< NUMA node connection */ - struct rte_devargs *devargs; /**< Arguments for latest probing */ -}; - /** * Query status of a device. * diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c index bdebcbe565..aaf3f267e9 100644 --- a/lib/vhost/vdpa.c +++ b/lib/vhost/vdpa.c @@ -10,6 +10,7 @@ #include +#include #include #include #include