From: David Laight <David.Laight@ACULAB.COM>
To: 'Alexander Lobakin' <alexandr.lobakin@intel.com>,
Albert Huang <huangjie.albert@bytedance.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Menglong Dong <imagedong@tencent.com>,
Petr Machata <petrm@nvidia.com>,
"Kumar Kartikeya Dwivedi" <memxor@gmail.com>,
Arnd Bergmann <arnd@arndb.de>,
"Antoine Tenart" <atenart@kernel.org>,
Phil Auld <pauld@redhat.com>,
"Frederic Weisbecker" <frederic@kernel.org>,
Xin Long <lucien.xin@gmail.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] net : rps : supoort a single flow to use rps
Date: Wed, 29 Jun 2022 09:09:35 +0000 [thread overview]
Message-ID: <2ed297c680f24879aba6f15df7630b96@AcuMS.aculab.com> (raw)
In-Reply-To: <20220628152956.1407334-1-alexandr.lobakin@intel.com>
....
> 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)
next prev parent reply other threads:[~2022-06-29 9:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 14:00 Albert Huang
2022-06-28 15:29 ` Alexander Lobakin
2022-06-29 9:09 ` David Laight [this message]
2022-06-28 15:31 ` Eric Dumazet
2022-06-28 17:15 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2ed297c680f24879aba6f15df7630b96@AcuMS.aculab.com \
--to=david.laight@aculab.com \
--cc=alexandr.lobakin@intel.com \
--cc=arnd@arndb.de \
--cc=atenart@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=frederic@kernel.org \
--cc=huangjie.albert@bytedance.com \
--cc=imagedong@tencent.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lucien.xin@gmail.com \
--cc=memxor@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pauld@redhat.com \
--cc=petrm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®