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 37DB744153 for ; Tue, 4 Jun 2024 14:13:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 25ED9436D7; Tue, 4 Jun 2024 14:13:03 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2088.outbound.protection.outlook.com [40.107.100.88]) by mails.dpdk.org (Postfix) with ESMTP id E424B436B5; Tue, 4 Jun 2024 14:12:56 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FZRMbcgVOofK15J4BFUGz9RjPFfWB1S8saF+whBnDNl1OjvLhQfL7wYmmHGj52+kn2gDWG56l0LNrZKkiAfnujNkQ4THhEVX714N3OW3mWLqLzxNMN9T0eVwlGpKhdnKPrkZH6/Qf7ZsaP3Kb3XNiZPsXedmqUgWW2gTvkq5tVmZs/XzM+HE5f2CuP2q34Fb5RMRjlqMhDtRxgY7pSZes5urWjt/6XqR499Xu6URbxRFTomjJxNxo3AnymaHQ+4k6kRJKTcESc1w3PGTy6+8bBYmw4+wJLx73UA+pb0q9DLYlwCEgf5HP9w++IKy3YlxXZa5yAcyis/b4CWadTD30A== 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=eHTAPBPImiQ42CWM/NoZPvztrRZBtDjUWqKdxm1UUlU=; b=Jq+GNEH9ecvL/48DnTxXSVBUyif40meTJhyD7SfIIDN3ar1Z/zNrExcrSgiM3ciJgpTe25onA8o9qrKs3mW0W+LNqH2NBNGU4X/vGRU+fJey2UDIiAnwgJQIAnQhY8VDnzMuCvJc6Sze//Y745PZa4ijKXi33xiemWUB1z1IMg7m+/dI5QunplJJo3x9dCPWpxq3E8IqZTUX2LNQ8KPlKpjyYwDxUztavS2dEO1FDIcHGalc79+95k71xEAXYNVgdzWiWII172vbXZxjutjd+WUHS/YUS9GzAixpUYaJDN9dQMVKLbBTXN4EQlyeJdq1SayxtnoabnneEdlOt1+JCA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=dpdk.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) 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=eHTAPBPImiQ42CWM/NoZPvztrRZBtDjUWqKdxm1UUlU=; b=mcYY4BVrMCbuGaqaTUZbZe0muMnJEwgSLxIh6eE4evw7NtzeeE5EgsziYb+wDf+tyTHw9Um/Otqwegehd5r75/Qe7s0FcPLU6FKjj03A5JfqRKYHeZJJRHCxG2FTnU7G+x8ACvCAcL5gghsmOZG1T0ZHCbdHxBIFkq3NX8sMNBs= Received: from BL1PR13CA0386.namprd13.prod.outlook.com (2603:10b6:208:2c0::31) by PH7PR12MB8039.namprd12.prod.outlook.com (2603:10b6:510:26a::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.17; Tue, 4 Jun 2024 12:12:54 +0000 Received: from BN3PEPF0000B371.namprd21.prod.outlook.com (2603:10b6:208:2c0:cafe::4f) by BL1PR13CA0386.outlook.office365.com (2603:10b6:208:2c0::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7656.15 via Frontend Transport; Tue, 4 Jun 2024 12:12:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN3PEPF0000B371.mail.protection.outlook.com (10.167.243.168) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7677.0 via Frontend Transport; Tue, 4 Jun 2024 12:12:54 +0000 Received: from cae-Lilac-RMB.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Tue, 4 Jun 2024 07:12:50 -0500 From: Venkat Kumar Ande To: CC: , Venkat Kumar Ande , , Selwin Sebastian Subject: [PATCH v3 11/25] net/axgbe: flow Tx Ctrl Registers are h/w version dependent Date: Tue, 4 Jun 2024 17:41:43 +0530 Message-ID: <20240604121157.3052-11-venkatkumar.ande@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604121157.3052-1-venkatkumar.ande@amd.com> References: <20240507124305.2318-1-VenkatKumar.Ande@amd.com> <20240604121157.3052-1-venkatkumar.ande@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PEPF0000B371:EE_|PH7PR12MB8039:EE_ X-MS-Office365-Filtering-Correlation-Id: ca8973b6-9c0a-4f16-ca95-08dc848fa99b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; ARA:13230031|36860700004|82310400017|376005|1800799015; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?At3kV/qHKngH9U7AVA2kcO+xr3oj9XN4hm7Oh/NkBrnbCizA+ooTl2JL4uz0?= =?us-ascii?Q?o4x1uAaqpzP2B3N8bXKw77qx1+2wcldbOshhQc+7r4Xn1XgRowX0xq7Fpxdh?= =?us-ascii?Q?VQDEhNN/cpxWgr0jNW70g/G9LgwzAUn6Ctxhrhue6VwLW9oVvcWdiYdd53+X?= =?us-ascii?Q?P5ga3nRDZGVpIMrZqikYL2XPr1kmLL4qqVrzn0+V7sr4ABWI/+apGhKUk9mE?= =?us-ascii?Q?JodfU/Anok+np8GfMJjgr1XqvuFPgUj0xjnzOHeHph7hLIADZkdfMe4fqzij?= =?us-ascii?Q?i9w1HR+ECwJYcQ0VWqzZ+DcEQJQY/EuL7A9Xvli0jWC7OVBhz2lRGdjuiX+w?= =?us-ascii?Q?3+O2LbalQlA0Qyi1/TY5GxPwnJxiADpeEtN0IAUp209uB4TbgVCOmJys9s5u?= =?us-ascii?Q?QFS05i3zUj8NFJGDTPft/b0vjJ/8WjJqktGDvxi/YIeggKnW0Y5hqdfhHrIx?= =?us-ascii?Q?XAkj7md0yio8FS8JLYc3xyJXcilwxx6tPhadOESbFFT9XAMxv0G4kLZJENZs?= =?us-ascii?Q?Pf1vmgbn9izIyd7omjDTsrMCEzcSg62XpnBLlEqDRj3HXTMueItfIKEidXoo?= =?us-ascii?Q?3tB29BMQZ5zfP8JpoKDL/9BN3JdCK8iip5y6WIlpR26JKuYPYs3Y+sAqaIIo?= =?us-ascii?Q?e84zrvx4P3dK2q2LoEpl1IN+0OkYAYqdv5hbF8JkWSFE0Xj2LzeHZqZ3bT1U?= =?us-ascii?Q?rLAQOb/KTgwgVoL5YU6vsQgW5JKOOn0GnSTDD0FyCE2NfO9vUKsZKR2BF63H?= =?us-ascii?Q?3Cnw6jxMiomOW5aaS2qltyiX4p+IkdmbGcGVrGSXkbK5NcOoHUTqZz5gTqR8?= =?us-ascii?Q?QUj3172IKSx8LJ3lfpjpA31eDDFJWPdC7D5u7q6R4DhD5n8XN2tPkOD9F6ee?= =?us-ascii?Q?lUDOQQlcdp5Nf62x1PNPLbe7dXr3n149ezLlQX3jUkqVey6YoIKAssGWAt1d?= =?us-ascii?Q?f0lbueIcbmfzs7yWPysq57jVeFthKwxrlt8YnYMbdWTzUigUAizYtRda+3On?= =?us-ascii?Q?6tFy+T7t4+PEEOmqNX+bhylzxz8bUds5vwF7NYh5+d6A3p3ek1QwysLMErl+?= =?us-ascii?Q?ofno7IxAS1J2BEC08b+YjYeT+YwEfz8vUY2zN7qu7Vmmhw5+sWndfXlU0g1J?= =?us-ascii?Q?UrKjUjrT2jIanM80SNeEeXHHenJRQONMavKlIvZI+Ta3VGT0nrOKx09hVWUH?= =?us-ascii?Q?oae/n+FDLgc9ERo5IcXyxwC6BanwJV7wOi44J2k+UA5ziR/mETOs5UB9JKiR?= =?us-ascii?Q?1i/o3eKDgt7htZQIi3rPS3I4iRY+ybOF3AmezlYG54zVlXOYU9DmK9VxFwX8?= =?us-ascii?Q?TvIrNhkVoCWowfTUNDmH9QKqO3tsNPl4D+uHmE4BSKUymvNbM0UxyBrFaFvG?= =?us-ascii?Q?+4xLNRr0O69p8vo7UQ5en3ejjo+r?= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(36860700004)(82310400017)(376005)(1800799015); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2024 12:12:54.0048 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ca8973b6-9c0a-4f16-ca95-08dc848fa99b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN3PEPF0000B371.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB8039 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org From: Venkat Kumar Ande There is difference in the TX Flow Control registers (TFCR) between the revisions of the hardware. The older revisions of hardware used to have single register per queue. Whereas, the newer revision of hardware (from ver 30H onwards) have one register per priority. Without the fix the user will face problem in TX operation on new 30H HW Fixes: 7c4158a5b592 ("net/axgbe: add DMA programming and start/stop") Cc: stable@dpdk.org Signed-off-by: Venkat Kumar Ande Acked-by: Selwin Sebastian --- drivers/net/axgbe/axgbe_dev.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/drivers/net/axgbe/axgbe_dev.c b/drivers/net/axgbe/axgbe_dev.c index 9b0073eea6..5233633a53 100644 --- a/drivers/net/axgbe/axgbe_dev.c +++ b/drivers/net/axgbe/axgbe_dev.c @@ -269,20 +269,28 @@ static int axgbe_set_speed(struct axgbe_port *pdata, int speed) return 0; } +static unsigned int axgbe_get_fc_queue_count(struct axgbe_port *pdata) +{ + unsigned int max_q_count = AXGMAC_MAX_FLOW_CONTROL_QUEUES; + + /* From MAC ver 30H the TFCR is per priority, instead of per queue */ + if (AXGMAC_GET_BITS(pdata->hw_feat.version, MAC_VR, SNPSVER) >= 0x30) + return max_q_count; + else + return (RTE_MIN(pdata->tx_q_count, max_q_count)); +} + static int axgbe_disable_tx_flow_control(struct axgbe_port *pdata) { - unsigned int max_q_count, q_count; unsigned int reg, reg_val; - unsigned int i; + unsigned int i, q_count; /* Clear MTL flow control */ for (i = 0; i < pdata->rx_q_count; i++) AXGMAC_MTL_IOWRITE_BITS(pdata, i, MTL_Q_RQOMR, EHFC, 0); /* Clear MAC flow control */ - max_q_count = AXGMAC_MAX_FLOW_CONTROL_QUEUES; - q_count = RTE_MIN(pdata->tx_q_count, - max_q_count); + q_count = axgbe_get_fc_queue_count(pdata); reg = MAC_Q0TFCR; for (i = 0; i < q_count; i++) { reg_val = AXGMAC_IOREAD(pdata, reg); @@ -297,9 +305,8 @@ static int axgbe_disable_tx_flow_control(struct axgbe_port *pdata) static int axgbe_enable_tx_flow_control(struct axgbe_port *pdata) { - unsigned int max_q_count, q_count; unsigned int reg, reg_val; - unsigned int i; + unsigned int i, q_count; /* Set MTL flow control */ for (i = 0; i < pdata->rx_q_count; i++) { @@ -316,9 +323,7 @@ static int axgbe_enable_tx_flow_control(struct axgbe_port *pdata) } /* Set MAC flow control */ - max_q_count = AXGMAC_MAX_FLOW_CONTROL_QUEUES; - q_count = RTE_MIN(pdata->tx_q_count, - max_q_count); + q_count = axgbe_get_fc_queue_count(pdata); reg = MAC_Q0TFCR; for (i = 0; i < q_count; i++) { reg_val = AXGMAC_IOREAD(pdata, reg); -- 2.34.1