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 C00E441FC8; Wed, 30 Aug 2023 04:17:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B8F69402D7; Wed, 30 Aug 2023 04:15:51 +0200 (CEST) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2098.outbound.protection.outlook.com [40.107.93.98]) by mails.dpdk.org (Postfix) with ESMTP id 250B3402C9 for ; Wed, 30 Aug 2023 04:15:47 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UoImycHg2MuJq+dUGmVxZN58JUeBAT20IP1v/WljZyf9PE28j4eWmVK4EitS1PAxVfVy8fdGGUFIrALXxxKUI6djwy8EmkoTeOgiO6yr/m9BwBSfh/bywjEwZ5/+eIZhmva+JcmfshI5Wodud1pUMyELs3ueHe3zqK0igcDN1Lejs5+CQyb5rdEYcjpJSV66cxrt6BHpYefOUViO6aF3kSWx0lhk6Or/BuNP5jDCmNRN32oEzn7/79NpRPs1HRbwqwnpj29cjCuL7gcxwXCz25NQF7dsZQipZjUE5iR7VYlhQVgz+9tJUVzuGFNNQl+UyqqGVih5RvI/NZPVTgM3QA== 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=23BgvJvYDhtQlDsGoYHCjeZMMxReVu+8jhIQkdwXURg=; b=eu1c7y67ieaQDw5WczVxqHBQvq17gJbGzNDBL43kxg5vszO2M0pdhHvBUvqVK5XKNiKLXbyRQmY5mphixP6W9owlsWq2tjCtDCBJhS4AfDSnQZ0et7bF6Z1TvoTRVaRRWQdHW9bUoMYfssPXfv1uD/OxpY8yneNDoFU7AjywQn8RoBWv5YaCDFUnzdjZ2F9a6JQSFie7e2D6DVfIxHjwkikl8a55IWXSVdXEjtr5qs1ec1/zKv7POKHgD0G4dWSopHn4tXzAUKmUMrUGkeD2iMesWnPL+ZfjTWgX7UiP7i7ywcDIDN/4zWfLCQo6LRoHEv3Sj69y7yBkJ8YkC8hHbQ== 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=23BgvJvYDhtQlDsGoYHCjeZMMxReVu+8jhIQkdwXURg=; b=VIS23SvRTnGdab52Yi5lgEwFWL94vQjPxa4g4MkCGuHkgpM66O6qWJpbOydqTeA5J3ELEFmj+dJRJ7BDZ36kjBF5VTX09+u3t0gHTjpUkEeYDMLRyNLYvuoO4bAMiBb/hp/aSPAfh+DnZvKrUkM3kkYV6Qwh2Mku9p6KuZSWoWQ= 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 DM6PR13MB3786.namprd13.prod.outlook.com (2603:10b6:5:229::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.18; Wed, 30 Aug 2023 02:15:45 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::c0f3:c2cc:b5bb:4192]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::c0f3:c2cc:b5bb:4192%4]) with mapi id 15.20.6699.034; Wed, 30 Aug 2023 02:15:45 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH v2 11/27] net/nfp: rename some parameter and variable Date: Wed, 30 Aug 2023 10:14:41 +0800 Message-Id: <20230830021457.2064750-12-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230830021457.2064750-1-chaoyong.he@corigine.com> References: <20230824110956.1943559-1-chaoyong.he@corigine.com> <20230830021457.2064750-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: PH0PR07CA0113.namprd07.prod.outlook.com (2603:10b6:510:4::28) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|DM6PR13MB3786:EE_ X-MS-Office365-Filtering-Correlation-Id: be3b1688-7494-4fc6-7ced-08dba8ff0479 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: d3MtRIc/JT4kVpYtTM8cCrfddifmbdKJuWpDy+ekAQf9cdvwLMokasjxu+AD5Ayy/l6t/NtWsky20espHbUz9H1fymage2QtthfRC01D+/E3fMNIbfMU1DWmws/WJ5FuhDVPLcnGu8wR9oTMaM5f6Z2ag7C8jXOIBnUn7QnHsPPGl1XTAii87XSLN/kPl8aJe5W7obGtzDQB6o1JL13gSdeZ7D8CJYauwrQAQzAL7pIe0ITk8HucyxxWb0sQfiUPuS+rkaNOB5+MZuW8L+qN0DqidIrOG8jV40046UxaiLCaljJZKBigvSh4doQv99XIyk6SHD0JJowOe0KalhoSNEXohedBAzrdLyBLqdyYKxLwY93OE2HEi/+7BEEGxzDTkTlfTR+iatFksgZr52O50vXbYYjcxWK+ukwHGD5TKZ22qN4IdwpcHVgAGAagEN8j5nYDsZxbd1IbMR0vr9tFq/SeRkknNGqY0cUQgjubPambFCe+Qt2nxBoAu/+SilUeMZxPRRFn1TG+4Wjy8GDlSXEOawHpImN0A+5IEVGcm23lNf2ooN9cHFKpO4Ep7gzJiFyLSYizIsKXxq6OPt7kh1Kw62FwPQArJvbI9NOyz8v5zSojOXGr5vRVaTTdW9d33XQ6wOvjXhUBnpJiF6M2Zc9f2o93n1XDs8+Njudp+J8= 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:(13230031)(136003)(366004)(376002)(346002)(396003)(39830400003)(451199024)(186009)(1800799009)(6512007)(6916009)(316002)(38100700002)(41300700001)(38350700002)(2906002)(4326008)(66574015)(30864003)(83380400001)(2616005)(86362001)(44832011)(26005)(36756003)(1076003)(8676002)(5660300002)(107886003)(8936002)(6666004)(6506007)(6486002)(66556008)(66946007)(66476007)(52116002)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?OHh0VEZOYzVwOG9BNjdJbEcvSGE4aE51NWJjNlJjL3llcXRpRUJrZHJ2MlMx?= =?utf-8?B?Mng1WWVJeitwWmVZZUhmTmg2Y0ZYTG1OSytyR0lmWVNFYnAyZjBTUnQ5Rmp6?= =?utf-8?B?bzQ5SU41Zk5neGJKSE5EY2dwNWR5cDF1WWFkMGRhYVRsa01MMUdwUFFiMGRn?= =?utf-8?B?QUJqMEY3UzE4SmVCb2xIRVZTL3loeE93ZGZ1cDZJWVJvcUFleTYzS0dscGhu?= =?utf-8?B?RTdSUmQxSDJzaVAydk9aY3hzZ3JaQ0F1UEZTVTFYeFVDSnJodlFZUUZVRXF1?= =?utf-8?B?YzgvNWNiTUxrQXJaOVZEdEQzNGNJKzE5VkZENXVPWlhMV0FUZWI2TDh2Z3Fy?= =?utf-8?B?OHpPbjUwb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dUhQSVd4MTVabVZQOFdt?= =?utf-8?B?dnc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: be3b1688-7494-4fc6-7ced-08dba8ff0479 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Aug 2023 02:15:45.1663 (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: MlmMPCndw2F7eauCDV/RsLuWJlOUpFfSWvJmGSd1UhwLoxAQZOEOKCMMvFq3nE8nZ+qvOWvf52lC+XS7pcuC3LGDyOUEw82cdw2O+N0bgs4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR13MB3786 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 Rename some parameter and variable to make the logic easier to understand. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- drivers/net/nfp/nfpcore/nfp_cpp.h | 10 ++--- drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c | 42 ++++++++--------- drivers/net/nfp/nfpcore/nfp_cppcore.c | 52 +++++++++++----------- drivers/net/nfp/nfpcore/nfp_mip.h | 2 +- drivers/net/nfp/nfpcore/nfp_mutex.c | 6 +-- drivers/net/nfp/nfpcore/nfp_nffw.c | 20 ++++----- drivers/net/nfp/nfpcore/nfp_nffw.h | 4 +- drivers/net/nfp/nfpcore/nfp_nsp.h | 8 ++-- drivers/net/nfp/nfpcore/nfp_nsp_cmds.c | 2 +- drivers/net/nfp/nfpcore/nfp_nsp_eth.c | 20 ++++----- 10 files changed, 83 insertions(+), 83 deletions(-) diff --git a/drivers/net/nfp/nfpcore/nfp_cpp.h b/drivers/net/nfp/nfpcore/nfp_cpp.h index ceb4d56a08..be7ae1d919 100644 --- a/drivers/net/nfp/nfpcore/nfp_cpp.h +++ b/drivers/net/nfp/nfpcore/nfp_cpp.h @@ -247,7 +247,7 @@ void *nfp_cpp_priv(struct nfp_cpp *cpp); void *nfp_cpp_area_priv(struct nfp_cpp_area *cpp_area); -uint32_t __nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model); +uint32_t nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model); /* NFP CPP core interface for CPP clients */ struct nfp_cpp *nfp_cpp_from_device_name(struct rte_pci_device *dev, @@ -381,10 +381,10 @@ uint8_t *nfp_cpp_map_area(struct nfp_cpp *cpp, uint32_t cpp_id, uint64_t addr, uint32_t size, struct nfp_cpp_area **area); int nfp_cpp_area_read(struct nfp_cpp_area *area, uint32_t offset, - void *buffer, size_t length); + void *address, size_t length); int nfp_cpp_area_write(struct nfp_cpp_area *area, uint32_t offset, - const void *buffer, size_t length); + const void *address, size_t length); void *nfp_cpp_area_iomem(struct nfp_cpp_area *area); @@ -393,10 +393,10 @@ struct nfp_cpp *nfp_cpp_area_cpp(struct nfp_cpp_area *cpp_area); const char *nfp_cpp_area_name(struct nfp_cpp_area *cpp_area); int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t cpp_id, - uint64_t address, void *kernel_vaddr, size_t length); + uint64_t address, void *buf, size_t length); int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t cpp_id, - uint64_t address, const void *kernel_vaddr, size_t length); + uint64_t address, const void *buf, size_t length); int nfp_cpp_area_readl(struct nfp_cpp_area *area, uint32_t offset, uint32_t *value); diff --git a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c index 28a6278497..db15411eb2 100644 --- a/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c +++ b/drivers/net/nfp/nfpcore/nfp_cpp_pcie_ops.c @@ -118,9 +118,9 @@ static int nfp_compute_bar(const struct nfp_bar *bar, uint32_t *bar_config, uint64_t *bar_base, - int tgt, - int act, - int tok, + int target, + int action, + int token, uint64_t offset, size_t size, int width) @@ -129,7 +129,7 @@ nfp_compute_bar(const struct nfp_bar *bar, uint32_t newcfg; uint32_t bitsize; - if (tgt >= 16) + if (target >= 16) return -EINVAL; switch (width) { @@ -149,15 +149,15 @@ nfp_compute_bar(const struct nfp_bar *bar, return -EINVAL; } - if (act != NFP_CPP_ACTION_RW && act != 0) { + if (action != NFP_CPP_ACTION_RW && action != 0) { /* Fixed CPP mapping with specific action */ mask = ~(NFP_PCIE_P2C_FIXED_SIZE(bar) - 1); newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_FIXED); - newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt); - newcfg |= NFP_PCIE_BAR_PCIE2CPP_ACTION_BASEADDRESS(act); - newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok); + newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(target); + newcfg |= NFP_PCIE_BAR_PCIE2CPP_ACTION_BASEADDRESS(action); + newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(token); if ((offset & mask) != ((offset + size - 1) & mask)) return -EINVAL; @@ -170,8 +170,8 @@ nfp_compute_bar(const struct nfp_bar *bar, /* Bulk mapping */ newcfg |= NFP_PCIE_BAR_PCIE2CPP_MAPTYPE (NFP_PCIE_BAR_PCIE2CPP_MAPTYPE_BULK); - newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(tgt); - newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(tok); + newcfg |= NFP_PCIE_BAR_PCIE2CPP_TARGET_BASEADDRESS(target); + newcfg |= NFP_PCIE_BAR_PCIE2CPP_TOKEN_BASEADDRESS(token); if ((offset & mask) != ((offset + size - 1) & mask)) return -EINVAL; @@ -221,9 +221,9 @@ nfp_bar_write(struct nfp_pcie_user *nfp, static int nfp_reconfigure_bar(struct nfp_pcie_user *nfp, struct nfp_bar *bar, - int tgt, - int act, - int tok, + int target, + int action, + int token, uint64_t offset, size_t size, int width) @@ -232,8 +232,8 @@ nfp_reconfigure_bar(struct nfp_pcie_user *nfp, uint32_t newcfg; uint64_t newbase; - err = nfp_compute_bar(bar, &newcfg, &newbase, tgt, act, tok, offset, - size, width); + err = nfp_compute_bar(bar, &newcfg, &newbase, target, action, + token, offset, size, width); if (err != 0) return err; @@ -457,15 +457,15 @@ nfp6000_area_iomem(struct nfp_cpp_area *area) static int nfp6000_area_read(struct nfp_cpp_area *area, - void *kernel_vaddr, + void *address, uint32_t offset, size_t length) { size_t n; int width; bool is_64; - uint32_t *wrptr32 = kernel_vaddr; - uint64_t *wrptr64 = kernel_vaddr; + uint32_t *wrptr32 = address; + uint64_t *wrptr64 = address; struct nfp6000_area_priv *priv; const volatile uint32_t *rdptr32; const volatile uint64_t *rdptr64; @@ -526,7 +526,7 @@ nfp6000_area_read(struct nfp_cpp_area *area, static int nfp6000_area_write(struct nfp_cpp_area *area, - const void *kernel_vaddr, + const void *address, uint32_t offset, size_t length) { @@ -536,8 +536,8 @@ nfp6000_area_write(struct nfp_cpp_area *area, uint32_t *wrptr32; uint64_t *wrptr64; struct nfp6000_area_priv *priv; - const uint32_t *rdptr32 = kernel_vaddr; - const uint64_t *rdptr64 = kernel_vaddr; + const uint32_t *rdptr32 = address; + const uint64_t *rdptr64 = address; priv = nfp_cpp_area_priv(area); wrptr64 = (uint64_t *)(priv->iomem + offset); diff --git a/drivers/net/nfp/nfpcore/nfp_cppcore.c b/drivers/net/nfp/nfpcore/nfp_cppcore.c index fa199e80d3..d8e57b9075 100644 --- a/drivers/net/nfp/nfpcore/nfp_cppcore.c +++ b/drivers/net/nfp/nfpcore/nfp_cppcore.c @@ -90,7 +90,7 @@ nfp_cpp_model(struct nfp_cpp *cpp) if (cpp == NULL) return NFP_CPP_MODEL_INVALID; - err = __nfp_cpp_model_autodetect(cpp, &model); + err = nfp_cpp_model_autodetect(cpp, &model); if (err < 0) return err; @@ -484,7 +484,7 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area) * CPP area handle * @param offset * Offset into CPP area - * @param kernel_vaddr + * @param address * Address to put data into * @param length * Number of bytes to read @@ -498,13 +498,13 @@ nfp_cpp_area_iomem(struct nfp_cpp_area *area) int nfp_cpp_area_read(struct nfp_cpp_area *area, uint32_t offset, - void *kernel_vaddr, + void *address, size_t length) { if ((offset + length) > area->size) return -EFAULT; - return area->cpp->op->area_read(area, kernel_vaddr, offset, length); + return area->cpp->op->area_read(area, address, offset, length); } /** @@ -514,7 +514,7 @@ nfp_cpp_area_read(struct nfp_cpp_area *area, * CPP area handle * @param offset * Offset into CPP area - * @param kernel_vaddr + * @param address * Address to put data into * @param length * Number of bytes to read @@ -528,13 +528,13 @@ nfp_cpp_area_read(struct nfp_cpp_area *area, int nfp_cpp_area_write(struct nfp_cpp_area *area, uint32_t offset, - const void *kernel_vaddr, + const void *address, size_t length) { if ((offset + length) > area->size) return -EFAULT; - return area->cpp->op->area_write(area, kernel_vaddr, offset, length); + return area->cpp->op->area_write(area, address, offset, length); } /* @@ -880,14 +880,14 @@ nfp_cpp_alloc(struct rte_pci_device *dev, } if (NFP_CPP_MODEL_IS_6000(nfp_cpp_model(cpp))) { - uint32_t xpbaddr; - size_t tgt; + uint32_t xpb_addr; + size_t target; - for (tgt = 0; tgt < RTE_DIM(cpp->imb_cat_table); tgt++) { + for (target = 0; target < RTE_DIM(cpp->imb_cat_table); target++) { /* Hardcoded XPB IMB Base, island 0 */ - xpbaddr = 0x000a0000 + (tgt * 4); - err = nfp_xpb_readl(cpp, xpbaddr, - (uint32_t *)&cpp->imb_cat_table[tgt]); + xpb_addr = 0x000a0000 + (target * 4); + err = nfp_xpb_readl(cpp, xpb_addr, + (uint32_t *)&cpp->imb_cat_table[target]); if (err < 0) { rte_free(cpp); return NULL; @@ -950,9 +950,9 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev, * CPP handle * @param destination * CPP id - * @param address + * @param offset * Offset into CPP target - * @param kernel_vaddr + * @param address * Buffer for result * @param length * Number of bytes to read @@ -963,20 +963,20 @@ nfp_cpp_from_device_name(struct rte_pci_device *dev, int nfp_cpp_read(struct nfp_cpp *cpp, uint32_t destination, - uint64_t address, - void *kernel_vaddr, + uint64_t offset, + void *address, size_t length) { int err; struct nfp_cpp_area *area; - area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length); + area = nfp_cpp_area_alloc_acquire(cpp, destination, offset, length); if (area == NULL) { PMD_DRV_LOG(ERR, "Area allocation/acquire failed for read"); return -1; } - err = nfp_cpp_area_read(area, 0, kernel_vaddr, length); + err = nfp_cpp_area_read(area, 0, address, length); nfp_cpp_area_release_free(area); return err; @@ -989,9 +989,9 @@ nfp_cpp_read(struct nfp_cpp *cpp, * CPP handle * @param destination * CPP id - * @param address + * @param offset * Offset into CPP target - * @param kernel_vaddr + * @param address * Buffer to read from * @param length * Number of bytes to write @@ -1002,20 +1002,20 @@ nfp_cpp_read(struct nfp_cpp *cpp, int nfp_cpp_write(struct nfp_cpp *cpp, uint32_t destination, - uint64_t address, - const void *kernel_vaddr, + uint64_t offset, + const void *address, size_t length) { int err; struct nfp_cpp_area *area; - area = nfp_cpp_area_alloc_acquire(cpp, destination, address, length); + area = nfp_cpp_area_alloc_acquire(cpp, destination, offset, length); if (area == NULL) { PMD_DRV_LOG(ERR, "Area allocation/acquire failed for write"); return -1; } - err = nfp_cpp_area_write(area, 0, kernel_vaddr, length); + err = nfp_cpp_area_write(area, 0, address, length); nfp_cpp_area_release_free(area); return err; @@ -1026,7 +1026,7 @@ nfp_cpp_write(struct nfp_cpp *cpp, * as those are model-specific */ uint32_t -__nfp_cpp_model_autodetect(struct nfp_cpp *cpp, +nfp_cpp_model_autodetect(struct nfp_cpp *cpp, uint32_t *model) { int err; diff --git a/drivers/net/nfp/nfpcore/nfp_mip.h b/drivers/net/nfp/nfpcore/nfp_mip.h index 371c635b97..7fa09ee575 100644 --- a/drivers/net/nfp/nfpcore/nfp_mip.h +++ b/drivers/net/nfp/nfpcore/nfp_mip.h @@ -17,6 +17,6 @@ const char *nfp_mip_name(const struct nfp_mip *mip); void nfp_mip_symtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size); void nfp_mip_strtab(const struct nfp_mip *mip, uint32_t *addr, uint32_t *size); int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id, - uint64_t *off); + uint64_t *offset); #endif /* __NFP_MIP_H__ */ diff --git a/drivers/net/nfp/nfpcore/nfp_mutex.c b/drivers/net/nfp/nfpcore/nfp_mutex.c index 61c491e07e..85c33502ca 100644 --- a/drivers/net/nfp/nfpcore/nfp_mutex.c +++ b/drivers/net/nfp/nfpcore/nfp_mutex.c @@ -35,7 +35,7 @@ struct nfp_cpp_mutex { }; static int -_nfp_cpp_mutex_validate(uint32_t model, +nfp_cpp_mutex_validate(uint32_t model, int *target, uint64_t address) { @@ -87,7 +87,7 @@ nfp_cpp_mutex_init(struct nfp_cpp *cpp, uint32_t model = nfp_cpp_model(cpp); uint32_t muw = NFP_CPP_ID(target, 4, 0); /* atomic_write */ - err = _nfp_cpp_mutex_validate(model, &target, address); + err = nfp_cpp_mutex_validate(model, &target, address); if (err < 0) return err; @@ -152,7 +152,7 @@ nfp_cpp_mutex_alloc(struct nfp_cpp *cpp, return NULL; } - err = _nfp_cpp_mutex_validate(model, &target, address); + err = nfp_cpp_mutex_validate(model, &target, address); if (err < 0) return NULL; diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.c b/drivers/net/nfp/nfpcore/nfp_nffw.c index b14a9bd852..b27a9fbaa7 100644 --- a/drivers/net/nfp/nfpcore/nfp_nffw.c +++ b/drivers/net/nfp/nfpcore/nfp_nffw.c @@ -31,11 +31,11 @@ nffw_res_flg_init_get(const struct nfp_nffw_info_data *res) return (res->flags[0] >> 0) & 1; } -/* loaded = loaded__mu_da__mip_off_hi<31:31> */ +/* loaded = loaded_mu_da_mip_off_hi<31:31> */ static uint32_t nffw_fwinfo_loaded_get(const struct nffw_fwinfo *fi) { - return (fi->loaded__mu_da__mip_off_hi >> 31) & 1; + return (fi->loaded_mu_da_mip_off_hi >> 31) & 1; } /* mip_cppid = mip_cppid */ @@ -45,18 +45,18 @@ nffw_fwinfo_mip_cppid_get(const struct nffw_fwinfo *fi) return fi->mip_cppid; } -/* loaded = loaded__mu_da__mip_off_hi<8:8> */ +/* loaded = loaded_mu_da_mip_off_hi<8:8> */ static uint32_t nffw_fwinfo_mip_mu_da_get(const struct nffw_fwinfo *fi) { - return (fi->loaded__mu_da__mip_off_hi >> 8) & 1; + return (fi->loaded_mu_da_mip_off_hi >> 8) & 1; } -/* mip_offset = (loaded__mu_da__mip_off_hi<7:0> << 32) | mip_offset_lo */ +/* mip_offset = (loaded_mu_da_mip_off_hi<7:0> << 32) | mip_offset_lo */ static uint64_t nffw_fwinfo_mip_offset_get(const struct nffw_fwinfo *fi) { - uint64_t mip_off_hi = fi->loaded__mu_da__mip_off_hi; + uint64_t mip_off_hi = fi->loaded_mu_da_mip_off_hi; return (mip_off_hi & 0xFF) << 32 | fi->mip_offset_lo; } @@ -224,7 +224,7 @@ nfp_nffw_info_fwid_first(struct nfp_nffw_info *state) int nfp_nffw_info_mip_first(struct nfp_nffw_info *state, uint32_t *cpp_id, - uint64_t *off) + uint64_t *offset) { struct nffw_fwinfo *fwinfo; @@ -233,7 +233,7 @@ nfp_nffw_info_mip_first(struct nfp_nffw_info *state, return -EINVAL; *cpp_id = nffw_fwinfo_mip_cppid_get(fwinfo); - *off = nffw_fwinfo_mip_offset_get(fwinfo); + *offset = nffw_fwinfo_mip_offset_get(fwinfo); if (nffw_fwinfo_mip_mu_da_get(fwinfo) != 0) { int locality_off; @@ -245,8 +245,8 @@ nfp_nffw_info_mip_first(struct nfp_nffw_info *state, if (locality_off < 0) return locality_off; - *off &= ~(NFP_MU_ADDR_ACCESS_TYPE_MASK << locality_off); - *off |= NFP_MU_ADDR_ACCESS_TYPE_DIRECT << locality_off; + *offset &= ~(NFP_MU_ADDR_ACCESS_TYPE_MASK << locality_off); + *offset |= NFP_MU_ADDR_ACCESS_TYPE_DIRECT << locality_off; } return 0; diff --git a/drivers/net/nfp/nfpcore/nfp_nffw.h b/drivers/net/nfp/nfpcore/nfp_nffw.h index f84be463c4..52e25c090a 100644 --- a/drivers/net/nfp/nfpcore/nfp_nffw.h +++ b/drivers/net/nfp/nfpcore/nfp_nffw.h @@ -38,11 +38,11 @@ /* nfp.nffw meinfo */ struct nffw_meinfo { - uint32_t ctxmask__fwid__meid; + uint32_t ctxmask_fwid_meid; }; struct nffw_fwinfo { - uint32_t loaded__mu_da__mip_off_hi; + uint32_t loaded_mu_da_mip_off_hi; uint32_t mip_cppid; /* 0 means no MIP */ uint32_t mip_offset_lo; }; diff --git a/drivers/net/nfp/nfpcore/nfp_nsp.h b/drivers/net/nfp/nfpcore/nfp_nsp.h index 7bf584dcd0..705574b900 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp.h +++ b/drivers/net/nfp/nfpcore/nfp_nsp.h @@ -231,9 +231,9 @@ struct nfp_nsp *nfp_eth_config_start(struct nfp_cpp *cpp, uint32_t idx); int nfp_eth_config_commit_end(struct nfp_nsp *nsp); void nfp_eth_config_cleanup_end(struct nfp_nsp *nsp); -int __nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode); -int __nfp_eth_set_speed(struct nfp_nsp *nsp, uint32_t speed); -int __nfp_eth_set_split(struct nfp_nsp *nsp, uint32_t lanes); +int nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode); +int nfp_eth_set_speed(struct nfp_nsp *nsp, uint32_t speed); +int nfp_eth_set_split(struct nfp_nsp *nsp, uint32_t lanes); /* NSP static information */ struct nfp_nsp_identify { @@ -248,7 +248,7 @@ struct nfp_nsp_identify { uint64_t sensor_mask; /**< Mask of present sensors available on NIC */ }; -struct nfp_nsp_identify *__nfp_nsp_identify(struct nfp_nsp *nsp); +struct nfp_nsp_identify *nfp_nsp_identify(struct nfp_nsp *nsp); enum nfp_nsp_sensor_id { NFP_SENSOR_CHIP_TEMPERATURE, diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c index 08f12f862c..429f639fa2 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c +++ b/drivers/net/nfp/nfpcore/nfp_nsp_cmds.c @@ -24,7 +24,7 @@ struct nsp_identify { }; struct nfp_nsp_identify * -__nfp_nsp_identify(struct nfp_nsp *nsp) +nfp_nsp_identify(struct nfp_nsp *nsp) { int ret; struct nsp_identify *ni; diff --git a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c index 837c9c6bbd..eea5cde426 100644 --- a/drivers/net/nfp/nfpcore/nfp_nsp_eth.c +++ b/drivers/net/nfp/nfpcore/nfp_nsp_eth.c @@ -241,7 +241,7 @@ nfp_eth_calc_port_type(struct nfp_eth_table_port *entry) } static struct nfp_eth_table * -__nfp_eth_read_ports(struct nfp_nsp *nsp) +nfp_eth_read_ports_real(struct nfp_nsp *nsp) { int ret; uint32_t i; @@ -332,7 +332,7 @@ nfp_eth_read_ports(struct nfp_cpp *cpp) if (nsp == NULL) return NULL; - ret = __nfp_eth_read_ports(nsp); + ret = nfp_eth_read_ports_real(nsp); nfp_nsp_close(nsp); return ret; @@ -480,7 +480,7 @@ nfp_eth_set_mod_enable(struct nfp_cpp *cpp, int nfp_eth_set_configured(struct nfp_cpp *cpp, uint32_t idx, - int configed) + int configured) { uint64_t reg; struct nfp_nsp *nsp; @@ -503,10 +503,10 @@ nfp_eth_set_configured(struct nfp_cpp *cpp, /* Check if we are already in requested state */ reg = rte_le_to_cpu_64(entries[idx].state); - if (configed != (int)FIELD_GET(NSP_ETH_STATE_CONFIGURED, reg)) { + if (configured != (int)FIELD_GET(NSP_ETH_STATE_CONFIGURED, reg)) { reg = rte_le_to_cpu_64(entries[idx].control); reg &= ~NSP_ETH_CTRL_CONFIGURED; - reg |= FIELD_PREP(NSP_ETH_CTRL_CONFIGURED, configed); + reg |= FIELD_PREP(NSP_ETH_CTRL_CONFIGURED, configured); entries[idx].control = rte_cpu_to_le_64(reg); nfp_nsp_config_set_modified(nsp, 1); @@ -572,7 +572,7 @@ nfp_eth_set_bit_config(struct nfp_nsp *nsp, * 0 or -ERRNO */ int -__nfp_eth_set_aneg(struct nfp_nsp *nsp, +nfp_eth_set_aneg(struct nfp_nsp *nsp, enum nfp_eth_aneg mode) { return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE, @@ -592,7 +592,7 @@ __nfp_eth_set_aneg(struct nfp_nsp *nsp, * 0 or -ERRNO */ static int -__nfp_eth_set_fec(struct nfp_nsp *nsp, +nfp_eth_set_fec_real(struct nfp_nsp *nsp, enum nfp_eth_fec mode) { return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_STATE, @@ -626,7 +626,7 @@ nfp_eth_set_fec(struct nfp_cpp *cpp, if (nsp == NULL) return -EIO; - err = __nfp_eth_set_fec(nsp, mode); + err = nfp_eth_set_fec_real(nsp, mode); if (err != 0) { nfp_eth_config_cleanup_end(nsp); return err; @@ -650,7 +650,7 @@ nfp_eth_set_fec(struct nfp_cpp *cpp, * 0 or -ERRNO */ int -__nfp_eth_set_speed(struct nfp_nsp *nsp, +nfp_eth_set_speed(struct nfp_nsp *nsp, uint32_t speed) { enum nfp_eth_rate rate; @@ -678,7 +678,7 @@ __nfp_eth_set_speed(struct nfp_nsp *nsp, * 0 or -ERRNO */ int -__nfp_eth_set_split(struct nfp_nsp *nsp, +nfp_eth_set_split(struct nfp_nsp *nsp, uint32_t lanes) { return NFP_ETH_SET_BIT_CONFIG(nsp, NSP_ETH_RAW_PORT, -- 2.39.1