lists.openwall.net   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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <d9ef2aeb-85b6-b5c9-da92-b6396d1557c5@smile.fr>
Date:   Fri, 3 Feb 2023 11:23:10 +0100
From:   Romain Naour <romain.naour@...le.fr>
To:     Alexandre Bard <alexandre.bard@...module.com>,
        grygorii.strashko@...com
Cc:     linux-omap@...r.kernel.org, davem@...emloft.net,
        edumazet@...gle.com, Jakub Kicinski <kuba@...nel.org>,
        pabeni@...hat.com, ast@...nel.org, daniel@...earbox.net,
        hawk@...nel.org, john.fastabend@...il.com,
        shaozhengchao@...wei.com, mw@...ihalf.com,
        wsa+renesas@...g-engineering.com, yangyingliang@...wei.com,
        chi.minghao@....com.cn,
        Alexandre Bard <alexandre.bard@...module.com>,
        netdev@...r.kernel.org
Subject: Re: [PATCH] net: ethernet: ti: cpsw: Set max and min MTU sizes

Hello,

Adding missing ML and maintainers in Cc.

Le 06/09/2022 à 13:32, Alexandre Bard a écrit :
> These fields need to be set in order for the userspace or DSA drivers to
> change the MTU to bigger or smaller values. They default to 68 and 1500
> respectively. Since the hardware supports wider limits, it is all
> benefit to set them.
> 
> Specially when connecting a DSA switch, the DSA code wants to set the
> MTU of the cpsw port to 1500 + tag size. This was failing without this
> change.

I had a similar issue with the cpsw_new driver (TI CPSW Switch Support with
switchdev):

eth0: mtu greater than device maximum
cpsw-switch 48484000.switch eth0: error -22 setting MTU to 1502 to include DSA
overhead

I did the same changes to allow setting the MTU on cpsw_new driver when used
with DSA switch.

Also I noticed that the am65-cpsw-nuss already initialize min_mtu and max_mtu [1].

[1]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/net/ethernet/ti/am65-cpsw-nuss.c?h=linux-6.1.y#n1981

Best regards,
Romain

> 
> Signed-off-by: Alexandre Bard <alexandre.bard@...module.com>
> ---
>  drivers/net/ethernet/ti/cpsw.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index ed66c4d4d830..83d8c6a8a527 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -1631,6 +1631,9 @@ static int cpsw_probe(struct platform_device *pdev)
>  
>  	eth_hw_addr_set(ndev, priv->mac_addr);
>  
> +	ndev->min_mtu = CPSW_MIN_PACKET_SIZE;
> +	ndev->max_mtu = CPSW_MAX_PACKET_SIZE;
> +
>  	cpsw->slaves[0].ndev = ndev;
>  
>  	ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_CTAG_RX;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ