diff options
| author | Asbjørn Sloth Tønnesen <[email protected]> | 2024-06-09 17:33:53 +0000 |
|---|---|---|
| committer | Jakub Kicinski <[email protected]> | 2024-06-13 00:56:00 +0000 |
| commit | 28d19ec9175534a6f4b38a042c3b83baf8563a8c (patch) | |
| tree | f7c9e141f3a3207c85441b3dcaef227144cc4ddd | |
| parent | sfc: use flow_rule_is_supp_enc_control_flags() (diff) | |
| download | kernel-28d19ec9175534a6f4b38a042c3b83baf8563a8c.tar.gz kernel-28d19ec9175534a6f4b38a042c3b83baf8563a8c.zip | |
net/mlx5e: flower: validate encapsulation control flags
Encapsulation control flags are currently not used anywhere,
so all flags are currently unsupported by all drivers.
This patch adds validation of this assumption, so that
encapsulation flags may be used in the future.
In case any encapsulation control flags are masked,
flow_rule_match_has_enc_control_flags() sets a NL extended
error message, and we return -EOPNOTSUPP.
Only compile tested.
Signed-off-by: Asbjørn Sloth Tønnesen <[email protected]>
Reviewed-by: Davide Caratti <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
| -rw-r--r-- | drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c index 8dfb57f712b0..721f35e59757 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun.c @@ -850,6 +850,12 @@ int mlx5e_tc_tun_parse(struct net_device *filter_dev, flow_rule_match_enc_control(rule, &match); addr_type = match.key->addr_type; + if (flow_rule_has_enc_control_flags(match.mask->flags, + extack)) { + err = -EOPNOTSUPP; + goto out; + } + /* For tunnel addr_type used same key id`s as for non-tunnel */ if (addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS) { struct flow_match_ipv4_addrs match; |
