|
Message-ID: <9843d23677af411aa75a5fb24df3c97b@AcuMS.aculab.com> Date: Wed, 14 Mar 2018 11:24:30 +0000 From: David Laight <David.Laight@...LAB.COM> To: 'Salvatore Mesoraca' <s.mesoraca16@...il.com>, Vivien Didelot <vivien.didelot@...oirfairelinux.com> CC: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Kernel Hardening" <kernel-hardening@...ts.openwall.com>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "David S. Miller" <davem@...emloft.net>, "Andrew Lunn" <andrew@...n.ch>, Florian Fainelli <f.fainelli@...il.com>, Kees Cook <keescook@...omium.org> Subject: RE: [PATCH] net: dsa: drop some VLAs in switch.c From: Salvatore Mesoraca > Sent: 13 March 2018 22:01 > 2018-03-13 20:58 GMT+01:00 Vivien Didelot <vivien.didelot@...oirfairelinux.com>: > > Hi Salvatore, > > Hi Vivien, > > > Salvatore Mesoraca <s.mesoraca16@...il.com> 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 <s.mesoraca16@...il.com> > > > > NAK. > > > > We are in the process to remove hardcoded limits such as DSA_MAX_PORTS > > and DSA_MAX_SWITCHES, so we have to stick with ds->num_ports. > > I can rewrite the patch using kmalloc. > Although, if ds->num_ports will always be less than or equal to 12, it > should be better to > just use DSA_MAX_PORTS. Isn't using DECLARE_BITMAP() completely OTT when the maximum size is less than the number of bits in a word? David
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.