From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 54F4F1E3764; Tue, 15 Oct 2024 12:10:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728994210; cv=none; b=L1vLes8cVA6dv8Sh68bDZ9HG8iHHdGaFtqFejZ7BEAwkXVqndiytIRqpfcdRnKvkCmmdPqdYsSJcdjaYMTXBRxzIIRrckCW3pXU5pV2FUsgFa48heVy793TIoocuSb4hsOrHgjRLOB6XSJ+nVa5msgZJU0xaTAGjVPMKBcplZcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728994210; c=relaxed/simple; bh=Q3XiHcfzULdJrfUg4110Z6fiCeK9ziUZUCiiP4+fqkE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WL9f1xBTJOtfuiMk0zWGO9Gw1oPJi7WrHwqAXCYQgvK24rJNZ+EsMhUPecfaeH41wZgdIEeE4n9yCwf0prjWuayaR4nSGGN54tGK0XvHjYP36E3L8orY9dTfbuqCbQR6fqlm/vC7nMglgcwnzcvPcfRC04g9Lqmxg3131NMyyjE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=wTsQ4XhB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="wTsQ4XhB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCAE6C4CEC6; Tue, 15 Oct 2024 12:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1728994210; bh=Q3XiHcfzULdJrfUg4110Z6fiCeK9ziUZUCiiP4+fqkE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wTsQ4XhBEVIdhiSAV1tR08ynzz4LhkmOKorjlhMB7JMh2UFoUK0lFGxG20K2uhVXt 0X9cg89jsj5lGyf0T9Z/H7hle6e3Z4d8FnIn6MJws2mVuq3tikxb6pbFSpL5FU8e0O C+/W0K2helmAG+DcsOFzhZBgLjiPRerrdGEGpk0E= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jonas Gorski , Florian Fainelli , Paolo Abeni , Sasha Levin Subject: [PATCH 5.15 638/691] net: dsa: b53: fix max MTU for BCM5325/BCM5365 Date: Tue, 15 Oct 2024 13:29:46 +0200 Message-ID: <20241015112505.650621290@linuxfoundation.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241015112440.309539031@linuxfoundation.org> References: <20241015112440.309539031@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jonas Gorski [ Upstream commit ca8c1f71c10193c270f772d70d34b15ad765d6a8 ] BCM5325/BCM5365 do not support jumbo frames, so we should not report a jumbo frame mtu for them. But they do support so called "oversized" frames up to 1536 bytes long by default, so report an appropriate MTU. Fixes: 6ae5834b983a ("net: dsa: b53: add MTU configuration support") Signed-off-by: Jonas Gorski Reviewed-by: Florian Fainelli Signed-off-by: Paolo Abeni Signed-off-by: Sasha Levin --- drivers/net/dsa/b53/b53_common.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c index be1550332326a..3aa0a60d7c71e 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -225,6 +225,7 @@ static const struct b53_mib_desc b53_mibs_58xx[] = { #define B53_MIBS_58XX_SIZE ARRAY_SIZE(b53_mibs_58xx) +#define B53_MAX_MTU_25 (1536 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) #define B53_MAX_MTU (9720 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) static int b53_do_vlan_op(struct b53_device *dev, u8 op) @@ -2237,6 +2238,11 @@ static int b53_change_mtu(struct dsa_switch *ds, int port, int mtu) static int b53_get_max_mtu(struct dsa_switch *ds, int port) { + struct b53_device *dev = ds->priv; + + if (is5325(dev) || is5365(dev)) + return B53_MAX_MTU_25; + return B53_MAX_MTU; } -- 2.43.0