Re: [PATCH] net: dsa: drop some VLAs in switch.c

2018-05-05 Thread Andrew Lunn
> > You could make the bitmap part of the dsa_switch structure. This is > > allocated by dsa_switch_alloc() and is passed the number of ports. > > Doing the allocation there means you don't need to worry about it > > failing in dsa_switch_mdb_add() or dsa_switch_vlan_add(). > > Are

Re: [PATCH] net: dsa: drop some VLAs in switch.c

2018-05-05 Thread Kees Cook
On Sat, May 5, 2018 at 8:39 AM, Andrew Lunn wrote: > On Sat, May 05, 2018 at 12:36:36PM +0200, Salvatore Mesoraca wrote: >> 2018-03-13 21:06 GMT+01:00 Florian Fainelli : >> > On 03/13/2018 12:58 PM, Vivien Didelot wrote: >> >> Hi Salvatore, >> >> >> >>

Re: [PATCH] net: dsa: drop some VLAs in switch.c

2018-05-05 Thread Andrew Lunn
On Sat, May 05, 2018 at 12:36:36PM +0200, Salvatore Mesoraca wrote: > 2018-03-13 21:06 GMT+01:00 Florian Fainelli : > > On 03/13/2018 12:58 PM, Vivien Didelot wrote: > >> Hi Salvatore, > >> > >> Salvatore Mesoraca writes: > >> > >>> dsa_switch's

Re: [PATCH] net: dsa: drop some VLAs in switch.c

2018-05-05 Thread Salvatore Mesoraca
2018-03-13 21:06 GMT+01:00 Florian Fainelli : > On 03/13/2018 12:58 PM, Vivien Didelot wrote: >> Hi Salvatore, >> >> Salvatore Mesoraca writes: >> >>> dsa_switch's num_ports is currently fixed to DSA_MAX_PORTS. So we avoid >>> 2 VLAs[1] by using

Re: [PATCH] net: dsa: drop some VLAs in switch.c

2018-03-18 Thread Salvatore Mesoraca
2018-03-14 13:48 GMT+01:00 Salvatore Mesoraca : > 2018-03-14 12:24 GMT+01:00 David Laight : >> Isn't using DECLARE_BITMAP() completely OTT when the maximum size is less >> than the number of bits in a word? > > It allocates ceiling(size/8) "unsigned

Re: [PATCH] net: dsa: drop some VLAs in switch.c

2018-03-14 Thread Salvatore Mesoraca
2018-03-14 12:24 GMT+01:00 David Laight : > Isn't using DECLARE_BITMAP() completely OTT when the maximum size is less > than the number of bits in a word? It allocates ceiling(size/8) "unsigned long"s, so yes.

RE: [PATCH] net: dsa: drop some VLAs in switch.c

2018-03-14 Thread David Laight
From: Salvatore Mesoraca > Sent: 13 March 2018 22:01 > 2018-03-13 20:58 GMT+01:00 Vivien Didelot > : > > Hi Salvatore, > > Hi Vivien, > > > Salvatore Mesoraca writes: > > > >> dsa_switch's num_ports is currently fixed to

Re: [PATCH] net: dsa: drop some VLAs in switch.c

2018-03-13 Thread Salvatore Mesoraca
2018-03-13 20:58 GMT+01:00 Vivien Didelot : > Hi Salvatore, Hi Vivien, > Salvatore Mesoraca writes: > >> dsa_switch's num_ports is currently fixed to DSA_MAX_PORTS. So we avoid >> 2 VLAs[1] by using DSA_MAX_PORTS instead of

Re: [PATCH] net: dsa: drop some VLAs in switch.c

2018-03-13 Thread Florian Fainelli
On 03/13/2018 12:58 PM, Vivien Didelot wrote: > Hi Salvatore, > > Salvatore Mesoraca writes: > >> dsa_switch's num_ports is currently fixed to DSA_MAX_PORTS. So we avoid >> 2 VLAs[1] by using DSA_MAX_PORTS instead of ds->num_ports. >> >> [1]

Re: [PATCH] net: dsa: drop some VLAs in switch.c

2018-03-13 Thread Vivien Didelot
Hi Salvatore, Salvatore Mesoraca writes: > dsa_switch's num_ports is currently fixed to DSA_MAX_PORTS. So we avoid > 2 VLAs[1] by using DSA_MAX_PORTS instead of ds->num_ports. > > [1] https://lkml.org/lkml/2018/3/7/621 > > Signed-off-by: Salvatore Mesoraca

[PATCH] net: dsa: drop some VLAs in switch.c

2018-03-13 Thread Salvatore Mesoraca
dsa_switch's num_ports is currently fixed to DSA_MAX_PORTS. So we avoid 2 VLAs[1] by using DSA_MAX_PORTS instead of ds->num_ports. [1] https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Salvatore Mesoraca --- net/dsa/switch.c | 4 ++-- 1 file changed, 2 insertions(+), 2