From patchwork Thu Feb 2 12:59:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rakesh Sankaranarayanan X-Patchwork-Id: 51917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp232630wrn; Thu, 2 Feb 2023 05:20:07 -0800 (PST) X-Google-Smtp-Source: AK7set9kNNJAdE2my0Hkm9Z+Cjv6wLWGtvCLPqOuNCl7r01llA/L9RqPTF2oNV6DeWjhQHOK/0g1 X-Received: by 2002:a17:90b:ed2:b0:22c:46e:651c with SMTP id gz18-20020a17090b0ed200b0022c046e651cmr6536592pjb.5.1675344007439; Thu, 02 Feb 2023 05:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675344007; cv=none; d=google.com; s=arc-20160816; b=ItAJAH4l4JtsMhlvv9rkiWNbIuY2aXuodvsvRNZtcqMfuMmNNtpiEE3uYVz0RZvv8Y 8IulQxE10cRlDKHO/wFlQ4oiDJP1ZO7iR0NcT18htosD1sanpuJJKOBOQuZrGMQSd8LB EZfB8BI5jjMxxZMfCQa8m4YXodgiaV1vUJLTAqKLqdHfHHiEzgjUpIV9xHmzuR+Hv1Yr KGeWInWX6/KXdL//EjAe/idGOMD10k+MzfTdBHmDGmMJiosyXcyopr76qeNVNU6uNEDF A429yRT2GqryGssc8YmVYAuiNOSm9x1nXpdQbMG8s57VWWAprU68uI+oIT7jW2LlfRTx Gl8g== 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=Pb0287Gc3kyqUUzMOoczc/IN9KiRsMk/s7rH07N3WsE=; b=qXwjcQQuKPvVLeBH1p+WMqHi3wgtdEgnm+Iue6ifZJnmWdvvBRyMA0q7qY2AlXNcbE K72O++BZxVvszjixPPP4F+cbz+af+KIDUGwSAR54PV13bxm5YnnkqdpLpWkvfg3Tt1tr qFpkzpPGHdMdzHAyl4AHB+tjIftRXHwUXlxnOVYbz3sLnBHsBMAaNy+mR4ehan9cBjNj uSdqGj2MFrIoiBWeVUcYPc1HCznsHF3J9MJlsvdiiJwHTHNgmVgPvdYEidusKIgkL6F+ T7poLbCbytdz99YB4TnINP9BklTM00B0dMUyYSWSCutNMCOTE51ufVLtJtyoQokfM7Or yLGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=OxSsIfqy; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w8-20020a17090aad4800b0022bb380256esi4612520pjv.106.2023.02.02.05.19.53; Thu, 02 Feb 2023 05:20:07 -0800 (PST) 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=@microchip.com header.s=mchp header.b=OxSsIfqy; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232513AbjBBNAe (ORCPT + 99 others); Thu, 2 Feb 2023 08:00:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232527AbjBBNAK (ORCPT ); Thu, 2 Feb 2023 08:00:10 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 656668E4AC; Thu, 2 Feb 2023 04:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1675342774; x=1706878774; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=l+6j3bIkI3D5xNchH0czU8eucYVEM7sYgP+6GkMs3tk=; b=OxSsIfqyLrh9uu+vES8XplLrbxqwa2M+Acz4JZ4joo9SQrBdzQsQ1D6i 5Gx9IA8kpPmU9sf2KGdvfNBTEwfiZSCSXqCzYv5dQdeiK2io9V3EWh4wB OkOFCLg4B0r7cXVdtkVVlz1qXDxe56Z9CHP5XUUTiREzsGLrUi+Ha0u2h NAXEp5b+YzsnG71yLXBFUDaW6+MJNjNf/FTFTlZ0rVDFEPZY7Tdn0v2jz nwNB/KjivT8Ylftq/W4N5u3ivqZMeYk2Kqkjxw+sX0lPqyL6uR7SOw6V6 DlZiGrXoEqVXB8JnVilHXcjUZFdFgZN5fYMKPu8L3Qu6eeqNtphZuPjN+ Q==; X-IronPort-AV: E=Sophos;i="5.97,267,1669100400"; d="scan'208";a="135252111" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 02 Feb 2023 05:59:27 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 2 Feb 2023 05:59:26 -0700 Received: from che-lt-i67786lx.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Thu, 2 Feb 2023 05:59:22 -0700 From: Rakesh Sankaranarayanan To: , CC: , , , , , , , , , Subject: [RFC PATCH net-next 11/11] net: dsa: microchip: lan937x: update multicast table Date: Thu, 2 Feb 2023 18:29:30 +0530 Message-ID: <20230202125930.271740-12-rakesh.sankaranarayanan@microchip.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202125930.271740-1-rakesh.sankaranarayanan@microchip.com> References: <20230202125930.271740-1-rakesh.sankaranarayanan@microchip.com> MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756725517973727188?= X-GMAIL-MSGID: =?utf-8?q?1756725517973727188?= Program multicast table for cascaded port in second switch with default port forward value since it is the host port for second switch. Current driver program the same for cpu port in first switch. Signed-off-by: Rakesh Sankaranarayanan --- drivers/net/dsa/microchip/ksz9477.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index 4c12131098b1..521d8c2e1540 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -1116,18 +1116,22 @@ void ksz9477_config_cpu_port(struct dsa_switch *ds) int ksz9477_enable_stp_addr(struct ksz_device *dev) { + u32 fwd_port = BIT(dev->cpu_port); const u32 *masks; u32 data; int ret; masks = dev->info->masks; + if (dev->ds->index == 1) + fwd_port = BIT(dev->dsa_port); + /* Enable Reserved multicast table */ ksz_cfg(dev, REG_SW_LUE_CTRL_0, SW_RESV_MCAST_ENABLE, true); /* Set the Override bit for forwarding BPDU packet to CPU */ ret = ksz_write32(dev, REG_SW_ALU_VAL_B, - ALU_V_OVERRIDE | BIT(dev->cpu_port)); + ALU_V_OVERRIDE | fwd_port); if (ret < 0) return ret;