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 4D68E41E29; Fri, 10 Mar 2023 07:26:21 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CE1BE41140; Fri, 10 Mar 2023 07:26:16 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2139.outbound.protection.outlook.com [40.107.92.139]) by mails.dpdk.org (Postfix) with ESMTP id 29AD940A81 for ; Fri, 10 Mar 2023 07:26:14 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QKwJ+GSLBHmp5BO14KDmWzGK3cdnXdfF7PgIw5s4s2yFDmXvHCpPx189sZmPVvIgXM7y0MlKQT6HxDaVU1IkrH++P3Ffu1rvnVbbBr8+wA9CQczC4c272Pt2Qp8fksDnH9T0pTu6WFWmq6ajIntcxCTCGf7SgLXRpTzqHXzWtFMuG2ok/pRVrnLWOutsWbZbwJj7O27vsTZ2fq8einpUjqVnpyQeGowlGnE1t2fhUieK9qdDdyY/lIpji/gkPAiogc7XQFjKzgTRfJB5kDLOCHlBWHhB/KuJ70WehfOG4YosHwV+2PnbCc9tAedlP3fZD9W4Kn5IHk/ccUbVo+VcKg== 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=+7c/6smN0e0M2AhHS/WGgmrpXLOjF4uABUe34Y6Acjw=; b=VDybU6rcnE+4qcSgIZxpBaE5xVWXfgLvnpgGavQqV/2QyOdLJU8al/AD5wBfpAlKDWujeg9NRAXqB5rFtQkEWosoZDqhrenlK9+nTVVHNmYFC+/9SUJDTASM3MPzZq4d1MzQgJdg6xJLM1SZK1saj3LehwF5m+LkSgfkGC+i6HX1asDvRoH7tKtEjbWFy2O2oEHZZ30+F/pdg/jWnEq/bRcFqjM+1uabnu1QA4TECaErsStisquPfYeoSbRloNffHClLcGd/quLBEslg+s6xjpf3yPd6PiXOJQmBaal/DTmUKi8D9fQjwRj14DGSaQHBqDYrmO1SyiUuriq/sZ0OEw== 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=+7c/6smN0e0M2AhHS/WGgmrpXLOjF4uABUe34Y6Acjw=; b=BPKBS1ZKE4dLRHyIJaej/rWTX1iY0bxsqU+TzcRGxvWt9j+9THdlrWWHEkYm4z/W8LXlwkomHo4KF7f780VSZpnYly/EdvkFCZMwAPq+SHtxK33NPgv8PBmMvjd7t/tfVfIYHLPbDTJ3m4D5V4SGby8OvO8t473OfO+7jwLQ6ok= 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 PH7PR13MB5913.namprd13.prod.outlook.com (2603:10b6:510:158::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.17; Fri, 10 Mar 2023 06:26:13 +0000 Received: from SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b19d:4343:f34f:a817]) by SJ0PR13MB5545.namprd13.prod.outlook.com ([fe80::b19d:4343:f34f:a817%3]) with mapi id 15.20.6178.017; Fri, 10 Mar 2023 06:26:13 +0000 From: Chaoyong He To: dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, James Hershaw , Chaoyong He Subject: [PATCH v2 1/2] net/nfp: add helper functions for read/write 16b values Date: Fri, 10 Mar 2023 14:25:41 +0800 Message-Id: <20230310062542.817107-2-chaoyong.he@corigine.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230310062542.817107-1-chaoyong.he@corigine.com> References: <20230221062955.34210-1-chaoyong.he@corigine.com> <20230310062542.817107-1-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: SI2PR06CA0007.apcprd06.prod.outlook.com (2603:1096:4:186::9) To SJ0PR13MB5545.namprd13.prod.outlook.com (2603:10b6:a03:424::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR13MB5545:EE_|PH7PR13MB5913:EE_ X-MS-Office365-Filtering-Correlation-Id: c819aa4e-1d4c-4e05-dcce-08db2130585f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YZDJFBu0enLXzVdTIcBXj3jj7VCNCxx2zPUWWsRLHNzYrLfiz55Si4Ez7ivn8u3gC34dQf8xyS/FR/xdgHLcTGbHkgjdBxCWRublFBV6ocMfgPP8ZWmf3do9XLSbJoz9ArtxMitqqWC8FDwE4XWzxwX3ux2Aey6maCR6Tp1KZPu6QgQMLwbXam5r0suhIUcgZNOKoJQzg/1BrTMgcI7FDaWTAFUykSC237CVzNF8A6scm0GzxuDkmygN4OFtzzNW2dH4Jpj/ftNQRhwHRWGF+soNmkTKWjHpFdk3CUY4li1yIETJalqprX179K9D+rk04pZzmQ9UPyc3m5LSNA7EJ5xqFIBRPjPHDNkLeYQu8r5yHKyIjTEowsYdh6LDfPatgBZxjqiulOkGa1qZe22/w+LH26A+1CxDxJoB5CI7BNFZOxnStE6QI5u1mvMYOUOcEJQTCaKOQe35C/bZVJ/4qx8qo3CDxSiBbW7392BeKLKdwRjNPhgg4Y6JSKWBF/vOPcCLgvy4wuCUE3LB7ncsoNMl7Ir7n4ken3Vo8f8Qw/4KFx8zfhdrXWg4Ux4i2WWonCT/YFGxgBRTcQA1A2FRrg7YGEc9fGXMtLdwM/lRdb5rbswfZeXq76AW4mTBUS8j7SY3T6sQVCtuzfBhDj76fu6IYZ8S7CGDBCOaUdPnmg0/jkVi3BtzboRiVTh9DxtF7uJWKuDnuV8+IYn38aA5/w== 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:(13230025)(4636009)(346002)(366004)(39840400004)(396003)(136003)(376002)(451199018)(54906003)(36756003)(478600001)(44832011)(66476007)(107886003)(6486002)(52116002)(316002)(5660300002)(8936002)(2906002)(66946007)(66556008)(6916009)(8676002)(4326008)(41300700001)(1076003)(6512007)(38350700002)(38100700002)(86362001)(186003)(6666004)(2616005)(6506007)(26005)(66574015); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?L2xRc25hVWZRNHVIKzdHOHcyYTJtU3VOQXVSQlVNcTJRNzFKM0tNblgvS1Vl?= =?utf-8?B?d1NZOE4zSEFiQ0I1aW1GRXpHL3Q5WHplc2RUWFhtTWZIWlNUd0lHMS8wU09M?= =?utf-8?B?dFBWYTdnNnY5U2dsMU5xSzMrdE8yVlQremlPQ0l5UVRyTnRIMUVtQTBwekRt?= =?utf-8?B?VzZDZVRMc2dxWlBzaXJEejFkdzBYMU5URkNqMUZoM0krL2JkR3VSMy9HS3Fu?= =?utf-8?B?RWV1Q2xkQnFBSHhRS1htOEFJSEFPd0wvdlA0NVdSYnk5YklSZjFDbFZCTVdv?= =?utf-8?B?MWNiRDhmZWJDWVBwemY2VXMvTkxNekxVR0ZHZGdyM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RURVZmQUpaMXJwSWlxc3VRTlI3NjBVRVBYbDB3NjlS?= =?utf-8?B?Zmc9PQ==?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: c819aa4e-1d4c-4e05-dcce-08db2130585f X-MS-Exchange-CrossTenant-AuthSource: SJ0PR13MB5545.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 06:26:13.0693 (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: zYPbZ7YUCd/pSk9i7OkY4Jry+HEpSPDA4y9F5qWS7tL5EFVVJZredTQ/oaf9hK6iQPxRgsp0d+MXpEjy4L9qLrqf92OpsmAr0AHJPRYEXrE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR13MB5913 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 From: James Hershaw Expand the selection of read/write helper functions to include values of 16 bits. Signed-off-by: James Hershaw Reviewed-by: Niklas Söderlund Reviewed-by: Chaoyong He --- drivers/net/nfp/nfp_common.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/net/nfp/nfp_common.h b/drivers/net/nfp/nfp_common.h index 4486ffa72c..3a8b023c75 100644 --- a/drivers/net/nfp/nfp_common.h +++ b/drivers/net/nfp/nfp_common.h @@ -283,6 +283,11 @@ static inline void nn_writel(uint32_t val, volatile void *addr) rte_write32(val, addr); } +static inline uint16_t nn_readw(volatile const void *addr) +{ + return rte_read16(addr); +} + static inline void nn_writew(uint16_t val, volatile void *addr) { rte_write16(val, addr); @@ -321,6 +326,18 @@ nn_cfg_writeb(struct nfp_net_hw *hw, int off, uint8_t val) nn_writeb(val, hw->ctrl_bar + off); } +static inline uint16_t +nn_cfg_readw(struct nfp_net_hw *hw, int off) +{ + return rte_le_to_cpu_16(nn_readw(hw->ctrl_bar + off)); +} + +static inline void +nn_cfg_writew(struct nfp_net_hw *hw, int off, uint16_t val) +{ + nn_writew(rte_cpu_to_le_16(val), hw->ctrl_bar + off); +} + static inline uint32_t nn_cfg_readl(struct nfp_net_hw *hw, int off) { -- 2.39.1