From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4AF2142910; Mon, 10 Apr 2023 13:01:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C123642D31; Mon, 10 Apr 2023 13:01:02 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2125.outbound.protection.outlook.com [40.107.243.125]) by mails.dpdk.org (Postfix) with ESMTP id 9A3D042D0E for ; Mon, 10 Apr 2023 13:01:00 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GEgEMWHa3ez86ywRU69VcNv7L2fHMssNZFWPQW3H8C+ds7thUGuxranzu/ohJFpJkHoJhfoUpqnXkc4rnvdwR7S0RpmR2PjC2CykRrW6sAssUCmvPOUeh9dI22h69Zm/OyL5TMpNzqS6WmFgXQX6eTYLTOs2JNrQ9MYZIVEWuFR2dF5sTlFlofy2wrjBVru8VWvtoATTUJew1IOsYCFSXO1WamlkRbqjv9gXdB4RsQmPmcRhJk/fhA7T6oK0/lqgLHZWtZuTMkuajm64iN8mKMsydXUEi2UBWJ4PReI2npnSJ6vvrLOwtpb65yJOkxO1LOYisGML1O8uVrbsBFWSIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ezn3XPc1fsobYiKH5SNbqVW0ghyb3z0kpL3cxgJ1JWc=; b=OfsmpJaWZ59DMpB9J+uUo7GR9w+0IM6ez0KlJnovL0WNTNKXfiyOIAK+9CIh4Nqnbq/GGj3Os6oKKLNaqi091IbwTbSwGdb4xnJCMICeb7LoFGpMNGEdmJFpXpfVsFWxJKyAO7lgAd/lAhOKcUINR6hm5FgaQHhtZbph+pMha9Tt8gPf14ta/3gFDwzq5nn2sDwgosln+CHqpSDIdoR4jPDmCsR69rjHIpiPEauo2pDD9OQriLiTD3EZRo/Fdamc0TmCuSBvsojQL1iwQb1iYc6SkWmgxWEUa/4qpaYNWicCOPsqhbmj02l+7PVCiAEAzw4lVl4x5FaQ3TDHwBRXFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ezn3XPc1fsobYiKH5SNbqVW0ghyb3z0kpL3cxgJ1JWc=; b=dRPAP47hy7lH5wO9LGkAMY4oOeMVDwYqPSYrrYNQRvnwGORMH4QT4OpMAO3/oz6r/LBWpa9gY+qNkiKjDeJidddGCfpznaTosaRnGNs3MsLC0VNHPHciwQ6QOV6ZlCz5DNUSxgkzazA0sG10X+fQ9n0V6mg2Wj8nvKO6gYccaIQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) by DM6PR13MB3882.namprd13.prod.outlook.com (2603:10b6:5:22a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.31; Mon, 10 Apr 2023 11:00:58 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::baa6:b49:d2f4:c60e]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::baa6:b49:d2f4:c60e%4]) with mapi id 15.20.6277.036; Mon, 10 Apr 2023 11:00:58 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 05/13] net/nfp: use generic macros for array size and to set bits Date: Mon, 10 Apr 2023 19:00:07 +0800 Message-Id: <20230410110015.2973660-6-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230410110015.2973660-1-chaoyong.he@corigine.com> References: <20230410110015.2973660-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR01CA0040.apcprd01.prod.exchangelabs.com (2603:1096:4:193::14) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|DM6PR13MB3882:EE_ X-MS-Office365-Filtering-Correlation-Id: cda33380-f6d8-4682-6e4e-08db39b2dd51 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cGt6AC7xRJ/5lzwh9TFWd35knIt70Ie41puakNqULuXS5wmQEu5i5KMK589TjEgJBt7pqJOB+WAcC+RsfrBN4rx01l3bepLQPaC4xUrdpEHp7dEf9FyGfOcithFZ+meqQm+004f53nnNwU8VEqBmG0lw10mGM3S9l4/xrjSAfVPGbEyTeOWtMwiELvWlNfpoSJN5/heL6epdGv9Te7BEid6pKHa9lEJUX/r7bv5OTYFkTFFVhytqJQp3JH6kQpekiz+/Kaew55oM5497tkhX/w8widgywcztyimtD3iY0M//Y6lHFLYoSlWSnnExpY1l7Dn/5gVCx+e8AbQ5EDSLwPS/0Rg3pUcLnQFNctpDo6BOXAnnF3kERd0+MYha4wvmCLx7lxfGFe+ALbwWm+cbCntxD7gBvvXc17RevLvgjATg1wSJlNYLMjIVD1TxOozWxq8bzJCKywNEQhV1U5N3kTN7H4dWbpZAlmDT6RLtcir8nOe9xTl5NqIwyLLg/eFeKHhQfZ7JDpAyYTcYOx6rx1BkorH4d1Ci0XjRm0lht4CEKfJIfpIOX2/Pfb8/7PyYCy+/rUS5NMYSXmSzTmutQJ46l9OB+QbzVaVeKchyaI5phoRJNPKdCuz6mKbG35zKzgot5SJVD5lOO74CaatMhg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR13MB5545.namprd13.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(39840400004)(366004)(376002)(136003)(346002)(451199021)(316002)(86362001)(66556008)(66574015)(66476007)(478600001)(83380400001)(66946007)(38100700002)(38350700002)(36756003)(186003)(6512007)(4326008)(8676002)(2616005)(6916009)(41300700001)(2906002)(1076003)(6506007)(26005)(107886003)(8936002)(52116002)(30864003)(6666004)(5660300002)(6486002)(44832011)(41533002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b1o0aU8yZE0vdElWMmpPcDNKZW91TkMvVWNJK2hGY0JDK1d5TGpMcnRkdktV?= =?utf-8?B?MDFTWU9DZk8wWE01K2xwQi9mSUEvNXcvREQ0eGk2NXJRSm03S3UvKzVrZTR2?= =?utf-8?B?STJNb2xtcFJnT3NHaHFJWFBpb0NESjNiUGVzWjFVR2o3TWVFczVFRUdrTkN0?= =?utf-8?B?WUlNQS9pb25pV054ZWVIM2RDR21Bb1JPalZtWVNacm1pemxOR2NmaGcrT2JK?= =?utf-8?B?V0ExNGhVZlhDTmY1R2d0KyttSlBuY2VxbUVDTFFIMFBhdTQ5ZmZ5Mjl2SFFO?= =?utf-8?B?cEtTSDJzdk1jQmJkUFRaVUVNUDlaUW1TdkRrWnNRR0lqSFBrdXdmOTRDTHdY?= =?utf-8?B?VmtZUS92VEhtWmVWREtXV0t3V3FtZm44RnRORGdBb2U2NFFPdjRuWkpu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ine.com X-MS-Exchange-CrossTenant-Network-Message-Id: cda33380-f6d8-4682-6e4e-08db39b2dd51 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2023 11:00:58.6474 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GrtO39isrzEaJypkh5TbVrANxF5xk25lLnFpgWyh3dFOb+PvWw9fKoOz8KWnV66+5xdI8kcp2XNpitqNG37EiUNWfcEuW0Od3vyTWZZXEts= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB3882 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 Instead of using NFP specific macros for array size and to set bits use the generic ones provided by DPDK. By moving some include directives for system header files directly to the source files that depend on them, the header file nfp_platform.h defining the NFP specific macros can be removed. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfp_cpp_bridge.c | 5 +-- drivers/net/nfp/nfp_rxtx.c | 1 - drivers/net/nfp/nfp_rxtx.h | 10 +++--- .../net/nfp/nfpcore/nfp-common/nfp_platform.h | 29 ---------------- .../net/nfp/nfpcore/nfp-common/nfp_resid.h | 4 --- drivers/net/nfp/nfpcore/nfp_cpp.h | 1 - drivers/net/nfp/nfpcore/nfp_cppcore.c | 3 +- drivers/net/nfp/nfpcore/nfp_hwinfo.h | 2 +- drivers/net/nfp/nfpcore/nfp_nffw.c | 4 +-- drivers/net/nfp/nfpcore/nfp_nffw.h | 1 - drivers/net/nfp/nfpcore/nfp_nsp.c | 2 +- drivers/net/nfp/nfpcore/nfp_nsp.h | 12 +++---- drivers/net/nfp/nfpcore/nfp_nsp_cmds.c | 2 +- drivers/net/nfp/nfpcore/nfp_nsp_eth.c | 34 +++++++++---------- drivers/net/nfp/nfpcore/nfp_target.h | 1 - 15 files changed, 38 insertions(+), 73 deletions(-) delete mode 100644 drivers/net/nfp/nfpcore/nfp-common/nfp_platform.h diff --git a/drivers/net/nfp/nfp_cpp_bridge.c b/drivers/net/nfp/nfp_cpp_bridge.c index 8e29cfb6d3..78a680453b 100644 --- a/drivers/net/nfp/nfp_cpp_bridge.c +++ b/drivers/net/nfp/nfp_cpp_bridge.c @@ -13,6 +13,9 @@ * Netronome vNIC DPDK Poll-Mode Driver: CPP Bridge */ +#include +#include + #include #include "nfpcore/nfp_cpp.h" @@ -22,8 +25,6 @@ #include "nfp_logs.h" #include "nfp_cpp_bridge.h" -#include - /* Prototypes */ static int nfp_cpp_bridge_serve_write(int sockfd, struct nfp_cpp *cpp); static int nfp_cpp_bridge_serve_read(int sockfd, struct nfp_cpp *cpp); diff --git a/drivers/net/nfp/nfp_rxtx.c b/drivers/net/nfp/nfp_rxtx.c index bc73026825..16a124fd7d 100644 --- a/drivers/net/nfp/nfp_rxtx.c +++ b/drivers/net/nfp/nfp_rxtx.c @@ -22,7 +22,6 @@ #include "nfp_logs.h" #include "nfpcore/nfp_mip.h" #include "nfpcore/nfp_rtsym.h" -#include "nfpcore/nfp-common/nfp_platform.h" static int nfp_net_rx_fill_freelist(struct nfp_net_rxq *rxq) diff --git a/drivers/net/nfp/nfp_rxtx.h b/drivers/net/nfp/nfp_rxtx.h index 5e651518ed..f016bf732c 100644 --- a/drivers/net/nfp/nfp_rxtx.h +++ b/drivers/net/nfp/nfp_rxtx.h @@ -120,11 +120,11 @@ struct nfp_meta_parsed { #define NFDK_DESC_TX_TYPE_TSO 2 #define NFDK_DESC_TX_TYPE_SIMPLE 8 #define NFDK_DESC_TX_TYPE_GATHER 1 -#define NFDK_DESC_TX_EOP BIT(14) -#define NFDK_DESC_TX_CHAIN_META BIT(3) -#define NFDK_DESC_TX_ENCAP BIT(2) -#define NFDK_DESC_TX_L4_CSUM BIT(1) -#define NFDK_DESC_TX_L3_CSUM BIT(0) +#define NFDK_DESC_TX_EOP RTE_BIT32(14) +#define NFDK_DESC_TX_CHAIN_META RTE_BIT32(3) +#define NFDK_DESC_TX_ENCAP RTE_BIT32(2) +#define NFDK_DESC_TX_L4_CSUM RTE_BIT32(1) +#define NFDK_DESC_TX_L3_CSUM RTE_BIT32(0) #define NFDK_TX_MAX_DATA_PER_DESC 0x00004000 #define NFDK_TX_DESC_GATHER_MAX 17 diff --git a/drivers/net/nfp/nfpcore/nfp-common/nfp_platform.h b/drivers/net/nfp/nfpcore/nfp-common/nfp_platform.h deleted file mode 100644 index 9fa52074f0..0000000000 --- a/drivers/net/nfp/nfpcore/nfp-common/nfp_platform.h +++ /dev/null @@ -1,29 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause - * Copyright(c) 2018 Netronome Systems, Inc. - * All rights reserved. - */ - -#ifndef __NFP_PLATFORM_H__ -#define __NFP_PLATFORM_H__ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#ifndef BIT_ULL -#define BIT(x) (1 << (x)) -#define BIT_ULL(x) (1ULL << (x)) -#endif - -#ifndef ARRAY_SIZE -#define ARRAY_SIZE(x) RTE_DIM(x) -#endif - -#endif /* __NFP_PLATFORM_H__ */ diff --git a/drivers/net/nfp/nfpcore/nfp-common/nfp_resid.h b/drivers/net/nfp/nfpcore/nfp-common/nfp_resid.h index ac2bf0335d..5445d4dac8 100644 --- a/drivers/net/nfp/nfpcore/nfp-common/nfp_resid.h +++ b/drivers/net/nfp/nfpcore/nfp-common/nfp_resid.h @@ -11,10 +11,6 @@ #define _NFP_RESID_NO_C_FUNC #endif -#ifndef _NFP_RESID_NO_C_FUNC -#include "nfp_platform.h" -#endif - /* * NFP Chip Architectures * diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h index 437dcdf942..d657a7c164 100644 --- a/drivers/net/nfp/nfpcore/nfp_cpp.h +++ b/drivers/net/nfp/nfpcore/nfp_cpp.h @@ -8,7 +8,6 @@ #include -#include "nfp-common/nfp_platform.h" #include "nfp-common/nfp_resid.h" struct nfp_cpp_mutex; diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c index 97cf16c801..681ec93b96 100644 --- a/drivers/net/nfp/nfpcore/nfp_cppcore.c +++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -565,7 +566,7 @@ nfp_cpp_alloc(struct rte_pci_device *dev, int driver_lock_needed) uint32_t xpbaddr; size_t tgt; - for (tgt = 0; tgt < ARRAY_SIZE(cpp->imb_cat_table); tgt++) { + for (tgt = 0; tgt < RTE_DIM(cpp->imb_cat_table); tgt++) { /* Hardcoded XPB IMB Base, island 0 */ xpbaddr = 0x000a0000 + (tgt * 4); err = nfp_xpb_readl(cpp, xpbaddr, diff --git a/drivers/net/nfp/nfpcore/nfp_hwinfo.h b/drivers/net/nfp/nfpcore/nfp_hwinfo.h index ccc616321f..a3da7512db 100644 --- a/drivers/net/nfp/nfpcore/nfp_hwinfo.h +++ b/drivers/net/nfp/nfpcore/nfp_hwinfo.h @@ -63,7 +63,7 @@ #define NFP_HWINFO_VERSION_1 ('H' << 24 | 'I' << 16 | 1 << 8 | 0 << 1 | 0) #define NFP_HWINFO_VERSION_2 ('H' << 24 | 'I' << 16 | 2 << 8 | 0 << 1 | 0) -#define NFP_HWINFO_VERSION_UPDATING BIT(0) +#define NFP_HWINFO_VERSION_UPDATING RTE_BIT32(0) struct nfp_hwinfo { uint8_t start[0]; diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c index bead4f3341..07d63900dc 100644 --- a/drivers/net/nfp/nfpcore/nfp_nffw.c +++ b/drivers/net/nfp/nfpcore/nfp_nffw.c @@ -61,9 +61,9 @@ nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi) } #define NFP_IMB_TGTADDRESSMODECFG_MODE_of(_x) (((_x) >> 13) & 0x7) -#define NFP_IMB_TGTADDRESSMODECFG_ADDRMODE BIT(12) +#define NFP_IMB_TGTADDRESSMODECFG_ADDRMODE RTE_BIT32(12) #define NFP_IMB_TGTADDRESSMODECFG_ADDRMODE_32_BIT 0 -#define NFP_IMB_TGTADDRESSMODECFG_ADDRMODE_40_BIT BIT(12) +#define NFP_IMB_TGTADDRESSMODECFG_ADDRMODE_40_BIT RTE_BIT32(12) static int nfp_mip_mu_locality_lsb(struct nfp_cpp *cpp) diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.h b/drivers/net/nfp/nfpcore/nfp_nffw.h index 3bbdf1c138..9f24bd2269 100644 --- a/drivers/net/nfp/nfpcore/nfp_nffw.h +++ b/drivers/net/nfp/nfpcore/nfp_nffw.h @@ -6,7 +6,6 @@ #ifndef __NFP_NFFW_H__ #define __NFP_NFFW_H__ -#include "nfp-common/nfp_platform.h" #include "nfp_cpp.h" /* diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.c b/drivers/net/nfp/nfpcore/nfp_nsp.c index d8abaf1d52..1f6b7bd85c 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp.c +++ b/drivers/net/nfp/nfpcore/nfp_nsp.c @@ -61,7 +61,7 @@ nfp_nsp_print_extended_error(uint32_t ret_val) if (ret_val == 0) return; - for (i = 0; i < (int)ARRAY_SIZE(nsp_errors); i++) + for (i = 0; i < (int)RTE_DIM(nsp_errors); i++) if (ret_val == (uint32_t)nsp_errors[i].code) PMD_DRV_LOG(ERR, "err msg: %s", nsp_errors[i].msg); } diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h index 2184c15b4c..50cdec3a58 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp.h +++ b/drivers/net/nfp/nfpcore/nfp_nsp.h @@ -40,12 +40,12 @@ #define NSP_STATUS_MINOR GENMASK_ULL(43, 32) #define NSP_STATUS_CODE GENMASK_ULL(31, 16) #define NSP_STATUS_RESULT GENMASK_ULL(15, 8) -#define NSP_STATUS_BUSY BIT_ULL(0) +#define NSP_STATUS_BUSY RTE_BIT64(0) #define NSP_COMMAND 0x08 #define NSP_COMMAND_OPTION GENMASK_ULL(63, 32) #define NSP_COMMAND_CODE GENMASK_ULL(31, 16) -#define NSP_COMMAND_START BIT_ULL(0) +#define NSP_COMMAND_START RTE_BIT64(0) /* CPP address to retrieve the data from */ #define NSP_BUFFER 0x10 @@ -152,10 +152,10 @@ enum nfp_eth_fec { NFP_FEC_DISABLED_BIT, }; -#define NFP_FEC_AUTO BIT(NFP_FEC_AUTO_BIT) -#define NFP_FEC_BASER BIT(NFP_FEC_BASER_BIT) -#define NFP_FEC_REED_SOLOMON BIT(NFP_FEC_REED_SOLOMON_BIT) -#define NFP_FEC_DISABLED BIT(NFP_FEC_DISABLED_BIT) +#define NFP_FEC_AUTO RTE_BIT32(NFP_FEC_AUTO_BIT) +#define NFP_FEC_BASER RTE_BIT32(NFP_FEC_BASER_BIT) +#define NFP_FEC_REED_SOLOMON RTE_BIT32(NFP_FEC_REED_SOLOMON_BIT) +#define NFP_FEC_DISABLED RTE_BIT32(NFP_FEC_DISABLED_BIT) #define ETH_ALEN 6 diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c index 15f6f7002d..21b338461e 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c +++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c @@ -83,7 +83,7 @@ nfp_hwmon_read_sensor(struct nfp_cpp *cpp, enum nfp_nsp_sensor_id id, long *val) if (nsp == NULL) return -EIO; - ret = nfp_nsp_read_sensors(nsp, BIT(id), &s, sizeof(s)); + ret = nfp_nsp_read_sensors(nsp, RTE_BIT32(id), &s, sizeof(s)); nfp_nsp_close(nsp); if (ret < 0) diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c index 578120636d..f8d1416d4b 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c +++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c @@ -44,30 +44,30 @@ #define NSP_ETH_PORT_INDEX GENMASK_ULL(15, 8) #define NSP_ETH_PORT_LABEL GENMASK_ULL(53, 48) #define NSP_ETH_PORT_PHYLABEL GENMASK_ULL(59, 54) -#define NSP_ETH_PORT_FEC_SUPP_BASER BIT_ULL(60) -#define NSP_ETH_PORT_FEC_SUPP_RS BIT_ULL(61) +#define NSP_ETH_PORT_FEC_SUPP_BASER RTE_BIT64(60) +#define NSP_ETH_PORT_FEC_SUPP_RS RTE_BIT64(61) #define NSP_ETH_PORT_LANES_MASK rte_cpu_to_le_64(NSP_ETH_PORT_LANES) -#define NSP_ETH_STATE_CONFIGURED BIT_ULL(0) -#define NSP_ETH_STATE_ENABLED BIT_ULL(1) -#define NSP_ETH_STATE_TX_ENABLED BIT_ULL(2) -#define NSP_ETH_STATE_RX_ENABLED BIT_ULL(3) +#define NSP_ETH_STATE_CONFIGURED RTE_BIT64(0) +#define NSP_ETH_STATE_ENABLED RTE_BIT64(1) +#define NSP_ETH_STATE_TX_ENABLED RTE_BIT64(2) +#define NSP_ETH_STATE_RX_ENABLED RTE_BIT64(3) #define NSP_ETH_STATE_RATE GENMASK_ULL(11, 8) #define NSP_ETH_STATE_INTERFACE GENMASK_ULL(19, 12) #define NSP_ETH_STATE_MEDIA GENMASK_ULL(21, 20) -#define NSP_ETH_STATE_OVRD_CHNG BIT_ULL(22) +#define NSP_ETH_STATE_OVRD_CHNG RTE_BIT64(22) #define NSP_ETH_STATE_ANEG GENMASK_ULL(25, 23) #define NSP_ETH_STATE_FEC GENMASK_ULL(27, 26) -#define NSP_ETH_CTRL_CONFIGURED BIT_ULL(0) -#define NSP_ETH_CTRL_ENABLED BIT_ULL(1) -#define NSP_ETH_CTRL_TX_ENABLED BIT_ULL(2) -#define NSP_ETH_CTRL_RX_ENABLED BIT_ULL(3) -#define NSP_ETH_CTRL_SET_RATE BIT_ULL(4) -#define NSP_ETH_CTRL_SET_LANES BIT_ULL(5) -#define NSP_ETH_CTRL_SET_ANEG BIT_ULL(6) -#define NSP_ETH_CTRL_SET_FEC BIT_ULL(7) +#define NSP_ETH_CTRL_CONFIGURED RTE_BIT64(0) +#define NSP_ETH_CTRL_ENABLED RTE_BIT64(1) +#define NSP_ETH_CTRL_TX_ENABLED RTE_BIT64(2) +#define NSP_ETH_CTRL_RX_ENABLED RTE_BIT64(3) +#define NSP_ETH_CTRL_SET_RATE RTE_BIT64(4) +#define NSP_ETH_CTRL_SET_LANES RTE_BIT64(5) +#define NSP_ETH_CTRL_SET_ANEG RTE_BIT64(6) +#define NSP_ETH_CTRL_SET_FEC RTE_BIT64(7) /* Which connector port. */ #define PORT_TP 0x00 @@ -139,7 +139,7 @@ nfp_eth_rate2speed(enum nfp_eth_rate rate) { int i; - for (i = 0; i < (int)ARRAY_SIZE(nsp_eth_rate_tbl); i++) + for (i = 0; i < (int)RTE_DIM(nsp_eth_rate_tbl); i++) if (nsp_eth_rate_tbl[i].rate == rate) return nsp_eth_rate_tbl[i].speed; @@ -151,7 +151,7 @@ nfp_eth_speed2rate(unsigned int speed) { int i; - for (i = 0; i < (int)ARRAY_SIZE(nsp_eth_rate_tbl); i++) + for (i = 0; i < (int)RTE_DIM(nsp_eth_rate_tbl); i++) if (nsp_eth_rate_tbl[i].speed == speed) return nsp_eth_rate_tbl[i].rate; diff --git a/drivers/net/nfp/nfpcore/nfp_target.h b/drivers/net/nfp/nfpcore/nfp_target.h index 24417fb315..accedde1f7 100644 --- a/drivers/net/nfp/nfpcore/nfp_target.h +++ b/drivers/net/nfp/nfpcore/nfp_target.h @@ -7,7 +7,6 @@ #define NFP_TARGET_H #include "nfp-common/nfp_resid.h" -#include "nfp-common/nfp_platform.h" #include "nfp_cpp.h" #define P32 1 -- 2.39.1