From patchwork Thu Aug 8 11:07:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: MD Danish Anwar X-Patchwork-Id: 13757258 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4864BC52D6F for ; Thu, 8 Aug 2024 11:09:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=OYmqZvXDg6xl4E5wCck2fmUGcqhLJC4qchZVAtvvSXc=; b=ehvOOugkrY9oXQUrED9bsDm6KP TDnuaUURbKsTMAsB1VHPOSkhtcZiHZRBk5992+D9VzWA8wmYK65n/XxCBscJJYCjiAnwS3MysloYL OnjaOa0/c854mocxsN66QX5TIH9SPTPbbvObbXFa+wzu7wTAt/iUFZWXdjGSOxTsrgV+OdRokxZhP EG26aghmEczTkgwgtbKWVB0P9DDV73CbOBEJcrlw0JY0K48HV3sJbrPufFO2RC1keo/bLJRnZrouH RCqPwUjgL1U0ljTDfW5lEQF/AWIJr4yKFZ7+FiExxM/DIya47qhbYy5P7KJHG5Wmlvn3rf+7dNFEJ gdHqBZgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc10i-000000080l0-1FKS; Thu, 08 Aug 2024 11:08:48 +0000 Received: from lelv0143.ext.ti.com ([198.47.23.248]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sc109-000000080e6-2hd3 for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2024 11:08:15 +0000 Received: from fllv0035.itg.ti.com ([10.64.41.0]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id 478B83iq130423; Thu, 8 Aug 2024 06:08:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1723115283; bh=OYmqZvXDg6xl4E5wCck2fmUGcqhLJC4qchZVAtvvSXc=; h=From:To:CC:Subject:Date; b=dJY5qws9zRJCO8toXPBESpWgAxqgkKkwF5TyrEPb2XxaZI8kNBqq/9kU5GZpG0cn2 npjpGWE7+gIKm7mn6ai1i9JRIgBKW8wvdklVkdCyJdsITGqRVAD4WjqGxaZQNdndPD 3TDMtZAuxjhu/34LbouwEWEomiRh5/Da7xf8Ay3A= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 478B83ZD081467 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 8 Aug 2024 06:08:03 -0500 Received: from DLEE102.ent.ti.com (157.170.170.32) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Thu, 8 Aug 2024 06:08:03 -0500 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Thu, 8 Aug 2024 06:08:03 -0500 Received: from fllv0122.itg.ti.com (fllv0122.itg.ti.com [10.247.120.72]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 478B83Xt070844; Thu, 8 Aug 2024 06:08:03 -0500 Received: from localhost (danish-tpc.dhcp.ti.com [10.24.69.25]) by fllv0122.itg.ti.com (8.14.7/8.14.7) with ESMTP id 478B82u7011983; Thu, 8 Aug 2024 06:08:02 -0500 From: MD Danish Anwar To: Jan Kiszka , Dan Carpenter , Andrew Lunn , Vignesh Raghavendra , Javier Carrasco , Diogo Ivo , Jacob Keller , Simon Horman , Richard Cochran , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" CC: , , , , Roger Quadros Subject: [PATCH net-next 0/6] Introduce HSR offload support for ICSSG Date: Thu, 8 Aug 2024 16:37:54 +0530 Message-ID: <20240808110800.1281716-1-danishanwar@ti.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_040813_796038_02ADBE5B X-CRM114-Status: GOOD ( 13.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi All, This series introduces HSR offload support for ICSSG driver. To support HSR offload to hardware, ICSSG HSR firmware is used. This series introduces, 1. HSR frame offload support for ICSSG driver. 2. HSR Tx Packet duplication offload 3. HSR Tx Tag and Rx Tag offload 4. Multicast filtering support in HSR offload mode. 5. Dependencies related to IEP. HSR Test Setup: -------------- ___________ ___________ ___________ | | Link AB | | Link BC | | __| AM64* |_________| AM64 |_________| AM64* |___ | | Station A | | Station B | | Station C | | | |___________| |___________| |___________| | | | |______________________________________________________________| Link CA *Could be any device that supports two ethernet interfaces. Steps to switch to HSR frame forward offload mode: ------------------------------------------------- Example assuming eth1, eth2 ports of ICSSG1 on AM64-EVM 1) Enable HSR offload for both interfaces ethtool -K eth1 hsr-fwd-offload on ethtool -K eth1 hsr-dup-offload on ethtool -K eth1 hsr-tag-ins-offload on ethtool -K eth1 hsr-tag-rm-offload on ethtool -K eth2 hsr-fwd-offload on ethtool -K eth2 hsr-dup-offload on ethtool -K eth2 hsr-tag-ins-offload on ethtool -K eth2 hsr-tag-rm-offload on 2) Create HSR interface and add slave interfaces to it ip link add name hsr0 type hsr slave1 eth1 slave2 eth2 \ supervision 45 version 1 3) Add IP address to the HSR interface ip addr add /24 dev hsr0 4) Bring up the HSR interface ip link set hsr0 up Switching back to Dual EMAC mode: -------------------------------- 1) Delete HSR interface ip link delete hsr0 2) Disable HSR port-to-port offloading mode, packet duplication ethtool -K eth1 hsr-fwd-offload off ethtool -K eth1 hsr-dup-offload off ethtool -K eth1 hsr-tag-ins-offload off ethtool -K eth1 hsr-tag-rm-offload off ethtool -K eth2 hsr-fwd-offload off ethtool -K eth2 hsr-dup-offload off ethtool -K eth2 hsr-tag-ins-offload off ethtool -K eth2 hsr-tag-rm-offload off Testing the port-to-port frame forward offload feature: ----------------------------------------------------- 1) Connect the LAN cables as shown in the test setup. 2) Configure Station A and Station C in HSR non-offload mode. 3) Configure Station B is HSR offload mode. 4) Since HSR is a redundancy protocol, disconnect cable "Link CA", to ensure frames from Station A reach Station C only through Station B. 5) Run iperf3 Server on Station C and client on station A. 7) Check the CPU usage on Station B. CPU usage report on Station B using mpstat when running UDP iperf3: ------------------------------------------------------------------- 1) Non-Offload case ------------------- CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle all 0.00 0.00 0.50 0.00 3.52 29.15 0.00 0.00 66.83 0 0.00 0.00 0.00 0.00 7.00 58.00 0.00 0.00 35.00 1 0.00 0.00 0.99 0.00 0.99 0.00 0.00 0.00 98.02 2) Offload case --------------- CPU %usr %nice %sys %iowait %irq %soft %steal %guest %idle all 0.00 0.00 0.00 0.00 0.50 0.00 0.00 0.00 99.50 0 0.00 0.00 0.99 0.00 0.00 0.00 0.00 0.00 99.01 1 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 100.00 Note: 1) At the very least, hsr-fwd-offload must be enabled. Without offloading the port-to-port offload, other HSR offloads cannot be enabled. 2) Inorder to enable hsr-tag-ins-offload, hsr-dup-offload must also be enabled as these are tightly coupled in the firmware implementation. MD Danish Anwar (4): net: ti: icssg-prueth: Enable IEP1 net: ti: icssg-prueth: Add support for HSR frame forward offload net: ti: icssg-prueth: Add multicast filtering support in HSR mode net: ti: icss-iep: Move icss_iep structure Ravi Gunasekaran (2): net: ti: icssg-prueth: Enable HSR Tx Packet duplication offload net: ti: icssg-prueth: Enable HSR Tx Tag and Rx Tag offload drivers/net/ethernet/ti/icssg/icss_iep.c | 72 ------- drivers/net/ethernet/ti/icssg/icss_iep.h | 74 ++++++- .../net/ethernet/ti/icssg/icssg_classifier.c | 1 + drivers/net/ethernet/ti/icssg/icssg_common.c | 16 +- drivers/net/ethernet/ti/icssg/icssg_config.c | 10 +- drivers/net/ethernet/ti/icssg/icssg_config.h | 2 + drivers/net/ethernet/ti/icssg/icssg_prueth.c | 189 ++++++++++++++++-- drivers/net/ethernet/ti/icssg/icssg_prueth.h | 9 + 8 files changed, 277 insertions(+), 96 deletions(-) base-commit: 222a3380f92b8791d4eeedf7cd750513ff428adf