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 7253E41E83; Mon, 13 Mar 2023 09:43:03 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0337D406BC; Mon, 13 Mar 2023 09:43:03 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam02on2054.outbound.protection.outlook.com [40.107.95.54]) by mails.dpdk.org (Postfix) with ESMTP id CCD7D40151 for ; Mon, 13 Mar 2023 09:43:00 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GUI4jCwUO9h5scR16t1zWQf6fsTO3Rd2tWk8kS72//bAUoX/PC7iE4jAmNqCH9X4YYnOK3ZAoWFPk4aB3DEoWRnLdYx9u/VRLKou4AFd4I9FEGqxFPABkXUF/RvSkmO1FywGyd3F/M1BV4PxmDEEcUmlyuUfapg4oR7P/1ztOXMT5pjMNpvHEGjSTCdxKM9RcLfrgyNIjfCFt/9qS8gsW48GoOjfpQhJE+vy/AYbx8sV5sv70MsIW5xKT//ie1mMYrZ2L/6A70DDSYZPmWURi766blXwbtdmPTLf2KvtslR9jlr1nlQw804MjIgaxyLy1+OP7GOtn2Krf+UfVF5mZA== 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=u41GTqYAVTg+z8qxu5xDjpBHXjCUjInrRu19TefW3M8=; b=c9oODVAmyzM4X+DhSk8xK8Aag9+XwMpZ2AyIUo4IaEJKY4rTmw6DNGSnvPDI01BijqG6Lanf07n8askegzEnihnLvagohBgLJmOMBoBVsJRGS0ukQ2J78N+XGMrLKQTHk7GA7QqQdad9ruld8kXwoSmLTYOuSCKZmhwAjwf4Rif4A+LSjk7P7xdmqEBhWhJPA63LPOuMYyZuFcP+t3K+vAGTN6d9VKVrcB0ohwT1HCejs+ohmZ+smlwcKlW6nkAd4jA49BiR95mZdRtufs823aIDhkS6Wml72qV7cg2Gy7UtfnVdpVYjdsLu2HT5m0+1ZoN4XPjmxBVHebImZJJ4dQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=u41GTqYAVTg+z8qxu5xDjpBHXjCUjInrRu19TefW3M8=; b=aW5ZnpUcG3iiwgcJwKWxyUsdyHxU7KbOpV+Jx64AoLIlYpsEPlS2ojTCypBVGbhKNQR1jYpmvQ7YFziXl/a/01bX/RuMm+AiLTjQlpRjqNpG7GN2i6NXrP9yGsmQFLKVTEdIvKibr/z6dcFCjXeN6hSfh2fEe7YrJ5nZTymscPE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by PH8PR12MB6698.namprd12.prod.outlook.com (2603:10b6:510:1cd::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.24; Mon, 13 Mar 2023 08:42:58 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%6]) with mapi id 15.20.6178.024; Mon, 13 Mar 2023 08:42:58 +0000 Message-ID: Date: Mon, 13 Mar 2023 08:39:44 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v2 2/2] net/nfp: write link speed to control BAR To: Chaoyong He , "dev@dpdk.org" Cc: oss-drivers , Niklas Soderlund , James Hershaw References: <20230221062955.34210-1-chaoyong.he@corigine.com> <20230310062542.817107-1-chaoyong.he@corigine.com> <20230310062542.817107-3-chaoyong.he@corigine.com> Content-Language: en-US From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: LO4P123CA0333.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18c::14) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH8PR12MB6698:EE_ X-MS-Office365-Filtering-Correlation-Id: f87fec58-52aa-4126-1500-08db239ef22a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: IDqw02TqZXrhDFbGQ5Fqeml05PRkJeaagE/16jszmvrmQPt55YquO3IpCn1zCEMba8feTDvLHAt5ZqrNVKk9pMYiDjcam+7oea6F/sPh2db9Xb0njvVd/SexpwvcP+WElsKDAVMOZtrRhFfTP44a415h6+25pBEkU/Fp9GVVyRN9JoLDifRdg8IRAT74MNc/PQL6kvExOM/xE/oIRHFGX5k5vysLKjxHSXYf4nHb6ErA65qLf8QKgmAcvM2wPNbdSbDReiWBQ+jTe7yrAzC0NnLtI8B5gOk4HEzaAwfNIcy5qF4/U+GAeJbSYnVIHeweF/KckuDlAzm7hay1ITXrmkhZxxIIx4AXy8IY8d1AIOw5Ga6qhjWG0LiEiUIHtsGqbtn8koAEiY/8MFSVH8URuzPK524/GwiMIIceZ/EiM3BLzqEvovFcrnOyuQdOA4JZTTGj1rmU3ZLK4eUcgNSLk5bjqWIotWgdFYEOQrdntn+Xl1lzkaElKUm/ysSzYgRZxEhjGe4xEtuOZWjfQyZoYTluE//zBEca+3rfjIOGsonRPBd8Y3Zd09s+yb7GvW86UNSFJS5W3A+qFQw2wzm401buA0vgA3Pzya6MfGtbk4CdXktH3rO0bBErHbE9hN9M04E3vw0MzL0vRBqMDzcioO2qemDn05fuEkNIMJyNaz5/f/fTNwPDi5lIXty3YgTN8CoYKzA44ssZze6WluKzhgTna92pcmx6kDkBnsPlBKc= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(376002)(136003)(346002)(39860400002)(366004)(396003)(451199018)(31686004)(4326008)(5660300002)(8936002)(2616005)(41300700001)(186003)(53546011)(6512007)(26005)(6506007)(31696002)(36756003)(86362001)(44832011)(2906002)(83380400001)(66476007)(6666004)(66556008)(8676002)(6486002)(66946007)(110136005)(316002)(54906003)(478600001)(38100700002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bXhiRUNCbHBJUE1YTXZsZXdpeFBkMW9la3MrU2pHSHEzZUY2ZTlDcGpvYndN?= =?utf-8?B?NC9oY1NJMGZNN3E0dVhrWDlobFJ2cEVJcGdhcWNPSlBvbDhxK29QUU90Zmll?= =?utf-8?B?SzN4NlUvSVB4MEticHhGb3ZqMnhoSkd2c2N0elRBY3I1QjRBS3Vxc2xkcTRM?= =?utf-8?B?Njl2UjhYY0xOVmhWVXNHUSttd29paU1DYjJVWFFBSm9rSUNzL1h6bnAycE9x?= =?utf-8?B?ZXgwcTRzMzlNa08wTmdjT0RHRXZKOUQ3Qkg4ZVhHSU5nQmhEUG1VQW5VbE9l?= =?utf-8?B?dm1Mam9XTi9DV1V1YzFRZENkM3Uvd2NDd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eSmeh1KqNaWkthI/AkmbaL4c?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f87fec58-52aa-4126-1500-08db239ef22a X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Mar 2023 08:42:58.0205 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: FeYR17WIwhlMqK0avpn3yXOvSDatykZwlckQRN8akTNxqoZNvfkqeRRGW5AiXdiU X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6698 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 On 3/13/2023 3:03 AM, Chaoyong He wrote: >> On 3/10/2023 6:25 AM, Chaoyong He wrote: >>> + /** >>> + * Shift and mask nn_link_status so that it is effectively the value >>> + * at offset NFP_NET_CFG_STS_NSP_LINK_RATE. >>> + */ >>> + nn_link_status = (nn_link_status >> >> NFP_NET_CFG_STS_LINK_RATE_SHIFT) & >>> + NFP_NET_CFG_STS_LINK_RATE_MASK; >> >> Thanks for extensive commenting, perhaps this is the source of confusion, I >> can't see how above logic makes effectively the value at offset LINK_RATE. >> >> NFP_NET_CFG_STS_LINK_RATE_SHIFT = 1 >> NFP_NET_CFG_STS_LINK_RATE_MASK = 0xF >> >> NFP_NET_CFG_STS = 0x34 >> NFP_NET_CFG_STS_NSP_LINK_RATE = 0x36 >> >> nfp_net_notify_port_speed() >> uint16_t speed; >> *(0x36) = speed >> >> nfp_net_link_update() >> uint16_t val = *(0x34) >> val = (val >> 1) & 0xF; >> >> >> How come 'speed' and 'val' are same value? >> >> Either there is a mistake or FW is making something in the background, I am >> trying to clarify this in past few comments but not able to yet. > > Yes, here FW does do something in the background. > ---------------------------------------------------------------------------- > > 16 bit write only 16 bit read only > > | x x x x x x x x x x x x y y y y | x x x x x x x x x x x y y y y x | > > ^ ^ > > 0x36 0x34 > ------------------------------------------------------------------------------ > The firmware confirm that whatever write into ‘yyyy’ field of 0x36 can be read from ‘yyyy’ field of 0x34. > Thanks, I was looking for this, I am progressing with the patch.