Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2912995rdb; Fri, 22 Sep 2023 11:49:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEbmRWq2988QwHkMsPSSCc7Pof3V3RsBbyW+uryDiBv1+CKN2shnU+dXYqNzxy5GWcVr2xR X-Received: by 2002:a92:d085:0:b0:345:e438:7381 with SMTP id h5-20020a92d085000000b00345e4387381mr471441ilh.2.1695408594552; Fri, 22 Sep 2023 11:49:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695408594; cv=none; d=google.com; s=arc-20160816; b=Z9m/bLl9YJIIZH2cgp4SZwg3Q3hbLfyC/5RJ+aZgTJhDu6ZEmgJsczrd9DSH7+K7xh Jl+MFxv0fLX987V/a4uOWOMqlyi3Sd0CqbfYJKShh+qmJHix4+jwkPxXvOIqWjld+j4R GX4C/eCG+VaQPLM+vK4Z/T+Arzy877rQL2waFJk5pkpv8sMIWnJCKTyjJtkOS7AO1VFS GLj8yeC9VIdVjXyo8Z5Y1JpWAcCLqqco705OFL4zwO0s6WoFVCr5etvPh+7ZkvRhFcBp e8hN3QehN77YBYIgg+jmtsnS0DemVnVQiyXa3607p4dPeHbDRxYN52Qu02frVJjESTQG BT/g== 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=CLJc5GlLdZlYRiKNqvkZL9EUFetRdo25E7/HWR0m+sY=; fh=Jfg3FS8fsRNBkvUGwLEW6Abzb8InqsTQ+ekYW23wRXI=; b=cvKLbK+TWarFQug0MXaodn2MPstIHCr9DvRqHa6rp5GfZ+ECWD7a4TxOqX47rwFA4k 4GsHKMR4F24q9Gnu7sK8MloqEEOcGa57y1cBs2o3DyqTzxqlRCBQ6zCIwYIoQkxPrRl/ 0odkODekDD0NEJZltyRh4BF/Z9BsyPRzqws8kFr9zgsaoBmdBQLWWEKxt5IWSF+vlvmv mmhzN1ODn/p78wS7UBysLfgWIBMTH1vQpV+ZEGBh+LDdcABxsi9d9hQHqZZJinqXo4Wo ftzpNt/BO1I7GtRYzww3WCIkY6gHxZ1MbxRj1iKccyHYDyd33a88uCht72JsmOhhvM2c YO2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=w6ptt2wK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id s62-20020a632c41000000b00578a6ae4ed6si4130466pgs.371.2023.09.22.11.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 11:49:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@denx.de header.s=phobos-20191101 header.b=w6ptt2wK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 howler.vger.email (Postfix) with ESMTP id 1121A84D571A; Fri, 22 Sep 2023 06:31:41 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233567AbjIVNbm (ORCPT + 99 others); Fri, 22 Sep 2023 09:31:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44702 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234071AbjIVNbi (ORCPT ); Fri, 22 Sep 2023 09:31:38 -0400 Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 950F9199; Fri, 22 Sep 2023 06:31:30 -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 F0C2086098; Fri, 22 Sep 2023 15:31:27 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1695389488; bh=CLJc5GlLdZlYRiKNqvkZL9EUFetRdo25E7/HWR0m+sY=; h=From:To:Cc:Subject:Date:From; b=w6ptt2wKUoRDIvpuSKwbBWkrLk1I142BkEdHfoO0l39Lk0gfSTJ6QKR1dX4ktvnc6 uDn7vWYDzfpIifWf9q4TG2SrVjUUSJIxRpK0ekt94BLwimPa1uQypQ8+Qm7IIMA1FD 0m5MQ33wwnEpujoI8cnxpOideeHTU5u1Mw5Rq+x8uEDUIEaeavpQIiTJFAa1DjXFtr XMtEvcl9ePuJEmLzxbrucbhiVghtV7FJkXLcJoWcLapMF1DjqcBKEW+xJIHMWyldl2 bifMiUus0Vxrg7Gi99Z6xjpxegdp91y5rmWdFVJ0SxJb6Kj2dW4X0y24oDGdCr2KpR ZwYiL3DB0xOCQ== 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 v6 net-next 0/5] net: dsa: hsr: Enable HSR HW offloading for KSZ9477 Date: Fri, 22 Sep 2023 15:31:03 +0200 Message-Id: <20230922133108.2090612-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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (howler.vger.email [0.0.0.0]); Fri, 22 Sep 2023 06:31:41 -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-rc2+ Linux net-next repository SHA1: 5a1b322cb0b7d0d33a2d13462294dc0f46911172 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 | 77 ++++++++++++ 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, 283 insertions(+), 25 deletions(-) -- 2.20.1