From: Louis Peens <louis.peens@corigine.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: David Miller <davem@davemloft.net>,
Paolo Abeni <pabeni@redhat.com>, Hui Zhou <hui.zhou@corigine.com>,
netdev@vger.kernel.org, stable@vger.kernel.org,
oss-drivers@corigine.com
Subject: Re: [PATCH net 2/2] nfp: flower: fix hardware offload for the transfer layer port
Date: Tue, 12 Dec 2023 17:09:24 +0200 [thread overview]
Message-ID: <ZXh3pLA6/bI5vO4K@LouisNoVo> (raw)
In-Reply-To: <20231211190849.6c7d5246@kernel.org>
On Mon, Dec 11, 2023 at 07:08:49PM -0800, Jakub Kicinski wrote:
> On Fri, 8 Dec 2023 08:59:56 +0200 Louis Peens wrote:
> > + if (mangle_action->mangle.offset == offsetof(struct tcphdr, source)) {
> > + mangle_action->mangle.val =
> > + (__force u32)cpu_to_be32(mangle_action->mangle.val << 16);
> > + mangle_action->mangle.mask =
> > + (__force u32)cpu_to_be32(mangle_action->mangle.mask << 16 | 0xFFFF);
>
> This a bit odd. Here you fill in the "other half" of the mask with Fs...
>
> > + }
> > + if (mangle_action->mangle.offset == offsetof(struct tcphdr, dest)) {
> > + mangle_action->mangle.offset = 0;
> > + mangle_action->mangle.val =
> > + (__force u32)cpu_to_be32(mangle_action->mangle.val);
> > + mangle_action->mangle.mask =
> > + (__force u32)cpu_to_be32(mangle_action->mangle.mask);
> > + }
>
> .. but here you just let it be zero.
>
> If it's correct it'd be good to explain in the commit msg why.
Thanks for asking, it does indeed look a bit strange. It has to do with
act_ct using the inverse value of the mask, basically requiring a
rotate-left operation for the source field. It can definitely do with a
better explanation. Will submit a v2 doing so.
> --
> pw-bot: cr
prev parent reply other threads:[~2023-12-12 15:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-08 6:59 [PATCH net 0/2] nfp: flower: a few small conntrack offload fixes Louis Peens
2023-12-08 6:59 ` [PATCH net 1/2] nfp: flower: add hardware offload check for post ct entry Louis Peens
2023-12-08 6:59 ` [PATCH net 2/2] nfp: flower: fix hardware offload for the transfer layer port Louis Peens
2023-12-12 3:08 ` Jakub Kicinski
2023-12-12 15:09 ` Louis Peens [this message]
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=ZXh3pLA6/bI5vO4K@LouisNoVo \
--to=louis.peens@corigine.com \
--cc=davem@davemloft.net \
--cc=hui.zhou@corigine.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@corigine.com \
--cc=pabeni@redhat.com \
--cc=stable@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.