lkml.org 
[lkml]   [2022]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] net : rps : supoort a single flow to use rps
Date
....
> 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)

\
 
 \ /
  Last update: 2022-06-29 11:11    [W:0.058 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site