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  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 3 Aug 2020 22:27:35 +0200
From:   Andrew Lunn <andrew@...n.ch>
To:     Florian Fainelli <f.fainelli@...il.com>
Cc:     netdev@...r.kernel.org, Vivien Didelot <vivien.didelot@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>
Subject: Re: [PATCH net-next 2/5] net: dsa: loop: Support 4K VLANs

On Mon, Aug 03, 2020 at 01:03:51PM -0700, Florian Fainelli wrote:
> Allocate a 4K array of VLANs instead of limiting ourselves to just 5
> which is arbitrary.
> 
> Signed-off-by: Florian Fainelli <f.fainelli@...il.com>
> ---
>  drivers/net/dsa/dsa_loop.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/dsa/dsa_loop.c b/drivers/net/dsa/dsa_loop.c
> index 4a57238cdfd8..6e97b44c6f3f 100644
> --- a/drivers/net/dsa/dsa_loop.c
> +++ b/drivers/net/dsa/dsa_loop.c
> @@ -48,12 +48,10 @@ struct dsa_loop_port {
>  	u16 pvid;
>  };
>  
> -#define DSA_LOOP_VLANS	5
> -
>  struct dsa_loop_priv {
>  	struct mii_bus	*bus;
>  	unsigned int	port_base;
> -	struct dsa_loop_vlan vlans[DSA_LOOP_VLANS];
> +	struct dsa_loop_vlan vlans[VLAN_N_VID];
>  	struct net_device *netdev;
>  	struct dsa_loop_port ports[DSA_MAX_PORTS];

That is 4K x (2 x u16) = 16K RAM. I suppose for a test driver which is
never expected to be used in production, that is O.K.

Reviewed-by: Andrew Lunn <andrew@...n.ch>

    Andrew

Powered by blists - more mailing lists