[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240416134432.9527-1-ast@fiberby.net>
Date: Tue, 16 Apr 2024 13:44:30 +0000
From: Asbjørn Sloth Tønnesen <ast@...erby.net>
To: netdev@...r.kernel.org
Cc: Asbjørn Sloth Tønnesen <ast@...erby.net>,
linux-kernel@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>,
Paolo Abeni <pabeni@...hat.com>,
Edward Cree <ecree.xilinx@...il.com>,
Martin Habets <habetsm.xilinx@...il.com>,
linux-net-drivers@....com
Subject: [PATCH net-next] sfc: use flow_rule_no_unsupp_control_flags()
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@...erby.net>
---
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)
+
enum efx_encap_type efx_tc_indr_netdev_type(struct net_device *net_dev)
{
if (netif_is_vxlan(net_dev))
@@ -273,11 +277,9 @@ static int efx_tc_flower_parse_match(struct efx_nic *efx,
match->value.ip_firstfrag = fm.key->flags & FLOW_DIS_FIRST_FRAG;
match->mask.ip_firstfrag = true;
}
- if (fm.mask->flags & ~(FLOW_DIS_IS_FRAGMENT | FLOW_DIS_FIRST_FRAG)) {
- NL_SET_ERR_MSG_FMT_MOD(extack, "Unsupported match on control.flags %#x",
- fm.mask->flags);
+ if (!flow_rule_is_supp_control_flags(SFC_FLOWER_SUPPORTED_CTLFLAGS,
+ fm.mask->flags, extack))
return -EOPNOTSUPP;
- }
}
if (dissector->used_keys &
~(BIT_ULL(FLOW_DISSECTOR_KEY_CONTROL) |
--
2.43.0
Powered by blists - more mailing lists