lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 21 Jul 2021 14:05:38 -0700
From:   Colin Foster <>
To:     Grygorii Strashko <>,
        "David S. Miller" <>,
        Jakub Kicinski <>
Subject: [RFC PATCH v1 net-next 1/1] net: ethernet: ti: cpsw: allow MTU > 1500 when overridden by module parameter

The module parameter rx_packet_max can be overridden at module load or
boot args. But it doesn't adjust the max_mtu for the device accordingly.

If a CPSW device is to be used in a DSA architecture, increasing the
MTU by small amounts to account for switch overhead becomes necessary.
This way, a boot arg of cpsw.rx_packet_max=1600 should allow the MTU
to be increased to values of 1520, which is necessary for DSA tagging
protocols like "ocelot" and "seville".

Signed-off-by: Colin Foster <>
 drivers/net/ethernet/ti/cpsw.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index c0cd7de88316..d400163c4ef2 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1625,6 +1625,14 @@ static int cpsw_probe(struct platform_device *pdev)
 		goto clean_cpts;
+	/* adjust max_mtu to match module parameter rx_packet_max */
+	if (cpsw->rx_packet_max > CPSW_MAX_PACKET_SIZE) {
+		ndev->max_mtu = ETH_DATA_LEN + (cpsw->rx_packet_max -
+		dev_info(dev, "overriding default MTU to %d\n\n",
+			 ndev->max_mtu);
+	}
 	priv = netdev_priv(ndev);
 	priv->cpsw = cpsw;
 	priv->ndev = ndev;

Powered by blists - more mailing lists