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
| ||
|
Date: Wed, 29 Jun 2022 09:09:35 +0000 From: David Laight <David.Laight@...LAB.COM> To: 'Alexander Lobakin' <alexandr.lobakin@...el.com>, Albert Huang <huangjie.albert@...edance.com> CC: "David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Sebastian Andrzej Siewior <bigeasy@...utronix.de>, Menglong Dong <imagedong@...cent.com>, Petr Machata <petrm@...dia.com>, "Kumar Kartikeya Dwivedi" <memxor@...il.com>, Arnd Bergmann <arnd@...db.de>, "Antoine Tenart" <atenart@...nel.org>, Phil Auld <pauld@...hat.com>, "Frederic Weisbecker" <frederic@...nel.org>, Xin Long <lucien.xin@...il.com>, "netdev@...r.kernel.org" <netdev@...r.kernel.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org> Subject: RE: [PATCH] net : rps : supoort a single flow to use rps .... > I'd suggest to use some flags bitfield instead, so it would be way > more scalable and at the same time have the pre-determined size. Ar > per several LKML discussions, `bool` may have different size and > logics depending on architecture and compiler, so when using it not > on the stack inside a function, but in a structure, it might be not > easy then to track cacheline layout etc. > So, maybe > > unsigned long rps_flags; > #define RPS_SINGLE_FLOW_ENABLE BIT(0) > > or even > > DECLARE_BITMAP(rps_flags); > #define RPS_SINGLE_FLOW_ENABLE 0 I don't think BITMAPs are a good idea unless you really need a lot of bits and (probably) locked accesses. You can use C bitfields - the compiler doesn't (usually) make too much of a 'pigs breakfast' of them unless you needs to set/test multiple ones at the same time. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)
Powered by blists - more mailing lists