From nobody Thu Nov 28 05:52:57 2024 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A578A12D75C; Fri, 4 Oct 2024 08:47:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031644; cv=none; b=miUIZFRk2Vcu6I1Eg7Ze67TFmM4N2yTTr4zHG9YG5UCnt5GcpXuuhNzwEPM6kh7oDPIXt4j1GAmBQj2SbQqEt48a5+dDkVr9Wit30rwd3BhsjaROxpk/BTBwmWs5+2usFJ1+Q0fe3RsYBSoQK/owZk7f+lANj9h9d8osTgpELG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031644; c=relaxed/simple; bh=j0XtbA1YPMsOZS43bikeDwYQnZjDGrbXyo6RiT0DM+4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gUHOxdQ6MEvFkdVMFBrljkTQ9M/nDQs03yn0ZKbcD53VXdjQrpBoqfVjR/atvJntpb/d7t7Xc4hEiGEujNeT5R7wbEIhcfJJS5W32hDpz4jI2g3sn3LIMb1mncYCBl/kXUHCU0IIVBdi51yz+H2Fxs9cOOCAg7ORzkcXiz5w6Lo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=W5TLBgmZ; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W5TLBgmZ" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a9909dff33dso282358066b.2; Fri, 04 Oct 2024 01:47:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728031641; x=1728636441; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=C+uHz6Z0oZxs3e/gFjzrIcQSJKe/mqrd8qVDDtx+4IY=; b=W5TLBgmZWeUSTSwqvaEttSt5wkpOei9wAQ21yVRc9MWDKgHPimCLmqCB9RsnIsYAej JYIV01mSrg3K4dvFsfot/pcTxGeUtUSJTbkUHdB5Wapiwb3vA3elT2PNci+434sLa+h4 f6AEnz5vWV5y5wZBMGfrdSugq2fT4p/6/hC8VfHgVckfbsJzW0cMrZhnPbeqk604xR2c tL8z5r6Bsi5uG5FsJX8r0G/wM/dbCv+uz70+Bh6nF2KChFyGZktnj0/E1EEcormmIBve ArlHO3mao5+JbjQrw+UFE1O2SkHFEClOyTAgn/KLOYL3JmFB3LuFist66iyRrdxe66LE Mjuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728031641; x=1728636441; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C+uHz6Z0oZxs3e/gFjzrIcQSJKe/mqrd8qVDDtx+4IY=; b=Y/yrOF3EoS3ZvhQuGE2xhko8fnnUkgJcQRburYciimd8QzBEeQsRAZoPAG7hFUuD4/ m2CeLzyhhULNmuCvY1YDU966HgEvgxwPE/G0ypqlyz+D57QHBiqboAOH8oAP/lJ7DeQF U3NExpqlfLwjGSmUTuRIpqkinWKLA1nKfZS6YgLs8ZazRBW/dpGtLhTgd0UAnl38RtD1 smhdSE/XpCzS0ikQG3rY/1Hwhq4nDcTrH/Pe27d3M+YAISgZnqYdg58oYZ/uqT96lNlE 4eecuLsryT5Zop+iUF5hIo1tm+LUL/t9ECIBEKACFFTCb6rCStS0+hqh7CfobBmg88fZ p8Fw== X-Forwarded-Encrypted: i=1; AJvYcCU/HS72tEJ5zPMm4c/Q5+VZems5XOKb4MvHXDtoBwZXyb3suVTPPV+bW7xm7jDzoU2t3krS6/G08VZhUB0=@vger.kernel.org, AJvYcCXtO2+vS5uOQurp/AzhULKrivrFsavKqTSjbM4oCwEDNtN44oLi+8aB8ebvdL6A9yscFMpivxfX@vger.kernel.org X-Gm-Message-State: AOJu0YzHcq1B3l/xxN4OpLU8caV3Gm0g3mXrdabEMXjmOlpCBHurYKXU 4AhTfIlIl0RKh8gIFxkoAjck4+PupOGwHaFzST72ArGxsIvgAjXZ X-Google-Smtp-Source: AGHT+IEl46L4EWrS8Bnqee5NjXf1xRSgBbnQtkszPPy2a+EUIAhdJea96nr4iYmvC8DoZjBnMmGhXA== X-Received: by 2002:a17:906:bc11:b0:a8d:446a:ded8 with SMTP id a640c23a62f3a-a991bd0b7ffmr190330966b.22.1728031640619; Fri, 04 Oct 2024 01:47:20 -0700 (PDT) Received: from localhost (dslb-002-200-173-220.002.200.pools.vodafone-ip.de. [2.200.173.220]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99100a3200sm197443266b.4.2024.10.04.01.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 01:47:20 -0700 (PDT) From: Jonas Gorski Date: Fri, 04 Oct 2024 10:47:17 +0200 Subject: [PATCH 1/5] net: dsa: b53: fix jumbo frame mtu check Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241004-b53_jumbo_fixes-v1-1-ce1e54aa7b3c@gmail.com> References: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> In-Reply-To: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> To: Florian Fainelli , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Murali Krishna Policharla , Russell King Cc: Florian Fainelli , Vladimir Oltean , netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 JMS_MIN_SIZE is the full ethernet frame length, while mtu is just the data payload size. Comparing these two meant that mtus between 1500 and 1518 did not trigger enabling jumbo frames. So instead compare the set mtu ETH_DATA_LEN, which is equal to JMS_MIN_SIZE - ETH_HLEN - ETH_FCS_LEN; Also do a check that the requested mtu is actually greater than the minimum length, else we do not need to enable jumbo frames. In practice this only introduced a very small range of mtus that did not work properly. Newer chips allow 2000 byte large frames by default, and older chips allow 1536 bytes long, which is equivalent to an mtu of 1514. So effectivly only mtus of 1515~1517 were broken. Fixes: 6ae5834b983a ("net: dsa: b53: add MTU configuration support") Signed-off-by: Jonas Gorski Reviewed-by: Florian Fainelli --- drivers/net/dsa/b53/b53_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_com= mon.c index 0783fc121bbbf979abe6c9985b10cf4379bf2a9b..57df00ad9dd4cedfe9e959ea779= d48e3f8f36142 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -2259,7 +2259,7 @@ static int b53_change_mtu(struct dsa_switch *ds, int = port, int mtu) if (!dsa_is_cpu_port(ds, port)) return 0; =20 - enable_jumbo =3D (mtu >=3D JMS_MIN_SIZE); + enable_jumbo =3D (mtu > ETH_DATA_LEN); allow_10_100 =3D (dev->chip_id =3D=3D BCM583XX_DEVICE_ID); =20 return b53_set_jumbo(dev, enable_jumbo, allow_10_100); --=20 2.43.0 From nobody Thu Nov 28 05:52:57 2024 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A7CAD13A3F3; Fri, 4 Oct 2024 08:47:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031645; cv=none; b=dOhxvBcK5/qep4HatLKxG/+FF9FUt7ob4/F7yWCsRBjDiyeSC50osFlp1IiYWx/0TraFhoKLgHGMFEp47rhxAh8DDTHKRVbvhQqC1CMQzFJZ4+9YsBZgsKF7YHP6yASIXL+Wpex0qloQirxTtLSTJ0Hfk21KLRSRGVXz4Rp/kXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031645; c=relaxed/simple; bh=jTh66IgRLQjsX7hB4c9hKpfNe7DSjLUfWjG3OR911dA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=RcNGoY9ELYPcX9k/3T6rjEPbDy9VjRr60P0uWZzgG8hRHncTL9iN8CEgI6x1kMd7e2hv3Fraj1+DrsmK93d69npBzqkaeMIRgHdylXQAWpxKjg1PuXkemkM5LXwF1heqsAy9/VABsvlIJ8E+UpoZ7RTeFGFMMX66sranbqSktJI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GA8MXLSK; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GA8MXLSK" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a98f6f777f1so237600666b.2; Fri, 04 Oct 2024 01:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728031642; x=1728636442; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=AWy1HOelWucrwLU1FdOaTSEr5fQCIepHI+fqfpA56Vk=; b=GA8MXLSKDrswRyXbXL0QyK9EjzJN0BeolmEWrFb7Zaqr0GmGh65ap3gMVsyJWQ/ZpV iuA7Wl+whsOWUWfQzBzJ2Dw+WUBIecU9ZhOgz0sYHerB5DhR5vqAC0htHZOxSFPiqR42 DyaIaJhu2ho349+729TCznGHBS6W3jZAF1vVdo6FDc3y7J7HuUYIA5Ebflo8smjGFgyz oK95HJWoN4Ht4RP1w8mEEEu2k9kRM9m1U73bx4tej9QnF9NruQmC5FcUgpAR3iIN6Tfb gUJ7kHZ+6sf+/GyvmFHdPTPl0HaFFerYu466Cb2t8E1zWSzmTrpxcx0M68J2o+k2rZUP I5Mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728031642; x=1728636442; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AWy1HOelWucrwLU1FdOaTSEr5fQCIepHI+fqfpA56Vk=; b=Pv69gKbuWCKuR4sCWWxt8/zwfG1SndW8vygkAMVh99+lTZ8aCGY3qwNvxwYknhaBF0 ir9exFRm239D+VMApdC9EBVxJZBfw/8YpaDC7LBeCzgfLoDVphLQuYX5BTxacyDYjeOB VMbYklo0hBNNtaABvb0T4uDwS/CcegFci3vrnVb7DVN2ShsOY2eMZVYRS2hA88U34pY5 aqc6EvWiPQPw+b68KSsYvmV3mMw/z2E7hd8AlgQbBGg7CwzC0mq03lRQHINWIxOpTH9C vIwkuVCVKryTMYkfUMZKojtjTLWf7Ix+sWl8byAhZNsnSNTjNCGtTyZl7zbkF3CAnBto wV4w== X-Forwarded-Encrypted: i=1; AJvYcCUutgtEuFc4vXTXLHJt1peaTX2Z/s70YDF9ekZWIyEI7tzyk+tQbz9CxZ19k3yB0ZQTEQpygVGO@vger.kernel.org, AJvYcCWe+KdlTzWXvzl961F1sFfHUISMx91VCYGAwaoSMeqhi7tzZAwe4bNu9tZ7UKKXjEQTDwwRKqVXnV4pjZc=@vger.kernel.org X-Gm-Message-State: AOJu0YxQ7KeLRV2/uNJrzyVSn0SfO4gcDH+H9lMd2+gNNy5R7/d/OPMp WoDZmuVwZ6cWVlPpfJW4a9KMGJsN+5zBI18vlkvZ6WP+r22lVN+2 X-Google-Smtp-Source: AGHT+IF+aP8ZBwo7hXQaad4Bg37iehaODpZwoGcfC4cTbdS3RPR7MjSunrxUvCNnYsxZqvYMe7dNRA== X-Received: by 2002:a17:907:7d87:b0:a8a:792c:4116 with SMTP id a640c23a62f3a-a991c031850mr167621066b.40.1728031641675; Fri, 04 Oct 2024 01:47:21 -0700 (PDT) Received: from localhost (dslb-002-200-173-220.002.200.pools.vodafone-ip.de. [2.200.173.220]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9910472452sm195062766b.160.2024.10.04.01.47.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 01:47:21 -0700 (PDT) From: Jonas Gorski Date: Fri, 04 Oct 2024 10:47:18 +0200 Subject: [PATCH 2/5] net: dsa: b53: fix max MTU for 1g switches Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241004-b53_jumbo_fixes-v1-2-ce1e54aa7b3c@gmail.com> References: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> In-Reply-To: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> To: Florian Fainelli , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Murali Krishna Policharla , Russell King Cc: Florian Fainelli , Vladimir Oltean , netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 JMS_MAX_SIZE is the ethernet frame length, not the MTU, which is payload without ethernet headers. According to the datasheets maximum supported frame length for most gigabyte swithes is 9720 bytes, so convert that to the expected MTU when using VLAN tagged frames. Fixes: 6ae5834b983a ("net: dsa: b53: add MTU configuration support") Signed-off-by: Jonas Gorski Reviewed-by: Florian Fainelli --- drivers/net/dsa/b53/b53_common.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_com= mon.c index 57df00ad9dd4cedfe9e959ea779d48e3f8f36142..6fed3eb15ad9b257c6fc3da20ce= 91b5e7129884c 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -27,6 +27,7 @@ #include #include #include +#include #include =20 #include "b53_regs.h" @@ -224,6 +225,8 @@ static const struct b53_mib_desc b53_mibs_58xx[] =3D { =20 #define B53_MIBS_58XX_SIZE ARRAY_SIZE(b53_mibs_58xx) =20 +#define B53_MAX_MTU (9720 - ETH_HLEN - VLAN_HLEN - ETH_FCS_LEN) + static int b53_do_vlan_op(struct b53_device *dev, u8 op) { unsigned int i; @@ -2267,7 +2270,7 @@ static int b53_change_mtu(struct dsa_switch *ds, int = port, int mtu) =20 static int b53_get_max_mtu(struct dsa_switch *ds, int port) { - return JMS_MAX_SIZE; + return B53_MAX_MTU; } =20 static const struct phylink_mac_ops b53_phylink_mac_ops =3D { --=20 2.43.0 From nobody Thu Nov 28 05:52:57 2024 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8DD05140E50; Fri, 4 Oct 2024 08:47:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031646; cv=none; b=Ry9JSXgddRhdq2Z9/Bo/CkDS1lbrI6syA39uI17SVs2XLBmfKjGe/i4SFTtIQhyTgMR746X4oDf2E3EUPAz5sNENqBpA07lshtC/Os3YQm4CwbwL66np9+gPKCGcOu1tQXGdwZiIl4DLi3Kkh8WWz0Q3DGBqkfqYcwa4OKrMmB8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031646; c=relaxed/simple; bh=P9wuLNQOG/5s+jwON9IQ6s1tR3bwQp/Iv2WmnheCJSE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=rn2BbuL27znfcq+CRc40blgyCARMcd+/mKG23j3CvJ9mQ5NfCvMCO/G0Ll3YTg+l5lj8Gr0D9ipnEqGGIE2GkWnBS2g6yDmzhvL23vqdZB5Z0r/MfudsO+OtwE59BT/hxPYbdwuDjZSGq2YycjUDp5YKf08B5KH96VmYqXyXYJg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mf2rnmMG; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mf2rnmMG" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a8d4979b843so242392266b.3; Fri, 04 Oct 2024 01:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728031643; x=1728636443; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=D38nqKoK1ux2JviUHAQPhRsrpRaAlCKK193uos3igZg=; b=mf2rnmMG0ORk8zO9CkgH3z7qIETXwCeerk5hTUeqvLn3uxayygWUvY92KAyHLvQOpd KsvD/np5mS8BE353i5tsAgItHlvrtSu6TezFok4md/Ftd8paQkhqmwnr0LHiP/rSRoPe EHGzFhzKcN6u8XE0OG8Pih1v8foXEnnFvpMYFHO++N9SwJNyzQyinqwh3eMaXmUhUlU0 OASd7ZeGowass24+QBt+7UjWD0cZSIbhT+h9S29PSorezRs+ZCTFyWCaRShr9TerwBCL iS1dbnOOF/UhcdbwVipCZwjmv1PLzWxfNUwyGcLXRBZaE2UmTaRDvoNMuF5QA2N7d6UQ yO9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728031643; x=1728636443; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D38nqKoK1ux2JviUHAQPhRsrpRaAlCKK193uos3igZg=; b=eqj5nEWNrzeP6/nB5PrhlqHTz7DwoGeUQblbY8xiIeV+3HTTHHj4z+pERt07tp5Sz1 nnLjKYM+twkBPa7zrsEIm4da1eorpaZz7uo7OWyG0lUOIMZA9WVMzHJWk441XJP2rgxH 7tyWv7kkRUUj1S5i5hnD1gVpUfgVv+nNMsskSiMwq+mcOmyXCTHFlQcj2uDpTWHVy6KS s6CvLT8D6QaCTwZJOjPhBISWmZPUZaD+cuSCuNBupbrHVIwHytnh7IA48hlVgOhq4cHz Txi4VuBwYcTwnQhccOXHFdmLjy0SUukaJaHxFaj/r2SWKWOsqeEmBF/Z7IndzpTlR1vc wNbw== X-Forwarded-Encrypted: i=1; AJvYcCUy7uDa3MOqtQbFIG/9xvTNEoV8kT+785CnUZQwqHW9ywr739vhwZRj00cBtKboZ6AjiEZdh96Aw+ZIaX0=@vger.kernel.org, AJvYcCVXDwR27jbuP0vCQ0BMbQqMPz1Jl1lGo5kRB04tbVPGAvLlHM+1QZWtU61L/DaqMXYV+Mkf3wpM@vger.kernel.org X-Gm-Message-State: AOJu0Yy69/bXUgNh/Z+Sr461kUwkGLab7aenZdnl4kUIf7Isu4Jye/3D 28LshZ5GDyCr0pxbTTVzQCuFvHZPjcZB2zKwpvQiEaLFZ1cTTt4M X-Google-Smtp-Source: AGHT+IEyNFGFbaLkz8WwbwnKJiT7KOBXzOt3HDdVavFYWXhrrOvldv2qfc0R8oBSM1CGKfd5URrn5w== X-Received: by 2002:a17:907:c8a6:b0:a8d:5e1a:8d80 with SMTP id a640c23a62f3a-a991bfd8735mr169546466b.40.1728031642694; Fri, 04 Oct 2024 01:47:22 -0700 (PDT) Received: from localhost (dslb-002-200-173-220.002.200.pools.vodafone-ip.de. [2.200.173.220]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99104d2e1esm192631566b.212.2024.10.04.01.47.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 01:47:22 -0700 (PDT) From: Jonas Gorski Date: Fri, 04 Oct 2024 10:47:19 +0200 Subject: [PATCH 3/5] net: dsa: b53: fix max MTU for BCM5325/BCM5365 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241004-b53_jumbo_fixes-v1-3-ce1e54aa7b3c@gmail.com> References: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> In-Reply-To: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> To: Florian Fainelli , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Murali Krishna Policharla , Russell King Cc: Florian Fainelli , Vladimir Oltean , netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 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 --- 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_com= mon.c index 6fed3eb15ad9b257c6fc3da20ce91b5e7129884c..e8b20bfa8b83ea7ac643bd5d005= e2983747bd478 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[] =3D { =20 #define B53_MIBS_58XX_SIZE ARRAY_SIZE(b53_mibs_58xx) =20 +#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) =20 static int b53_do_vlan_op(struct b53_device *dev, u8 op) @@ -2270,6 +2271,11 @@ static int b53_change_mtu(struct dsa_switch *ds, int= port, int mtu) =20 static int b53_get_max_mtu(struct dsa_switch *ds, int port) { + struct b53_device *dev =3D ds->priv; + + if (is5325(dev) || is5365(dev)) + return B53_MAX_MTU_25; + return B53_MAX_MTU; } =20 --=20 2.43.0 From nobody Thu Nov 28 05:52:57 2024 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93F39145B11; Fri, 4 Oct 2024 08:47:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031647; cv=none; b=H8LyhWiUFWyDjyyXJfd85+GOP+6JPrC+J5l+R5yxZdRsOI+RcQLp60jdHezwYc8hrkutqVBMvXH6QVxo52HF0p4AHs22Fiwmjj50l/S66dlcxxPgwoWGqIHLKwz/AY/somg8TiiYiZ59Jox8udYos3KbAmhBmOG4M9YjVoFXNJ0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031647; c=relaxed/simple; bh=j7NqwbTnVxIUEVTmygyIBlIdF969CaRsDuZhjwQOqXs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=i68269rjop9/HOWWbdqIFluUF1rm1KSJHWoUC0pLIL5juT40T1uJsVFx2h0HIqJc6h69S5NyyaxlATjKBhGeXodQ9lyZo+y1Z2jun6kw0cTycf064wpUvOFHB9tKfyrD9XCVQTF2SVskFu5Fs4lsJIeFmxF3XyaXGVuXMcB+in4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MLgNS2+I; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MLgNS2+I" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a910860e4dcso292369366b.3; Fri, 04 Oct 2024 01:47:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728031644; x=1728636444; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=racJq7e+9AJGmfIQ1lL/nf+MMw3QEk3WLoauzMkQtwo=; b=MLgNS2+Io+aW4WQxEe4sOes/d1sPvoe+ixQyT3Altbdh//FO4YFWlGhFmxJ5QJbj42 0W9M3LjIMw8mXRpfbycXiGhJOSSqpbCpli/tM9L638rVaWCui1AgLH3kU8RfCRMoOte5 g0eVkt2k+uA5c+XcPqPY+XsRqFRnLhwT9K5R32NoSqhd75LK1BlblBYneYSy94S/C49f IYENrE2Y6VsLb0BpTBVo4utCp2L9CKA3A7gFLL0J5WT9q/TOFZuTINRQANs5oRBP0UXS zvuLnMamYRK820sx5+Tf4UOc5v5DARpdyXSVeeoa6px8infsqc0QiQEdHyiWwwz7Q7WW 837Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728031644; x=1728636444; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=racJq7e+9AJGmfIQ1lL/nf+MMw3QEk3WLoauzMkQtwo=; b=lrTnDyRMbs3sgmz0EGqO7+62//ge82FSBEbRG88JJUSL0XHeBH9/4+vDHnmjn2yvko DQZndHcOGiVkfwxtz/OHEcQEE1pAC16ywNP1Auz9ZUMADZonEcakbosNwTKPiRzbl1dT zD2v0Wf2Zuw7IPIR69Eb4ak19OSMVHgcn1rQ64xTO6k/nyXLI8X+jhzf/jzC5jB1LVpM 3WPBaXLFyB/or4WMKVeaElufJ4PEsSWGxlFRhqn40dsQBWsoWTYXCY+Tdl4rlUxc0mMx lbZiuDgLtnzGY6Hqm2sLeGpR91hgEFPNvGZmfuFYq/khYpNulsmYJ536KuiVLImEyTf8 LJqA== X-Forwarded-Encrypted: i=1; AJvYcCV7kZDTzmqG6pmbCtzFkI1cXaQtDmseHt1AqjVbCtorF7T3vfbhntt90Wci+GWA7r3ffaShTXWbyMOTH0I=@vger.kernel.org, AJvYcCXPfm/lvtBbOTXmov01Y7KBOnRc3LSZfyZ2SEPJXjDmSm8SrsNyVO7M0EoUtH9sTLdGHmWxdcyi@vger.kernel.org X-Gm-Message-State: AOJu0YzpPKemKn4g6zFepvfqWkepWRy+zXvjjxJVpZqRSUfDa3wlZsh9 NcRax5tw4VxnoqnSM9Wgp3a/nvtcRaJAVlrKKSnqnaS79oyit89z X-Google-Smtp-Source: AGHT+IH9OyhqyRF3bk4sckJbV+DGqsosIRPef0/ga6rlhmByHuEDY2cS319Nnvi/yOUZil35KPIcaQ== X-Received: by 2002:a17:907:9281:b0:a7a:97ca:3056 with SMTP id a640c23a62f3a-a991bd0a833mr205072766b.16.1728031643748; Fri, 04 Oct 2024 01:47:23 -0700 (PDT) Received: from localhost (dslb-002-200-173-220.002.200.pools.vodafone-ip.de. [2.200.173.220]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a99102a998esm193869466b.94.2024.10.04.01.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 01:47:23 -0700 (PDT) From: Jonas Gorski Date: Fri, 04 Oct 2024 10:47:20 +0200 Subject: [PATCH 4/5] net: dsa: b53: allow lower MTUs on BCM5325/5365 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241004-b53_jumbo_fixes-v1-4-ce1e54aa7b3c@gmail.com> References: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> In-Reply-To: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> To: Florian Fainelli , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Murali Krishna Policharla , Russell King Cc: Florian Fainelli , Vladimir Oltean , netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 While BCM5325/5365 do not support jumbo frames, they do support slightly oversized frames, so do not error out if requesting a supported MTU for them. Fixes: 6ae5834b983a ("net: dsa: b53: add MTU configuration support") Signed-off-by: Jonas Gorski Reviewed-by: Florian Fainelli --- drivers/net/dsa/b53/b53_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_com= mon.c index e8b20bfa8b83ea7ac643bd5d005e2983747bd478..5b83f9b6cdac3de6c5e6e2164c7= 8146d694674cd 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -2258,7 +2258,7 @@ static int b53_change_mtu(struct dsa_switch *ds, int = port, int mtu) bool allow_10_100; =20 if (is5325(dev) || is5365(dev)) - return -EOPNOTSUPP; + return 0; =20 if (!dsa_is_cpu_port(ds, port)) return 0; --=20 2.43.0 From nobody Thu Nov 28 05:52:57 2024 Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6533146D7E; Fri, 4 Oct 2024 08:47:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031648; cv=none; b=YNzsVcNZhCOOCDsxZIbSCio2ugYMCZOP/4YZ0jeqa1gHRAOd+pt0FoyyaOKVMoGT3Sl2wlF4VQdO1BdGveg7HJ5huYWqtB0YZAwD0eKrVjrqokperAugaXdlHiFfUMgnKsOdxF9OtdwjPK7Y3MCiMvRiP2cAC86IpvTXQBaJ5lU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728031648; c=relaxed/simple; bh=WrttW4soaNRNeFDh1G7yiAsAT1m0YpQGlJh37KDgp9k=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=BexI051ZDe3MfW/hzNK/4JtQJPXaVUlb4+ohxMc1TJd0xF0dsAuKOSpjNtd8fptOhxA0ONBdRctLWc8OHCw9mIg9UUkkTmHWwRgqT31DU5lfuQeJzu5yVUY9NV3GMmz5itJ69bIqfKa1AIl+VbrXgirR7d7Mt1H5Lrq3w+1/Kc4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=GnAdldZo; arc=none smtp.client-ip=209.85.218.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="GnAdldZo" Received: by mail-ej1-f52.google.com with SMTP id a640c23a62f3a-a8d2b24b7a8so554659266b.1; Fri, 04 Oct 2024 01:47:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728031645; x=1728636445; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EmV9RYJBwVbGt572Wu2QKdQNVKD66Br50FGjDXtR6Z4=; b=GnAdldZodCn/BF2Xn6h8MJdbMZC9UA7fNTyOYQetDCQJ0OYoKTkaRIO4qWqqObsbCv /vElG3VaxOKqv4Qb7RuxYmvZhXaFjgrd/DyqkAjfYTdH/eNVgL8wlCjDlbsj2Xcnj54F RoqrvjLSo2AlX5NVMHZ3Jyw2cMx5hvxttfhwh+X6P/psYEqh+EAncyC+2j+G3IPboLIL oRFqF/+d0ypDmd2Vz3CuWOy4oFY4ENUzCeUljp7mQzh/IUGx36XCtLqRP15iLwIgyUEv OHmZYO3UZz9MV+ChWHBJZDjGok9haYiPRcgJ3F1NQaMVj1KqdCC2mo9cCI9asKSc8fff cIjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728031645; x=1728636445; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EmV9RYJBwVbGt572Wu2QKdQNVKD66Br50FGjDXtR6Z4=; b=twT7BGxXVLUmBlVD1TAYgh78F1+3CvjuS/rh1pUSEY6l2VesI8eiZp6QYYcpPvYYYr Ln3rXxTLsHpj4wJ3hNuZBZHzdVAyPtvu2H91KuzkdzHZTgGfHFjtcqTXuRUnVzhN+H4Z 4IwEzMm7/4Z5Avmp4RhB7BrKVJtwuaVSu35zLDGRHeDJWGRHzjIELTcqZVfPjYZN1JHt JjnOvngmK/fVHzYW14PA8tUyDDomd1A1luFwkblw5M1XmLgKNCNG9NR1KEH4dqN16/XH Zm9l5t/DKXXhLM2FFo2f6yNcxfvD8fT2ASwouUZQrcqZRlOX24avlIGGWjJ8oFEDirI9 9/DQ== X-Forwarded-Encrypted: i=1; AJvYcCUK6geMJnxk5dBB2IzlJN1ichPlQXmJirGvWtnLvDc5fu2fuoJnj1d7fvYCzgFGQeAcVrL/EsrH@vger.kernel.org, AJvYcCXTQoSS9B/fDDxenOV9O8fFK+2tHVaricb1QgG5+c+PZmGcYtYxdYDE0MzxgYS2vb7VdhF+KDtnAumQWZk=@vger.kernel.org X-Gm-Message-State: AOJu0YxXxRWeSR2j0Z93Yxymv8rNUPOS4nwtWReo+sdRz+zelQTbA+3K ah6tgA/58b5XSy272QWiCHb1vzzQTi+a2ZXJG+sRnITS/+g6adnE X-Google-Smtp-Source: AGHT+IEdiuCNJY+e+Qi4o2XoAyut/1S9hpI/xHgeuu7ykahW5fp61ZS61OqxId16MWjakDnvbXt/cw== X-Received: by 2002:a17:907:1c05:b0:a98:c4b7:7971 with SMTP id a640c23a62f3a-a990a23d7famr608823266b.32.1728031644866; Fri, 04 Oct 2024 01:47:24 -0700 (PDT) Received: from localhost (dslb-002-200-173-220.002.200.pools.vodafone-ip.de. [2.200.173.220]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a991027ffe9sm193521366b.51.2024.10.04.01.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Oct 2024 01:47:24 -0700 (PDT) From: Jonas Gorski Date: Fri, 04 Oct 2024 10:47:21 +0200 Subject: [PATCH 5/5] net: dsa: b53: fix jumbo frames on 10/100 ports Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241004-b53_jumbo_fixes-v1-5-ce1e54aa7b3c@gmail.com> References: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> In-Reply-To: <20241004-b53_jumbo_fixes-v1-0-ce1e54aa7b3c@gmail.com> To: Florian Fainelli , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Murali Krishna Policharla , Russell King Cc: Florian Fainelli , Vladimir Oltean , netdev@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.14.2 All modern chips support and need the 10_100 bit set for supporting jumbo frames on 10/100 ports, so instead of enabling it only for 583XX enable it for everything except bcm63xx, where the bit is writeable, but does nothing. Tested on BCM53115, where jumbo frames were dropped at 10/100 speeds without the bit set. Fixes: 6ae5834b983a ("net: dsa: b53: add MTU configuration support") Signed-off-by: Jonas Gorski Reviewed-by: Florian Fainelli --- drivers/net/dsa/b53/b53_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_com= mon.c index 5b83f9b6cdac3de6c5e6e2164c78146d694674cd..c39cb119e760db5fcbfaaf44abe= 033f6977e7005 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -2264,7 +2264,7 @@ static int b53_change_mtu(struct dsa_switch *ds, int = port, int mtu) return 0; =20 enable_jumbo =3D (mtu > ETH_DATA_LEN); - allow_10_100 =3D (dev->chip_id =3D=3D BCM583XX_DEVICE_ID); + allow_10_100 =3D !is63xx(dev); =20 return b53_set_jumbo(dev, enable_jumbo, allow_10_100); } --=20 2.43.0