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 15F1741E64; Fri, 10 Mar 2023 12:16:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EDF8540A81; Fri, 10 Mar 2023 12:16:37 +0100 (CET) Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2072.outbound.protection.outlook.com [40.107.220.72]) by mails.dpdk.org (Postfix) with ESMTP id CEB1440685 for ; Fri, 10 Mar 2023 12:16:36 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b2n1pfKz1SS5uJTBNGXtdRqXt3piiRQ2GjfURlQMteAB41c6QbcHgNLVrrYn/W56kMlQsqsVyVn6WHCyGhFQDTOhHNoOzLoalDslQMJAoKLDnN2GsuMFUEj3Hr8hPiAaz1QiC8VILZ0u0b28tji2//CfZYkaSMPtBxa0K3R4S2QngvoxsSmy+IZ6mzqprAu/NUFnNOxR57suHat1FOi4AYyjBK/UriJVbv0XFCJEu4lyMMqx08dvYNPtAfcBplBPSztjMTQdGpFRbePDezH+6QqC+28Cw3u/kXg8S2oVvejd6ppQoQX0ae7LEBGLYO7KzZOgnaLlBJUOa+Xw22txvw== 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=251gwxClgu9dNoMZ83ebk6FQG4pOy13CjpPBkmUWWuY=; b=I3XkUfJ+fQvlpGz9Vqto+/SMa2tpWGj8lz1eiqFbh24Frg65exV4+WnhHjW7iMcuvWMUWtpTVbmTEwMZzVIo+uT3Vcuc1Yhgotn/wyYjVC1HJqMVQwEz0xsHyDo0KutLTX8tFdzXJR8ZaTvYGFe+ZlTznLyvFv/Me/gTeIofYU4tN6BSwz3UwiFGKkVtLYEcCMg+S8eL/Jm18hlsQNnHogdeJ1bSGz/UT78cjJJBOny6+bpOuu4S8DMKg7Mb25WMg17VQyKgmyxgwGpxaKMA9nz+mF5+203H/KwRQsIQ9OssNvBOelPAAjaepbkRx+jWjLqrYuKG+TVsycVfnd62qw== 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=251gwxClgu9dNoMZ83ebk6FQG4pOy13CjpPBkmUWWuY=; b=zbCOFs7kKhhZUDoq9h5KJr3ok9cd2GQ/Urelavv0YsNAz4wK0cO0EW/K/D1JVMUkLA9YjfsgVg7iy5gExXrv08HXGQkLYyK62YfBDSfS3c/8Zf5nsaHnYSV1vWXnbffYKxV21E4lG27J4aacvT6WS5NFkKB75FO2m7rQ31ZDa3A= 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 SJ0PR12MB5472.namprd12.prod.outlook.com (2603:10b6:a03:3bb::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6178.19; Fri, 10 Mar 2023 11:16:34 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::dd5a:8a5c:f493:9640%5]) with mapi id 15.20.6178.019; Fri, 10 Mar 2023 11:16:34 +0000 Message-ID: Date: Fri, 10 Mar 2023 11:15:34 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: Chaoyong He , dev@dpdk.org Cc: oss-drivers@corigine.com, niklas.soderlund@corigine.com, James Hershaw References: <20230221062955.34210-1-chaoyong.he@corigine.com> <20230310062542.817107-1-chaoyong.he@corigine.com> <20230310062542.817107-3-chaoyong.he@corigine.com> From: Ferruh Yigit Subject: Re: [PATCH v2 2/2] net/nfp: write link speed to control BAR In-Reply-To: <20230310062542.817107-3-chaoyong.he@corigine.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0283.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:195::18) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ0PR12MB5472:EE_ X-MS-Office365-Filtering-Correlation-Id: 18b3ce04-d69d-4e9a-0ab4-08db2158e875 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0tEtZhdVex78qwBKRIh7H/G82g+4x4DOC5cThdyR0ceECqLUmUGGUHa90dR5gP2CXMFLcHLyIgBHkvWcVqp2QlcriSSFwxK/SVA9DgWWX4r5i/bw7Y28qDmIKDHv//RS0uTWH+eF27lmQRxLg+UiPlebFLTtWSY7lw6d2jgYLEu3PhDJvctG6sWL39S6uC9uO4ZXi6gKVF3houD+lIxbYVFoLmokRhSIwEZCypIr0TJBWL53PZonNYH7Fn76Zp/Z8ng8aL7+O+nrkZQ3lWyE3u+o8PlcvRtogksWUfS5anN+WklWpxFW5DYbnER9B0wXpfypwEl0F24CskoBxbCGlEdoBFWXOg3fIEJGDCv06Iwb5bXBonNA8m/jzflvUGS4cImMaLbRUvWNksNJ91KUn7a94uDrVVUhhUzEdFeFZZacU+8j7u1ahhz6Jo2DpPZz1l3T/ZRis8hd5LV3jEmPYaqaQX5n0tl8lkHo1WmitkmA8DPjpetV3g8QLzswIXRmMwnfUJIFpvmNUYgT++E7szp6jOduD0ejhQ/n6ruSHJrXK/to0aXNaXQ1ZI9Vv22heKfNMatpY4jkjJUvfTq2PytPY+z4B+Nv7RiO/NNgyXh3PhTP6fjTFAx9Ka6Wfpczb6zPYJPetaqAoBcM5KbOK8um0Z9h2yx9+XeEyhflbNSPJ8Do1+ltMMYwyMzwNHiQJgbJ02JAeDfOEoewikH4JxEYSL6d9NsRej2G2yAmme0= 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)(366004)(376002)(136003)(39860400002)(346002)(396003)(451199018)(31686004)(83380400001)(36756003)(478600001)(316002)(38100700002)(2616005)(6486002)(6512007)(6506007)(186003)(53546011)(26005)(2906002)(8676002)(44832011)(4744005)(66476007)(31696002)(66556008)(66946007)(8936002)(41300700001)(5660300002)(4326008)(86362001)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?d2FrYnNpdGFibG1WaklxNmxnQS9CZ21vVUdiMWpkOTV6OW9VSHlpVS9KUDNk?= =?utf-8?B?OHdGbEhLUEhhdnVUeW9QNVh1Y2xBT1BHMlE4L1BrRUQ5alBnREQxZkJQNnhq?= =?utf-8?B?cG96cGtsdUN5WEQ4SytZTVg3UWFTR3ZHYVA0OFJjNzVIZjJTTGFXb3FIbzg5?= =?utf-8?B?b0hqaUZSZGU0LzR6MlUxTmxvL281SVBrUWJmWXpZNytPUWdlMFZFL3BLTXBC?= =?utf-8?B?UnJ1MGtDQnN2ajhhTExleVlKRDUxeHhhRjJ4akVMZldtbWxXYjM1MlAvQVRz?= =?utf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LZjNOVHAwZm1qRytY?= =?utf-8?Q?Ve7nsKX1mfC+HbJcAU4OY3fPc?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 18b3ce04-d69d-4e9a-0ab4-08db2158e875 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2023 11:16:34.5755 (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: 3lf9XYquHLa9KTEMpEUml8Oc7jjWFOzlEhKlksrEP+srStk0CO5Vkr161QEEii0P X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5472 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/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.