Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4813119rwn; Sun, 11 Sep 2022 22:30:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR54sVYfDLjBKmhYE/7sCZNzccN+E+iqjVDIMNzi3lP3FrQDZWZAunzMBvrZDhoFa++HDDMr X-Received: by 2002:a65:5789:0:b0:41a:4a7c:635d with SMTP id b9-20020a655789000000b0041a4a7c635dmr21429208pgr.60.1662960600371; Sun, 11 Sep 2022 22:30:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662960600; cv=none; d=google.com; s=arc-20160816; b=SXn5/Gg5wGFmijiRaBnohEXNadMcFFjh9xyO3q0dJchqnKMxBA1Pd/ejZ2jlrWhBXZ EmnRiNCrpMcA0+uwLDFOyoM1QtydrpliX+DfJKja6XV+tePXv2Oy1bLZTIAsU8FU1dN/ FexJz/PIFJ0+Z6bGMp0YzYBbUnKwjuAi/dIvuojp6eTGPfjLMpQ+oYx5x6oJvkPcNUS/ 8SaXj4XpJKCYUqyycpEhBmfq5GnOeccVIDc/L76NYVVXheYNRSWWybDPYvXrkI0LJtqa uzpogORCywl3G9dmwnQ5u/adl/7ZuP7QTkDAXFG2hvFhe1fGMjzBpOwA47EHiwlC/tig 77+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=y6YjrEJ3Hh5YQcnyUxL1WauGmcuOQZ5GzQRZYjCrq4E=; b=YXI5ZCCVWgzpcCDFnuNjN8TCzKsO4mpejV85QzKD9pMzAXBA0qM5kWLy+fYlta6MqY l9vKaW1lkl1CieMfyrxRqmi7nfVHLDCh/ZndGu9CtetEcFmVi4+gEvbNAGtJiL5jV0tl eFsoqh0K5eNn63urVeV5ECXQ2BVSL1b6XrpOdNoB6okzwfOO+VEacxsRWrhNKvR3fqYr OdGutsy53DXnqVjz7haKTEiQDHMg9Ci/63wHigBpj6F9aYP8t1EunQmU/vOw5xFWCMm8 ngCyNLLnTf0gmxE0MFqXnZXu/VfIy+nDS15CutGPhbNXUTZYdlgFMvQdjX7nHGYcNL7g BM/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="SCpsh/++"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bu14-20020a056a00410e00b0052f7fb6f2desi7045152pfb.154.2022.09.11.22.29.43; Sun, 11 Sep 2022 22:30:00 -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=@microchip.com header.s=mchp header.b="SCpsh/++"; 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 S229527AbiILFPh (ORCPT + 99 others); Mon, 12 Sep 2022 01:15:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbiILFPf (ORCPT ); Mon, 12 Sep 2022 01:15:35 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 513D517050; Sun, 11 Sep 2022 22:15:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1662959731; x=1694495731; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=kHjZUGKOIELCEpR9rLYYd64wZk3rM2bDxxUENZDLGa4=; b=SCpsh/++VumAdEK/ZbjmfxHRsVWzZngCL4Tb56EUqx8t2XoriRLpdTCk eH9+SneNJwf3hM+JjHNdnSqr3qw1HZsEIRTTruLL1ACC1mYxIIAQC7L13 ZS1w4qqGGXP+RKMQ3Pq58+5y9kqvT26eiwnGv7rK9mlAxQRg0f16mfym9 5G5kAeDXFWaoP3PFfnt/SdkQyCuyH8q1okVkXBq/p0Q+rSbZuZWrwL2W/ cUG2riX2Dtt0qL728QQhJT78w4lMyFo/QIMGiBeVOiOWyDVpDU4v+r5rW Isn3o13UZGmNhEcckXFfUrGwEUmA2S1DQh0F9ek6LaHY/Y3MfXhw1u1Jl w==; X-IronPort-AV: E=Sophos;i="5.93,308,1654585200"; d="scan'208";a="176642009" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 11 Sep 2022 22:15:28 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Sun, 11 Sep 2022 22:15:25 -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.12 via Frontend Transport; Sun, 11 Sep 2022 22:15:21 -0700 From: Rakesh Sankaranarayanan To: , CC: , , , , , , , , , , Subject: [Patch net] net: dsa: microchip: lan937x: fix maximum frame length check Date: Mon, 12 Sep 2022 10:42:28 +0530 Message-ID: <20220912051228.1306074-1-rakesh.sankaranarayanan@microchip.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain 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, SPF_HELO_PASS,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 Maximum frame length check is enabled in lan937x switch on POR, But it is found to be disabled on driver during port setup operation. Due to this, packets are not dropped when transmitted with greater than configured value. For testing, setup made for lan1->lan2 transmission and configured lan1 interface with a frame length (less than 1500 as mentioned in documentation) and transmitted packets with greater than configured value. Expected no packets at lan2 end, but packets observed at lan2. Based on the documentation, packets should get discarded if the actual packet length doesn't match the frame length configured. Frame length check should be disabled only for cascaded ports due to tailtags. This feature was disabled on ksz9477 series due to ptp issue, which is not in lan937x series. But since lan937x took ksz9477 as base, frame length check disabled here as well. Patch added to remove this portion from port setup so that maximum frame length check will be active for normal ports. Fixes: 55ab6ffaf378 ("net: dsa: microchip: add DSA support for microchip LAN937x") Signed-off-by: Rakesh Sankaranarayanan --- drivers/net/dsa/microchip/lan937x_main.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c index 4867aa62dd4c..7d06488d1eea 100644 --- a/drivers/net/dsa/microchip/lan937x_main.c +++ b/drivers/net/dsa/microchip/lan937x_main.c @@ -296,10 +296,6 @@ void lan937x_port_setup(struct ksz_device *dev, int port, bool cpu_port) lan937x_port_cfg(dev, port, REG_PORT_CTRL_0, PORT_TAIL_TAG_ENABLE, true); - /* disable frame check length field */ - lan937x_port_cfg(dev, port, REG_PORT_MAC_CTRL_0, PORT_CHECK_LENGTH, - false); - /* set back pressure for half duplex */ lan937x_port_cfg(dev, port, REG_PORT_MAC_CTRL_1, PORT_BACK_PRESSURE, true); -- 2.34.1