Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp3674393rwd; Fri, 16 Jun 2023 23:40:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/9eow/rvmMOLEEsQk8aJBz2v/dbo+Xog6eGfhSq18X/SMdmVvq282Rv0yNvw3Eg7gMXZv X-Received: by 2002:a81:4f47:0:b0:56d:37c2:8095 with SMTP id d68-20020a814f47000000b0056d37c28095mr4090675ywb.33.1686984004185; Fri, 16 Jun 2023 23:40:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686984004; cv=none; d=google.com; s=arc-20160816; b=EmBnCnXQ7moyf8ElAPbO8Sp4s3RNJUI4glh6oFUuSk3el2IUSObV++oW8SlEo87Bkw 3y6pqTTEyhEdbPEAWlAJhzM52EcZUfgzGy7gKD4+fk7T7JBSoaxCQoLusAIiH7xQwGvb DKk6cDa5HZ0rzowQZ3ZPyWT60wcar15CO6yn6dryPVVqhF8rtNiiwlslLvaJb/M0fTIQ tLN1b4gjQYi7HonumsttvVZIkdPbx7cDIB72S/lQ0cVF8FvXL7p2GxTNAd/D0SspUVGb +SkVohUiDtPje5V13T9y7nvzxU26CiEGd+HamI0BGxiGgXsR2E1T3I6bCnzek6R+PFZv zT8Q== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=OzUSkHsCSsJmBb6bzGF4ZwyaQhgjnGKQWYEkiJxrxaM=; b=YNFX2bhsDLpsnckGsmtxhs5IKzxc9q55z+mOYuZj8UMKKYvrmd20LdZso8wF8pgyU9 G+Otr3FDeMLVXvd9kP24/LjcoJQmOXhDdXqxoyF3lAobcF0sZm+BI6X3hUGzHQI5QZHI FAkky6yt36PV+ta++nzhL3zApC3QbXe5ojQaTgu3Lv0rxIU1sB1rFamTbpc00JOispdl I8o8mu+fjLpktntJoheLWCC6vMP3iutauIEUljjc72enSuMgALfAtaJ4XKtLulfIiDtQ RmGn7IGGGWO9IpWXgi5BICTWQy4OVxLRijjOArAuZ+9o9bgv6UdO4WF3r+8Jg33jK8cj 2MkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="rYi/RtSy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kw3-20020a170902f90300b001b53d40cee3si1377373plb.206.2023.06.16.23.39.50; Fri, 16 Jun 2023 23:40:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="rYi/RtSy"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233642AbjFQG1Z (ORCPT + 99 others); Sat, 17 Jun 2023 02:27:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233662AbjFQG1O (ORCPT ); Sat, 17 Jun 2023 02:27:14 -0400 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEF671BC9; Fri, 16 Jun 2023 23:27:12 -0700 (PDT) Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-970028cfb6cso230701266b.1; Fri, 16 Jun 2023 23:27:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686983231; x=1689575231; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OzUSkHsCSsJmBb6bzGF4ZwyaQhgjnGKQWYEkiJxrxaM=; b=rYi/RtSyLqy5bWLqGt0ua8fuOhEhe8K7JBEXGi9K32coh6Vyow3MwESyU4oYq4U/Or 2Uzdp6WX0f+qifPKKJqkkatcGM87eJBslx85vBKgiWwSzczCJZfbqzfbdFrEPWPcXEaA rYVQuqly74HU9tEmc7vMKkCxK24fPw7GcMKJL4IUCdQ6dbp22HHWgcX7ksI4qSyf4lIi vpz8xqE5bLl4gYJxcWcUXER0zcl3tAE0iXkBLlDl5g4i6bH9FC24no7NLVYuf07iac/I nNzRhFFyqXfPxZlNZrZKCpp34tQ3DEWpVYfeI6LNNb51N5+4Tmrh68KYWfzb6Q4Unbhq Yq5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686983231; x=1689575231; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OzUSkHsCSsJmBb6bzGF4ZwyaQhgjnGKQWYEkiJxrxaM=; b=bsuFgmAQnHFN6gDF4Ipz5PvDMZ4rCo1zZ2B9o7/SVUa9yPmQyxHQL+IjV0FQo+pkc+ TpbJSHEOAtIxuxXaEQZoyYANH4r6cKCA5HKYygwFRRH+DTHUK+uL0ZcL1x3VevATFhOQ ABIxBXBWzp+vhGxCTOH14eSk4PJMY7nXjJTVkT7ZkAJKpP7o1RfhJEP6605fC3BgpDzW n08oxN+drbEWZiG0B4ipRzfd2cvyTjfDwfcjGvBT+9Uws2X8/aejO2U8ZphKCNNb5YxK g2m5o5lsFbq80zAR+Iy7Ic+FlV5IoTBWwSsufNIWeC8sd2SElB+rIVBA5bJU4d9S72LB tKJg== X-Gm-Message-State: AC+VfDxuYzTd5I5rgj6bomlwhKIvE8tvbfPsAwysenFfR9SzrMxlDRFW 5nCxNkCwWeSvJMSu1dP/5Y4= X-Received: by 2002:a17:907:9621:b0:982:26c4:e4b0 with SMTP id gb33-20020a170907962100b0098226c4e4b0mr5446197ejc.6.1686983231304; Fri, 16 Jun 2023 23:27:11 -0700 (PDT) Received: from arinc9-PC.. ([149.91.1.15]) by smtp.gmail.com with ESMTPSA id n6-20020a056402514600b0051a313a66e8sm1799638edd.45.2023.06.16.23.27.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jun 2023 23:27:10 -0700 (PDT) From: arinc9.unal@gmail.com X-Google-Original-From: arinc.unal@arinc9.com To: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King Cc: Landen Chao , Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net v6 4/6] net: dsa: mt7530: fix handling of LLDP frames Date: Sat, 17 Jun 2023 09:26:47 +0300 Message-Id: <20230617062649.28444-5-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230617062649.28444-1-arinc.unal@arinc9.com> References: <20230617062649.28444-1-arinc.unal@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 From: Arınç ÜNAL LLDP frames are link-local frames, therefore they must be trapped to the CPU port. Currently, the MT753X switches treat LLDP frames as regular multicast frames, therefore flooding them to user ports. To fix this, set LLDP frames to be trapped to the CPU port(s). Fixes: b8f126a8d543 ("net-next: dsa: add dsa support for Mediatek MT7530 switch") Signed-off-by: Arınç ÜNAL --- drivers/net/dsa/mt7530.c | 4 ++++ drivers/net/dsa/mt7530.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 5e4f6965cebd..6d6ff293900c 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -991,6 +991,10 @@ mt753x_trap_frames(struct mt7530_priv *priv) /* Trap BPDUs to the CPU port(s) */ mt7530_rmw(priv, MT753X_BPC, MT753X_BPDU_PORT_FW_MASK, MT753X_BPDU_CPU_ONLY); + + /* Trap LLDP frames with :0E MAC DA to the CPU port(s) */ + mt7530_rmw(priv, MT753X_RGAC2, MT753X_R0E_PORT_FW_MASK, + MT753X_R0E_PORT_FW(MT753X_BPDU_CPU_ONLY)); } static int diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h index e590cf43f3ae..08045b035e6a 100644 --- a/drivers/net/dsa/mt7530.h +++ b/drivers/net/dsa/mt7530.h @@ -67,6 +67,11 @@ enum mt753x_id { #define MT753X_BPC 0x24 #define MT753X_BPDU_PORT_FW_MASK GENMASK(2, 0) +/* Register for :03 and :0E MAC DA frame control */ +#define MT753X_RGAC2 0x2c +#define MT753X_R0E_PORT_FW_MASK GENMASK(18, 16) +#define MT753X_R0E_PORT_FW(x) FIELD_PREP(MT753X_R0E_PORT_FW_MASK, x) + enum mt753x_bpdu_port_fw { MT753X_BPDU_FOLLOW_MFC, MT753X_BPDU_CPU_EXCLUDE = 4, -- 2.39.2