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 450B7A00BE; Mon, 16 May 2022 16:05:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DFAFE40A7D; Mon, 16 May 2022 16:05:37 +0200 (CEST) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2057.outbound.protection.outlook.com [40.107.92.57]) by mails.dpdk.org (Postfix) with ESMTP id 709E240A7A for ; Mon, 16 May 2022 16:05:36 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hq5KcNmMg1WEx3MFTnoDH7L9RDsGPKqKZ1Lji/3D9r13oSizQ45gXSR8ml8sKf9Nbbh+h28YLTRTghGBBGy9Ebb3VDdCGgdjvddcs0oO1lH0qGcJrXVYyl9vU0B4XiaSMgGueNRjIO94mlrmVmSOV4o0lfvtWuTFr7pADxbri9mcyhyOTYuFyNVeoRhQRw8c5tOFaPP2uqwwrn3z1pmSx3N5QsCMLOLiLarxdVstqKcnrZufT1Wa2mamzk+VycQ3XpihPe9YzPh0+n0BVYvv4x4yfTiCsZJ8kDWOWRxJ7EPH3c5OQSEcWqZOIuwjIEua2QRZ/ChqXzKU1pSo9QNScQ== 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=izeL/bnMKumRcbbCuGou3DUAiat25ijLG9SJ89Solv8=; b=lXOYCopeGLOCYjjuzaSb0l5bnBiMaeloN3xnt4gLOT7IyIjNdV9lXMiJSEyCu+Sq5/Cf3pb3eSHDi42OTYoeAU0HLB8BGztnGFXxP86VUjU6hv27QbXCFglUyLd19DcmfbgRGLjLG7CWEZaKmhVaP0RhxYL7sWu3k4GQLMXrwr/+MS0kzAXu7ITUDfGklsbd8304C44sTEHBP25FipLQxiIJP8s3udHqKz9B2jAJRjgyetth4Ev2vAYloZYuVQuT1X5xnJFARRU+60D6L2brkxWCwaEw9IRxeKcQEjTZ/u71EbNEMfGq4yxllzh8IlLR7EnGcGi91Dw2UizN9TWRPw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.80.198) smtp.rcpttodomain=chelsio.com smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=izeL/bnMKumRcbbCuGou3DUAiat25ijLG9SJ89Solv8=; b=Yc5uxUsvo9v3dHANXuy9719M3kDQGIgv/HzS5sPc0sVSITs5qKCRFCGmz/1UrcDM3Sw/cJ967ofNwIIwM9CLG3H4e3nUyHFqe8Dgbn48ZflNaQ2/QmE45JIGI10yU5bPxRSF8oYTV076P9QwtbWSlAJIYI4LX1zV/JxT5MTnd1M= Received: from SN6PR2101CA0021.namprd21.prod.outlook.com (2603:10b6:805:106::31) by BL0PR02MB5699.namprd02.prod.outlook.com (2603:10b6:208:80::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5250.13; Mon, 16 May 2022 14:05:34 +0000 Received: from SN1NAM02FT0047.eop-nam02.prod.protection.outlook.com (2603:10b6:805:106:cafe::76) by SN6PR2101CA0021.outlook.office365.com (2603:10b6:805:106::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5293.3 via Frontend Transport; Mon, 16 May 2022 14:05:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.80.198) smtp.mailfrom=xilinx.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.80.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.80.198; helo=xir-pvapexch02.xlnx.xilinx.com; Received: from xir-pvapexch02.xlnx.xilinx.com (149.199.80.198) by SN1NAM02FT0047.mail.protection.outlook.com (10.97.5.120) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5250.13 via Frontend Transport; Mon, 16 May 2022 14:05:34 +0000 Received: from xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Mon, 16 May 2022 15:05:32 +0100 Received: from smtp.xilinx.com (172.21.105.197) by xir-pvapexch02.xlnx.xilinx.com (172.21.17.17) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Mon, 16 May 2022 15:05:32 +0100 Envelope-to: rahul.lakkireddy@chelsio.com, dev@dpdk.org Received: from [10.71.119.205] (port=61530) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1nqbLo-00052J-Ap; Mon, 16 May 2022 15:05:32 +0100 Message-ID: Date: Mon, 16 May 2022 15:05:32 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [PATCH v2] net/cxgbe: read firmware configuration file from filesystem Content-Language: en-US To: Rahul Lakkireddy CC: References: <1fa943f9b1b63260b093448f6d8fab58b7aa523d.1652691839.git.rahul.lakkireddy@chelsio.com> From: Ferruh Yigit In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 16d513f4-84ab-430d-71dc-08da3745253b X-MS-TrafficTypeDiagnostic: BL0PR02MB5699:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qdEVoL172ZH7NvIMW6OMUV4CubH6b+UwC7QgB7ZTj8OA/LBbFv/uIum8K/QGjHklSX0eF6XNbDPhWXC4FqBZdzTtfgrxLVrZ+Grmtfj9lEP1VhjgwRUs17JeCxmIbbvpgp+ortGPK2fW3Qxg1NxgeZ+HhjjYm/VwAdpfktd9zFTKX+eXSquJML5c7Rk+KjluL58if3dNVc4Jg7t4naT0rVBAK6cIAlvE68VqR+QFxCjmGrcCuUevAr9ZpqbQvj9ttmLPdmQTn7R0L7E1lPdM5aoVSb63PtUCT0nMYPVu6VeIGo7iL2ll5+pf+yXn1G0ZgpN8IkLoa81JjoE4bYokP8EXPYlEtMmm2m7G9Xy5zAjHkrFZ5viAozQN81dxSS/GVlXsekVgiSZcx3oyATt9geuzrygFG9fB6dwbbgGwWB+7CKMVuCckvgUty0KqLJR/Uj5z0kbt1q8vBUWeXuaGeQ8J8VOpDkNBAYp0CNkJEsHOsSV5W8GdKUXx51BlUW1iZUqmffS95ju4eis9Ka24x3S8jbSU+NC/sgjbVMNXKflMwPVzAMYhHxQvGYSBifaze3HqcSHyUZTmkeXMak+8C/u9nNcoNhHYgiDLCpufjPrWXGzYK/r6hv9q/Wy8RkwEayRcXL3p6CxVYFSSdvzTQTcG01ezxSOT99wwDImEdujy0L5on/tiQNLc9wK5+RPBD4XKC6jSDjx/DL+FoPy5MF6aFXHoYL3vC/WApdl6TXxSYMEskGTmraJ14i5sSNLOCK6wqrgDGYqtaXjxePNj2jqVq8G4JVceFNv+p7QjWdXFsgTKegpokxDNCjXpbEww X-Forefront-Antispam-Report: CIP:149.199.80.198; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:xir-pvapexch02.xlnx.xilinx.com; PTR:unknown-80-198.xilinx.com; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(186003)(2616005)(40460700003)(26005)(316002)(8676002)(966005)(5660300002)(44832011)(9786002)(8936002)(508600001)(2906002)(82310400005)(53546011)(36756003)(4326008)(356005)(7636003)(70586007)(70206006)(36860700001)(31686004)(6916009)(31696002)(83380400001)(426003)(47076005)(336012)(50156003)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2022 14:05:34.0458 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 16d513f4-84ab-430d-71dc-08da3745253b X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.80.198]; Helo=[xir-pvapexch02.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: SN1NAM02FT0047.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR02MB5699 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 5/16/2022 12:56 PM, Rahul Lakkireddy wrote: > On Monday, May 05/16/22, 2022 at 12:06:01 +0100, Ferruh Yigit wrote: >> On 5/16/2022 11:27 AM, Rahul Lakkireddy wrote: >>> Add support to read firmware configuration file from >>> /lib/firmware/cxgb4/ path in the filesystem. The firmware >>> config file is used to enable or disable NIC features before >>> firmware initialization to help retrieve better debug data to >>> analyze firmware init failures. The config file can also >>> be used to redistribute resources, like queues, TCAMs, etc., >>> from disabled physical functions (PFs) to main PF, before >>> firmware init. >> >> Hi Rahul, >> >> Please find comments below. >> >> Also can you please send a new version for both 4/5 and 5/5 (this patch) >> from original series? >> > > I had already posted v2 for 4/5 from original series at below location. > > https://patches.dpdk.org/project/dpdk/patch/61ae717665c2f4e38712652bec2f9d0fe5ca7d32.1651842841.git.rahul.lakkireddy@chelsio.com/ > > Do you want me to send a new patch series with 4/5 and 5/5 in a > single patch series? > Nope, I missed above patch, it is good as separate patches. >>> >>> Signed-off-by: Rahul Lakkireddy >>> --- >>> v2: >>> - Update cxgbe pmd doc about the firmware config file >>> - Update commit message to explain more about firmware config file >>> >>> doc/guides/nics/cxgbe.rst | 28 ++ >>> drivers/net/cxgbe/base/t4fw_interface.h | 1 + >>> drivers/net/cxgbe/cxgbe_main.c | 329 ++++++++++++++++-------- >>> 3 files changed, 245 insertions(+), 113 deletions(-) >>> >>> diff --git a/doc/guides/nics/cxgbe.rst b/doc/guides/nics/cxgbe.rst >>> index a1d30c488b..fc8a5751f1 100644 >>> --- a/doc/guides/nics/cxgbe.rst >>> +++ b/doc/guides/nics/cxgbe.rst >>> @@ -838,3 +838,31 @@ to configure the mtu of all the ports with a single command. >>> testpmd> port stop all >>> testpmd> port config all max-pkt-len 9000 >>> + >>> +Hardware Configuration and Debugging >>> +------------------------------------ >>> + >>> +Firmware Configuration File >>> +~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>> + >>> +To enable or disable Chelsio NIC features before firmware initialization, >>> +the Chelsio firmware configuration file can be placed in following >>> +directory. The CXGBE PMD will search and pick up the firmware >>> +configuration file during the Chelsio NIC probe, before initializing >>> +the firmware. >>> + >> >> Does it worth to mention what happens if the FW config file doesn't exist? >> Or mention from FW config file load order, as you described in mail list, to >> understand the relation with 'cxgbtool'? >> > > Will do. > >>> +.. code-block:: console >>> + >>> + cp /t6-config.txt /lib/firmware/cxgb4/t6-config.txt >>> + >> >> There is also 't5-config.txt' in the code. >> > > Yes, t5-config.txt is for Chelsio T5 NIC series and t6-config.txt > is for Chelsio T6 NIC series. Will update t5-config.txt as well. > >>> +The firmware configuration file is mainly intended to be used to debug >>> +firmware initialization failures. It can also be used to redistribute >>> +NIC resources from disabled physical functions (PFs) to main PF before >>> +initializing firmware. >>> + >>> +.. warning:: >>> + >>> + Note that the Chelsio firmware configuration file contains very low >>> + level details that is specific to the Chelsio NIC. Hence, the >>> + firmware configuration file must not be modified without expert >>> + guidance from Chelsio support team. >> >> Will it be too much detail to document what config can be changed via this >> FW config? >> > > Yes, this will be difficult to document. The config file just looks like > register=value pairs and are often dependent on each other based on > the selected configuration. A portion of sample config file is given > below. I'm not sure how to document this kind of info. > > [global] > reg[0x100c] = 0x22222222 > reg[0x10a0] = 0x01040810 > reg[0x1044] = 4096 > reg[0x1048] = 65536 > reg[0x104c] = 1536 > reg[0x1050] = 9024 > reg[0x1054] = 9216 > reg[0x1058] = 2048 > reg[0x105c] = 128 > reg[0x1060] = 8192 > reg[0x1064] = 16384 > [...] > Above won't be much useful to user anyway (without description of the values), if there is already some documentation a link to that can be good, otherwise OK to skip this.