From: Stephen Hemminger <stephen@networkplumber.org>
To: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Cc: Gerhard Engleder <gerhard@engleder-embedded.com>,
<netdev@vger.kernel.org>, <bpf@vger.kernel.org>,
<davem@davemloft.net>, <kuba@kernel.org>, <edumazet@google.com>,
<pabeni@redhat.com>, <bjorn@kernel.org>,
<magnus.karlsson@intel.com>, <jonathan.lemon@gmail.com>
Subject: Re: [PATCH net-next v3 1/6] tsnep: Replace modulo operation with mask
Date: Thu, 20 Apr 2023 08:10:13 -0700 [thread overview]
Message-ID: <20230420081013.6e2040c5@hermes.local> (raw)
In-Reply-To: <ZEFKzuPKGRv0bO35@boxer>
On Thu, 20 Apr 2023 16:23:10 +0200
Maciej Fijalkowski <maciej.fijalkowski@intel.com> wrote:
> On Tue, Apr 18, 2023 at 09:04:54PM +0200, Gerhard Engleder wrote:
> > TX/RX ring size is static and power of 2 to enable compiler to optimize
> > modulo operation to mask operation. Make this optimization already in
> > the code and don't rely on the compiler.
>
> I think this came out of my review, so:
> Suggested-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
>
> Does this give you a minor perf boost?
If you change the loop counter to be unsigned, then Gcc (and Clang)
will optimize this into a mask operation. That is a better simpler fix.
If loop counter (i) is an integer, then compiler has keep the
potential for wrap around.
next prev parent reply other threads:[~2023-04-20 15:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 19:04 [PATCH net-next v3 0/6] tsnep: XDP socket zero-copy support Gerhard Engleder
2023-04-18 19:04 ` [PATCH net-next v3 1/6] tsnep: Replace modulo operation with mask Gerhard Engleder
2023-04-20 14:23 ` Maciej Fijalkowski
2023-04-20 15:10 ` Stephen Hemminger [this message]
2023-04-20 18:51 ` Gerhard Engleder
2023-04-20 18:40 ` Gerhard Engleder
2023-04-18 19:04 ` [PATCH net-next v3 2/6] tsnep: Rework TX/RX queue initialization Gerhard Engleder
2023-04-18 19:04 ` [PATCH net-next v3 3/6] tsnep: Add functions for queue enable/disable Gerhard Engleder
2023-04-18 19:04 ` [PATCH net-next v3 4/6] tsnep: Move skb receive action to separate function Gerhard Engleder
2023-04-18 19:04 ` [PATCH net-next v3 5/6] tsnep: Add XDP socket zero-copy RX support Gerhard Engleder
2023-04-20 19:46 ` Maciej Fijalkowski
2023-04-21 18:54 ` Gerhard Engleder
2023-04-18 19:04 ` [PATCH net-next v3 6/6] tsnep: Add XDP socket zero-copy TX support Gerhard Engleder
2023-04-20 20:17 ` Maciej Fijalkowski
2023-04-21 19:02 ` Gerhard Engleder
2023-04-24 12:03 ` Maciej Fijalkowski
2023-04-24 18:40 ` Gerhard Engleder
2023-04-20 20:19 ` [PATCH net-next v3 0/6] tsnep: XDP socket zero-copy support Maciej Fijalkowski
2023-04-21 19:05 ` Gerhard Engleder
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=20230420081013.6e2040c5@hermes.local \
--to=stephen@networkplumber.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gerhard@engleder-embedded.com \
--cc=jonathan.lemon@gmail.com \
--cc=kuba@kernel.org \
--cc=maciej.fijalkowski@intel.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).