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

2018-05-08 Thread Salvatore Mesoraca
2018-05-08 11:39 GMT+02:00 David Laight : > From: Salvatore Mesoraca >> Sent: 07 May 2018 20:03 > ... >> This optimization will save us an allocation when number of ports is >> less than 32 or 64 (depending on arch). >> IMHO it's useful, if you consider that, right now, DSA works only with >> 12-po

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

2018-05-08 Thread Salvatore Mesoraca
2018-05-07 21:26 GMT+02:00 Andrew Lunn : >> >> +++ b/include/net/dsa.h >> >> @@ -256,6 +256,9 @@ struct dsa_switch { >> >> /* Number of switch port queues */ >> >> unsigned intnum_tx_queues; >> >> >> >> + unsigned long *bitmap; >> >> + unsigned long

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

2018-05-08 Thread David Laight
From: Salvatore Mesoraca > Sent: 07 May 2018 20:03 ... > This optimization will save us an allocation when number of ports is > less than 32 or 64 (depending on arch). > IMHO it's useful, if you consider that, right now, DSA works only with > 12-ports switches. Why not just error out if the number

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

2018-05-07 Thread Andrew Lunn
> >> +++ b/include/net/dsa.h > >> @@ -256,6 +256,9 @@ struct dsa_switch { > >> /* Number of switch port queues */ > >> unsigned intnum_tx_queues; > >> > >> + unsigned long *bitmap; > >> + unsigned long _bitmap; > >> + > >> /* Dynamically all

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

2018-05-07 Thread Salvatore Mesoraca
2018-05-07 20:14 GMT+02:00 Florian Fainelli : > On 05/07/2018 08:23 AM, Salvatore Mesoraca wrote: >> We avoid 2 VLAs by using a pre-allocated field in dsa_switch. >> We also try to avoid dynamic allocation whenever possible. >> >> Link: >> http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6

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

2018-05-07 Thread Florian Fainelli
On 05/07/2018 08:23 AM, Salvatore Mesoraca wrote: > We avoid 2 VLAs by using a pre-allocated field in dsa_switch. > We also try to avoid dynamic allocation whenever possible. > > Link: > http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com > Link: http://lkm

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

2018-05-07 Thread Salvatore Mesoraca
We avoid 2 VLAs by using a pre-allocated field in dsa_switch. We also try to avoid dynamic allocation whenever possible. Link: http://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qpxydaacu1rq...@mail.gmail.com Link: http://lkml.kernel.org/r/20180505185145.gb32...@lunn.ch Signed-off-by: