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 6AA4642910; Mon, 10 Apr 2023 13:01:18 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3D3EE42BFE; Mon, 10 Apr 2023 13:00:59 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2128.outbound.protection.outlook.com [40.107.243.128]) by mails.dpdk.org (Postfix) with ESMTP id 827EA40DDC for ; Mon, 10 Apr 2023 13:00:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dDb9Aw1m38uGaAD5U70lIyfdweVkdfBLqYl9LsCyRIOibtQgOlc5aHFHoeNofSL1TGn/S+ifAfxU2rrXPGMIi7MVAjWQa/56kitKCATAea4jNaLDeTS++0mSHSbxUz9f7ClzfDu6stItapKd6F8CVtIDtXVsvWhJMD/o/AMePbY+TL3oPhLr4n3NL+DCKzSJGj3HXI4BX3ek9xixkM9RYUmwKQ4Wqla9aFnDTC737dfJiQc3N4I/PB17RQo/JZ7GUnilTEHZaVckzwjQVPYfb9xMiV3ef6QtnX3/Coab1NqNUALJkzg9Ma325AswopoUC4Ewo+elupIIS9mnHs8WZQ== 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=SR/BNmdhwtj+WJF//xgMhM/cNvNtL2SBlFGCX2Znr2o=; b=FGdKOl3I9j35a15cBR/ATUeoFb9NJ9gcy1W5J6xrM4E6vrfGAhfPPfcsQtFGJG5UBUEZFippAME7E6fgWiqkhZoFUlOkYJu97B4H7q3zOA0K7uU7FduvXpU1qi3oTmRHgdmflGvFKtfBAWt1FZSqYOkmtHPHRhuHOsQQHVsiLzYxq3O/USfkgAnBbyXGbqfJlhLE28UxzXrpaHeKFB9oV2YrfM8ih/d4EySNUaEY8gBcJMlmkR2J5TQC+DM8Wcp3y3XwBOTPecOkTECN5gdMkC9VUmq4vKk4geBLWZrzzRUIUUBDztDLN2pLuOMnHz/FQiiNp3A4ByPusKvf5OLlRA== 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=SR/BNmdhwtj+WJF//xgMhM/cNvNtL2SBlFGCX2Znr2o=; b=v3PE5dFqpOXHO9Bkkk1WGwAsKI2M5yyy/xMzeqTD1sGAtgLrR7NPffVspr6MddgUWnVzYS2DnUbsrXZV9irnWP/RH/4bOm5JA6PRoEEzNrbLg3S43WMedGTxxzIFtxG/vr7dcOlsTsegjxAUO+2tdV63uLuPQjnU2/XQJ/SaKEA= 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:54 +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:54 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, Chaoyong He Subject: [PATCH 03/13] net/nfp: remove the redundant macro about CPP target Date: Mon, 10 Apr 2023 19:00:05 +0800 Message-Id: <20230410110015.2973660-4-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: 4e1e19bf-76df-453d-bf28-08db39b2dad9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: uHK0e+LMyZCqrOes7QuU5+v/0dOBW3+/43gDNcD32KPm1TeiYm0YvkscDhiBkZMOO5QwV1aKNnu0jfAYImYo0qVSqX9Td3cLlJMhrkFtOdqf0ils2GspcVFdZnJkdwYUM1MkC05RNRXkYBqL7dDtf4y3YjYaarr+rDZhw3t6bjPtVqYLZbVawuykZ+e1ys1d806wcLvPFYUlVRVvb1c8MJVgqjYP8gBvZGyXvY357LCKj6qSQxG+3ba+9tNruwVE9KfvyN5xrRsUo3s1z9bZg9vtTXKm8Sq30L/s8nXBfCSU6Xo8yV1888WPNJ1XaAnxm2EgMQO1FS3bMcEJSVGZqhGUW4tj1KYWnUCwnbNZ+7143Qhss/nGtJXQpnmEmmXKN0TyKhNkKWCKT5l6omU6GWnNKTjQaAIJJsHr/099d/qGUklvin3PJHHY3EJJiw8pxtmKtk53F/zzyAB0tY/X52Ey8RNIQfuzgY9pwJCn+ccVkcU4Qv40CgFon55faD3WwZ+IIJBLXxQ6NjjSeSqQcu25Fb9dINLA4ldqmfuG4we2Na7Z9m3aDOC2ktB3q25rfL1OrF2tUcA0y2cI7dNApjz44g8pJHN0Ldnhep1I1BLfEefuKCk1Bs1myjMoqFtG 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)(6666004)(5660300002)(6486002)(44832011); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?RkpDdGJlVDNSQ3BrN3hoSVpEdGpLRWIzV0NGTk5yeWRXWHZPSy81REhIaXJX?= =?utf-8?B?akl0UUtSTmxNVVhES0l3QVJxUUJuSk51djdkR0hQR2xDaEYyKzJRajljSmNi?= =?utf-8?B?NzZldVdGZWVEZXJjU1lkTzhvQ0w1ZWdVYkR5VUw5MTJzRU1kbXRjdUkyNmF4?= =?utf-8?B?YU1hNkwwWm94ZW1LdWVNTXo0Q1c4L0ZOb3JvTVBaMlVacmV1aXZ2Q0Y2TkxJ?= =?utf-8?B?ZlVsNTMrblNDdEx4bGVaSngyN2NkN0VQaERzNXlsOGxUdkRPS3dVeEJKS053?= =?utf-8?B?cG1RVGFjMHU1c3gzcEkzSnBFcmU3OVArLy82SU55c0U0SWVqRTBXVmkycFlN?= =?utf-8?B?NHVlY3Y2R1ViREpwbkpaL1ArOTI5M3hBOGJaaTZ1K0N1dFh0cU53M2tWWWdl?= =?utf-8?B?OT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ange-CrossTenant-Network-Message-Id: 4e1e19bf-76df-453d-bf28-08db39b2dad9 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:54.3834 (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: te6nfiuHYBvvlCQDYfWHL+GkCe74ZvnDG8puQMrGkOWzXD8iep0jBF7jBIzHHYSMyyObCloLBs2He/dDivmsK+nOi7iJpxy8vz6pXpb/Ltg= 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 Remove the redundancy define NFP6000_CPPTGT_ in nfp_resid.h, the same define NFP_CPP_TARGET_ are exist in nfp6000.h, we choose to keep them to sync with the kernel driver. Signed-off-by: Chaoyong He Reviewed-by: Niklas Söderlund --- .../net/nfp/nfpcore/nfp-common/nfp_resid.h | 11 ----- drivers/net/nfp/nfpcore/nfp_target.c | 44 +++++++++---------- 2 files changed, 22 insertions(+), 33 deletions(-) diff --git a/drivers/net/nfp/nfpcore/nfp-common/nfp_resid.h b/drivers/net/nfp/nfpcore/nfp-common/nfp_resid.h index 394a7628e0..ac2bf0335d 100644 --- a/drivers/net/nfp/nfpcore/nfp-common/nfp_resid.h +++ b/drivers/net/nfp/nfpcore/nfp-common/nfp_resid.h @@ -48,17 +48,6 @@ #define NFP_CHIP_REVISION_C0 0x20 #define NFP_CHIP_REVISION_PF 0xff /* Maximum possible revision */ -/* CPP Targets for each chip architecture */ -#define NFP6000_CPPTGT_NBI 1 -#define NFP6000_CPPTGT_VQDR 2 -#define NFP6000_CPPTGT_ILA 6 -#define NFP6000_CPPTGT_MU 7 -#define NFP6000_CPPTGT_PCIE 9 -#define NFP6000_CPPTGT_ARM 10 -#define NFP6000_CPPTGT_CRYPTO 12 -#define NFP6000_CPPTGT_CTXPB 14 -#define NFP6000_CPPTGT_CLS 15 - /* * Wildcard indicating a CPP read or write action * diff --git a/drivers/net/nfp/nfpcore/nfp_target.c b/drivers/net/nfp/nfpcore/nfp_target.c index 3f7ddfb5e9..611848e233 100644 --- a/drivers/net/nfp/nfpcore/nfp_target.c +++ b/drivers/net/nfp/nfpcore/nfp_target.c @@ -489,26 +489,26 @@ nfp_target_pushpull(uint32_t cpp_id, uint64_t address) { switch (NFP_CPP_ID_TARGET_of(cpp_id)) { - case NFP6000_CPPTGT_NBI: + case NFP_CPP_TARGET_NBI: return nfp6000_nbi(cpp_id, address); - case NFP6000_CPPTGT_VQDR: + case NFP_CPP_TARGET_QDR: return target_rw(cpp_id, P32, 24, 4); - case NFP6000_CPPTGT_ILA: + case NFP_CPP_TARGET_ILA: return nfp6000_ila(cpp_id); - case NFP6000_CPPTGT_MU: + case NFP_CPP_TARGET_MU: return nfp6000_mu(cpp_id, address); - case NFP6000_CPPTGT_PCIE: + case NFP_CPP_TARGET_PCIE: return nfp6000_pci(cpp_id); - case NFP6000_CPPTGT_ARM: + case NFP_CPP_TARGET_ARM: if (address < 0x10000) return target_rw(cpp_id, P64, 1, 1); else return target_rw(cpp_id, P32, 1, 1); - case NFP6000_CPPTGT_CRYPTO: + case NFP_CPP_TARGET_CRYPTO: return nfp6000_crypto(cpp_id); - case NFP6000_CPPTGT_CTXPB: + case NFP_CPP_TARGET_CT_XPB: return nfp6000_cap_xpb(cpp_id); - case NFP6000_CPPTGT_CLS: + case NFP_CPP_TARGET_CLS: return nfp6000_cls(cpp_id); case 0: return target_rw(cpp_id, P32, 4, 4); @@ -719,7 +719,7 @@ nfp_encode_basic(uint64_t *addr, switch (mode) { case 0: - if (cpp_tgt == NFP6000_CPPTGT_VQDR && addr40 == 0) { + if (cpp_tgt == NFP_CPP_TARGET_QDR && addr40 == 0) { /* * In this specific mode we'd rather not modify the * address but we can verify if the existing contents @@ -737,7 +737,7 @@ nfp_encode_basic(uint64_t *addr, *addr |= (((uint64_t)dest_island) << iid_lsb) & value; return 0; case 1: - if (cpp_tgt == NFP6000_CPPTGT_VQDR && addr40 == 0) { + if (cpp_tgt == NFP_CPP_TARGET_QDR && addr40 == 0) { return nfp_encode_basic_qdr(*addr, cpp_tgt, dest_island, mode, addr40, isld1, isld0); } @@ -757,7 +757,7 @@ nfp_encode_basic(uint64_t *addr, return -ENODEV; case 2: - if (cpp_tgt == NFP6000_CPPTGT_VQDR && addr40 == 0) { + if (cpp_tgt == NFP_CPP_TARGET_QDR && addr40 == 0) { /* iid<0> = addr<30> = channel<0> */ /* channel<1> = addr<31> = Index */ return nfp_encode_basic_qdr(*addr, cpp_tgt, dest_island, @@ -777,7 +777,7 @@ nfp_encode_basic(uint64_t *addr, return nfp_encode_basic_search(addr, dest_island, isld, iid_lsb, idx_lsb, 2); case 3: - if (cpp_tgt == NFP6000_CPPTGT_VQDR && addr40 == 0) { + if (cpp_tgt == NFP_CPP_TARGET_QDR && addr40 == 0) { /* * iid<0> = addr<29> = data * iid<1> = addr<30> = channel<0> @@ -924,19 +924,19 @@ nfp_cppat_addr_encode(uint64_t *addr, uint64_t value; switch (cpp_tgt) { - case NFP6000_CPPTGT_NBI: - case NFP6000_CPPTGT_VQDR: - case NFP6000_CPPTGT_ILA: - case NFP6000_CPPTGT_PCIE: - case NFP6000_CPPTGT_ARM: - case NFP6000_CPPTGT_CRYPTO: - case NFP6000_CPPTGT_CLS: + case NFP_CPP_TARGET_NBI: + case NFP_CPP_TARGET_QDR: + case NFP_CPP_TARGET_ILA: + case NFP_CPP_TARGET_PCIE: + case NFP_CPP_TARGET_ARM: + case NFP_CPP_TARGET_CRYPTO: + case NFP_CPP_TARGET_CLS: return nfp_encode_basic(addr, dest_island, cpp_tgt, mode, addr40, isld1, isld0); - case NFP6000_CPPTGT_MU: + case NFP_CPP_TARGET_MU: return nfp_encode_mu(addr, dest_island, mode, addr40, isld1, isld0); - case NFP6000_CPPTGT_CTXPB: + case NFP_CPP_TARGET_CT_XPB: if (mode != 1 || addr40 != 0) return -EINVAL; -- 2.39.1