From patchwork Sun Apr 24 18:16:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Birger Koblitz X-Patchwork-Id: 1621565 X-Patchwork-Delegate: sander@svanheule.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=SUP/mqgo; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Kmbx82npBz9s0B for ; Mon, 25 Apr 2022 04:18:19 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:From:Cc:To:MIME-Version:Date: Message-ID: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=34LmcuG418AoXX0eDBkJQrOSlS/XkCTXtjAeDnrns7I=; b=SUP/mqgo+g+5TF yBHZkbksq7mMMSq1dfxJ+XzLpZzCIDbKZvCUu1b188fcQrPey2VNux4nmpfATMGGGTCQLmAGytKLQ jdwi1f6sqoA4DfiGvdqaoZmYNw98mHifTLo0NkTheR4tOyxEur6U8sodkq4LxsfV6gf5QpMeGTjRM 1TY+kVpPRtuFCtvwIXOSKHfiuDU/YteEQ/O/9rHeNrRSMvXTmU2hRc6lpjFLBEkqyVVnWdqrQOuOP HwPMkk9GBfZAvg3OXWAyLBXO6ofHyHRyqJes+Jh1snYybLEZLoBpsfyE82VbJbbqwYVzmKIXZ528S O07SKTE/3UPE/Of5DTQA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nigmK-007A9o-Km; Sun, 24 Apr 2022 18:16:12 +0000 Received: from wp175.webpack.hosteurope.de ([2a01:488:42:1000:50ed:84b6::]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nigmH-007A91-8m for openwrt-devel@lists.openwrt.org; Sun, 24 Apr 2022 18:16:10 +0000 Received: from p200300c58747bd00d252c750938946da.dip0.t-ipconnect.de ([2003:c5:8747:bd00:d252:c750:9389:46da]); authenticated by wp175.webpack.hosteurope.de running ExIM with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) id 1nigmC-0002S9-48; Sun, 24 Apr 2022 20:16:04 +0200 Message-ID: Date: Sun, 24 Apr 2022 20:16:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: 'OpenWrt Development List' Cc: =?utf-8?q?Bj=C3=B8rn_Mork?= , Wenli Looi From: Birger Koblitz Subject: [PATCH] realtek: do not reset SerDes on link change X-bounce-key: webpack.hosteurope.de; mail@birger-koblitz.de; 1650824169; 6863d2de; X-HE-SMSGID: 1nigmC-0002S9-48 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220424_111609_491841_2D7E2286 X-CRM114-Status: UNSURE ( 7.38 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22bombadil=2Einfradead=2Eorg=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__This_fixes_a_bug_where_frames_sent_to_?= =?unknown-8bit?q?the_switch_itself_were?= =?unknown-8bit?q?_flooded_to_all_ports_unless_the_MAC_address_of_the_CPU-por?= =?unknown-8bit?q?t_was_learned_otherwise=2E?= =?unknown-8bit?q?_Tested-by=3A_Wenli_Looi_=3Cwlooi=40ucalgary=2Eca=3E_Tested?= =?unknown-8bit?q?-by=3A_Bj=C3=B8rn_Mork_=3Cbjorn=40mork=2Eno=3E?= =?unknown-8bit?q?_Signed-off-by=3A_Birger_Koblitz_=3Cgit=40birger-koblitz=2E?= =?unknown-8bit?q?de=3E_---_=2E=2E=2E/linux/realtek/files-5=2E10/drivers/net?= =?unknown-8bit?q?/dsa/rtl83xx/dsa=2Ec?= =?unknown-8bit?b?IHwgWy4uLl0g?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=280=2E0_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_0=2E0_SPF=5FHELO=5FNONE__________SPF=3A_HELO_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= =?unknown-8bit?q?_0=2E0_SPF=5FNONE_______________SPF=3A_sender_does_not_publ?= =?unknown-8bit?q?ish_an_SPF_Record?= X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org This fixes a bug where frames sent to the switch itself were flooded to all ports unless the MAC address of the CPU-port was learned otherwise. Tested-by: Wenli Looi Tested-by: Bjørn Mork Signed-off-by: Birger Koblitz --- .../linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c index 4780632983..858b692640 100644 --- a/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c +++ b/target/linux/realtek/files-5.10/drivers/net/dsa/rtl83xx/dsa.c @@ -205,6 +205,12 @@ static int rtl83xx_setup(struct dsa_switch *ds) priv->r->l2_learning_setup(); + // Make sure all frames sent to the switch's MAC are trapped to the CPU-port + if (priv->family_id == RTL8380_FAMILY_ID) + sw_w32(0x2, RTL838X_SPCL_TRAP_SWITCH_MAC_CTRL); // 0: FWD, 1: DROP, 2: TRAP2CPU + else + sw_w32(0x2, RTL839X_SPCL_TRAP_SWITCH_MAC_CTRL); + /* Enable MAC Polling PHY again */ rtl83xx_enable_phy_polling(priv); pr_debug("Please wait until PHY is settled\n");