From patchwork Tue Jun 28 14:46: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: 113517 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 845B6A056B; Tue, 28 Jun 2022 16:47:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A877242B70; Tue, 28 Jun 2022 16:47:14 +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 DF29D4114B for ; Tue, 28 Jun 2022 16:47:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1656427632; 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=ZSlB2o/4c+KkoLWai79f4FEflpg4Au/jBm2ceHIntz8=; b=IxKvOJcoKRXZrkg3koNjxQB3VScsaKHKuVRrtfe3sC4SBosPgQUDGBO0O91JFsM/CXtQX7 BAjuvC3yMe8UhuuNJ8N5BNOOclUHzac03Guso76laoRfhH5yKVeJEu6HtuJGaBeHWbwRVO f38yS/MvzcId82zhuA0BH2Fz6owI8tM= 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-613-NuZTDrnkO2Sy3wqpMIHbWQ-1; Tue, 28 Jun 2022 10:47:08 -0400 X-MC-Unique: NuZTDrnkO2Sy3wqpMIHbWQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4F87A185A7BA; Tue, 28 Jun 2022 14:47:07 +0000 (UTC) Received: from fchome.redhat.com (unknown [10.40.194.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id BFD6A2166B26; Tue, 28 Jun 2022 14:47:03 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, kevin.laatz@intel.com, Fan Zhang , Ashish Gupta , Qiming Yang , Wenjun Wu , Shijith Thotton , Srisivasubramanian Srinivasan , Chengwen Feng , Ferruh Yigit , Andrew Rybchenko , Olivier Matz , Ori Kam , Akhil Goyal , Maxime Coquelin , Chenbo Xia Subject: [RFC PATCH 04/11] dev: move unrelated macros from header Date: Tue, 28 Jun 2022 16:46:36 +0200 Message-Id: <20220628144643.1213026-5-david.marchand@redhat.com> In-Reply-To: <20220628144643.1213026-1-david.marchand@redhat.com> References: <20220628144643.1213026-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 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..1617b5ed14 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 8fa2153023..3597fe897d 100644 --- a/lib/vhost/vdpa.c +++ b/lib/vhost/vdpa.c @@ -10,6 +10,7 @@ #include +#include #include #include #include