From: Edward Cree <ecree.xilinx@gmail.com>
To: "Asbjørn Sloth Tønnesen" <ast@fiberby.net>, netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Martin Habets <habetsm.xilinx@gmail.com>,
linux-net-drivers@amd.com
Subject: Re: [PATCH net-next] sfc: use flow_rule_no_unsupp_control_flags()
Date: Tue, 16 Apr 2024 14:57:29 +0100 [thread overview]
Message-ID: <496dba36-1d40-e7d1-1250-a350bc590902@gmail.com> (raw)
In-Reply-To: <20240416134432.9527-1-ast@fiberby.net>
On 16/04/2024 14:44, Asbjørn Sloth Tønnesen wrote:
> Adopt nfp-style *_FLOWER_SUPPORTED_CTLFLAGS define.
>
> Change the check for unsupported control flags, to use the new helper
> flow_rule_is_supp_control_flags().
>
> Since the helper was based on sfc, then nothing really changes.
>
> Compile-tested, and compiled objects are identical.
>
> Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>
Subject line doesn't match the patch (I guess because the helper
got renamed).
> ---
> drivers/net/ethernet/sfc/tc.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/sfc/tc.c b/drivers/net/ethernet/sfc/tc.c
> index 82e8891a619a..5f73f1dea524 100644
> --- a/drivers/net/ethernet/sfc/tc.c
> +++ b/drivers/net/ethernet/sfc/tc.c
> @@ -21,6 +21,10 @@
> #include "ef100_rep.h"
> #include "efx.h"
>
> +#define SFC_FLOWER_SUPPORTED_CTLFLAGS \
> + (FLOW_DIS_IS_FRAGMENT | \
> + FLOW_DIS_FIRST_FRAG)
I'd rather keep the flags in-line, next to where they're actually
used. I.e. we have
if (flags & FRAGMENT)
blah;
if (flags & FIRST_FRAG)
foo;
if (!blah_supported(FRAGMENT | FIRST_FRAG))
return -EEK;
and it's very clear that anyone changing one of those parts also
needs to change the other. Whereas with your #define it's not
immediately obvious to someone reading the code where that set
of supported flags comes from conceptually.
-ed
next prev parent reply other threads:[~2024-04-16 13:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-16 13:44 Asbjørn Sloth Tønnesen
2024-04-16 13:57 ` Edward Cree [this message]
2024-04-16 14:11 ` Asbjørn Sloth Tønnesen
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=496dba36-1d40-e7d1-1250-a350bc590902@gmail.com \
--to=ecree.xilinx@gmail.com \
--cc=ast@fiberby.net \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=habetsm.xilinx@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-net-drivers@amd.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
Powered by JetHome