From patchwork Sun Oct 30 21:36:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 893 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1972657wru; Sun, 30 Oct 2022 14:32:47 -0700 (PDT) X-Google-Smtp-Source: AMsMyM68Utca+IBj8FlYWuwrFY+vLQ55Gv2sP2RDua0IK8SsLZavQGDAovHv5x/h5Vnk/4JodjFf X-Received: by 2002:a17:902:be07:b0:187:48d:d9be with SMTP id r7-20020a170902be0700b00187048dd9bemr11281649pls.102.1667165567175; Sun, 30 Oct 2022 14:32:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667165567; cv=none; d=google.com; s=arc-20160816; b=DCcBt1OynVZ5PZQCcWH8Dry9wNuus1T26PYMBq0qs1VE9hNpV/EvbG3QL3mTwf5JpU NVq4ERFA2q7EJWSyrN5+nZmyCaXciLcJilV51JuToE9jBGo1iNtGdbwJgw998mAEIqoD BG/E7oNCUmiBNl1caPzeQRI9AwDxuQsyc+PUz8w0BH2P35yTBoLNzNQtZwzk8XSUTQGQ jlxNxysAp43DoXZ0E0cFN97S37g0JbG5kZKBEKRU1NJcFvf7/56L7E5aeA0Ei53XbFTO qUvNK9nPmeZIG9SpXwlUzTVsvXkc93KTJnN7Fmv8jqEpnAqg2zAErlZlBFme+UTJD8uz k36w== 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=uDetjjSwuE8EgJfT8a24RrT4Tc2S5HODNzqbdoc0gu4=; b=lzSzFgMNm3rlCuAAoCLZerg7polJOTV7JFDNS3Ng8RJ9MzCNfjUzcCK15MM2P/yifL On2y9aEQd6Md0irpm3jjiUD39GGNErXMoYm9iEKY7y40FLabSyrGs/8Hb2YHeGMTiyd7 PFnzlBQRizyRCe+Ou3xjRXFUUlClUIDHb6m2pOr1IpD2NPRvgM/0um7Q1XZ9TVrgbslM EOKU1iRi1f/lOlswMTFq7huDMNLfU/q4Uml7y0SCp6X0hLJCHIKapg66vg49re472P1S sfL+SBSOY677PUwgx4gMMsOFnMFC7sYbBOHR6WnW5X/PLa0Y76JQmbKOVUFaQl2iakB+ AYAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=CWel5ZVU; 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 ix5-20020a170902f80500b001868a4db3d1si5717846plb.48.2022.10.30.14.32.34; Sun, 30 Oct 2022 14:32:47 -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=CWel5ZVU; 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 S229718AbiJ3VcN (ORCPT + 99 others); Sun, 30 Oct 2022 17:32:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229893AbiJ3Vb7 (ORCPT ); Sun, 30 Oct 2022 17:31:59 -0400 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C8BBB1DE; Sun, 30 Oct 2022 14:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1667165518; x=1698701518; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=yF+CHeWI4UiDbUU7IwMxj8YjpjdcFZ5iBSnZRE+nm6s=; b=CWel5ZVUj7ZgFJtNu+6hGkzS+vLl6iPeeQiUaFT59M3C5DS+9nuRBsL4 m2HJUMcQo2cFwn8hjEWLTzGbOrqLgq7YQ+ahU79MdeUCIOUYjPkmCeeh2 YfeNpgWaj9y8T9QLZ9fJAve5U7E3kCdLC9j5pE0QC43Q+0sVNeujNFZOn Tzl+FEnCr41p3ySL912gz8lr6HTsrulYds/1COsPUM9cGgUFSbgAAC948 e3CUZLTVnFdM8j3IpEAzjtfTHG+NcmVBdRu+TOf7F80Wax6YkchriAb1D 0PWKUzD62Lui5iN1Mtc5cGhNbdMFxK5bE2wkfRWbl3MTZ92iLlEyHOBN1 A==; X-IronPort-AV: E=Sophos;i="5.95,226,1661842800"; d="scan'208";a="186969027" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa3.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 30 Oct 2022 14:31:57 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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, 30 Oct 2022 14:31:57 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Sun, 30 Oct 2022 14:31:55 -0700 From: Horatiu Vultur To: , CC: , , , , , Horatiu Vultur Subject: [PATCH net v2 0/3] net: lan966x: Fixes for when MTU is changed Date: Sun, 30 Oct 2022 22:36:33 +0100 Message-ID: <20221030213636.1031408-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-Spam-Status: No, score=-5.5 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?1748149801904230111?= X-GMAIL-MSGID: =?utf-8?q?1748149801904230111?= There were multiple problems in different parts of the driver when the MTU was changed. The first problem was that the HW was missing to configure the correct value, it was missing ETH_HLEN and ETH_FCS_LEN. The second problem was when vlan filtering was enabled/disabled, the MRU was not adjusted corretly. While the last issue was that the FDMA was calculated wrongly the correct maximum MTU. v1->v2: - when calculating max frame possible to receive add also the vlan tags length Horatiu Vultur (3): net: lan966x: Fix the MTU calculation net: lan966x: Adjust maximum frame size when vlan is enabled/disabled net: lan966x: Fix FDMA when MTU is changed .../net/ethernet/microchip/lan966x/lan966x_fdma.c | 8 ++++++-- .../net/ethernet/microchip/lan966x/lan966x_main.c | 4 ++-- .../net/ethernet/microchip/lan966x/lan966x_main.h | 2 ++ .../net/ethernet/microchip/lan966x/lan966x_regs.h | 15 +++++++++++++++ .../net/ethernet/microchip/lan966x/lan966x_vlan.c | 6 ++++++ 5 files changed, 31 insertions(+), 4 deletions(-)