Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1433251rdb; Wed, 20 Sep 2023 09:00:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEuUaKrFL9nDBr9/KnpqbzEHVPyZVqrq/J0/TxfRhLwBGEdsdTAvLQJxdaPk9BKAgBllub/ X-Received: by 2002:a05:6358:8aa:b0:142:ec44:a85 with SMTP id m42-20020a05635808aa00b00142ec440a85mr2611741rwj.5.1695225652607; Wed, 20 Sep 2023 09:00:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695225652; cv=none; d=google.com; s=arc-20160816; b=dKu4Kpi4oche9dKDIN424AIlBWUe+faz9CGmNaOLww9G3lXV2qx6ie0qM+evcylnsO SuCPj8AKvFVkX1m87es7pefHI4DK2NleO67al5RNn4yrDAzN7f1NrhsNjmByqnJ/IFuq dWbYjsOYR/9gz5xu0+4pg2s+gE3ilq+lCn2vwKnAuGofWYKZZN3Jla8lM5LRmz7Ho+gL 0y+dsx6vlgP+8HsV2pGT9I9GbQstLMjFWA8HOXAfhMcWJNATTCv52RCdYnjWWLv5t4YF 7HT0QaVsoFiSOP9gPGoSecNlNJsh7fFm0N6HlEwlBLZ3jO8sFEe76jXauVKMz8NZWfOd eImg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wF48erZR6turOA3H1N7RgF/MSbbCoV3fPvoqpc+H5xI=; fh=Jfg3FS8fsRNBkvUGwLEW6Abzb8InqsTQ+ekYW23wRXI=; b=it/4rhYc7OMtj+zhfkhjCW3fhK8jxN0Gu9ua+xo2SxT5MAyUKLuwmxW/swizU5Od+l HQvSoF3ApalOKAAJyhybQ3TnhOWggcVJUDTPiBsA+VFF9DAfv/QRBoNtFc0u/2X9rk2X JkVAKiJUG5+r9jkDFhQwV7YYyqO/6dRw79L675FX4vx3+gyeY4CfDPOrLK+XDizlhcmh 2hBmUaC+4JkQQHJXNFR436Nn96eH0YVwNpfm0VZpwukXe0m8/cOnsE1Oc0IWQxBNCGsf uSUWr78yr8saJCeXlmDAaEtecPaL8K0cRfYL7fYcbhGEgQx2hahsAPmSPXiYrMbwEzmN 9Tng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=axHObFBP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id h184-20020a636cc1000000b00577f83530f3si11594334pgc.61.2023.09.20.09.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 09:00:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=axHObFBP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=denx.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 8CCDD8312ADF; Wed, 20 Sep 2023 04:44:17 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234474AbjITLoO (ORCPT + 99 others); Wed, 20 Sep 2023 07:44:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234463AbjITLoL (ORCPT ); Wed, 20 Sep 2023 07:44:11 -0400 Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDAA7C2; Wed, 20 Sep 2023 04:44:02 -0700 (PDT) Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: lukma@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 707C6868D1; Wed, 20 Sep 2023 13:43:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1695210239; bh=wF48erZR6turOA3H1N7RgF/MSbbCoV3fPvoqpc+H5xI=; h=From:To:Cc:Subject:Date:From; b=axHObFBPvaEc0AggMBm0AhfpWgIJYOP92YPWpkSyIHUdBFcMG2PLWJxpcPXj67F+Y hvUBa3RIOmpL4JeOY+E1huato09UzTIBPrhgEKpe5UPXgGU9UsJbs7ocYDUHpht4sg mv1VuvKHZVkkDAEOz26HPNFIhHoRHKr9J+F+RD+UDjiCFqMq78kjvGLO98JmfCVevy sEjEc776lZHEGfABbGLQPARtu07ujCSoRi8bczLJP1R+Us8j0ePcZK1Ho4TLzd9t4b 9LwcdNGy9MqcYkI5eQsiJ4cz8UcbjOzqZx5uwz8N6l5k7MAhv+RV/bW9uvmUqx1c40 mCmvwUjGUW7FA== From: Lukasz Majewski To: Tristram.Ha@microchip.com, Eric Dumazet , Andrew Lunn , davem@davemloft.net, Woojung Huh , Vladimir Oltean , Oleksij Rempel Cc: Florian Fainelli , Jakub Kicinski , Paolo Abeni , UNGLinuxDriver@microchip.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Lukasz Majewski Subject: [PATCH v5 net-next 0/5] net: dsa: hsr: Enable HSR HW offloading for KSZ9477 Date: Wed, 20 Sep 2023 13:43:38 +0200 Message-Id: <20230920114343.1979843-1-lukma@denx.de> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 20 Sep 2023 04:44:18 -0700 (PDT) This patch series provides support for HSR HW offloading in KSZ9477 switch IC. To test this feature: ip link add name hsr0 type hsr slave1 lan1 slave2 lan2 supervision 45 version 1 ip link set dev lan1 up ip link set dev lan2 up ip a add 192.168.0.1/24 dev hsr0 ip link set dev hsr0 up To remove HSR network device: ip link del hsr0 To test if one can adjust MAC address: ip link set lan2 address 00:01:02:AA:BB:CC It is also possible to create another HSR interface, but it will only support HSR is software - e.g. ip link add name hsr1 type hsr slave1 lan3 slave2 lan4 supervision 45 version 1 Test HW: Two KSZ9477-EVB boards with HSR ports set to "Port1" and "Port2". Performance SW used: nuttcp -S --nofork nuttcp -vv -T 60 -r 192.168.0.2 nuttcp -vv -T 60 -t 192.168.0.2 Code: v6.6.0-rc1+ Linux repository Tested HSR v0 and v1 Results: With KSZ9477 offloading support added: RX: 100 Mbps TX: 98 Mbps With no offloading RX: 63 Mbps TX: 63 Mbps Lukasz Majewski (2): net: dsa: tag_ksz: Extend ksz9477_xmit() for HSR frame duplication net: dsa: microchip: Enable HSR offloading for KSZ9477 Vladimir Oltean (3): net: dsa: propagate extack to ds->ops->port_hsr_join() net: dsa: notify drivers of MAC address changes on user ports net: dsa: microchip: move REG_SW_MAC_ADDR to dev->info->regs[] drivers/net/dsa/microchip/ksz8795_reg.h | 7 -- drivers/net/dsa/microchip/ksz9477.c | 70 +++++++++++ drivers/net/dsa/microchip/ksz9477.h | 2 + drivers/net/dsa/microchip/ksz9477_reg.h | 7 -- drivers/net/dsa/microchip/ksz_common.c | 149 ++++++++++++++++++++++++ drivers/net/dsa/microchip/ksz_common.h | 10 ++ drivers/net/dsa/xrs700x/xrs700x.c | 18 ++- include/net/dsa.h | 13 ++- net/dsa/port.c | 5 +- net/dsa/port.h | 3 +- net/dsa/slave.c | 9 +- net/dsa/tag_ksz.c | 8 ++ 12 files changed, 276 insertions(+), 25 deletions(-) -- 2.20.1