lkml.org 
[lkml]   [2024]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH net-next] mlxsw: spectrum_flower: validate control flags
On Wed, Apr 17, 2024 at 01:51:20PM +0000, Asbjørn Sloth Tønnesen wrote:
> This driver currently doesn't support any control flags.
>
> Use flow_rule_has_control_flags() to check for control flags,
> such as can be set through `tc flower ... ip_flags frag`.
>
> In case any control flags are masked, flow_rule_has_control_flags()
> sets a NL extended error message, and we return -EOPNOTSUPP.
>
> Only compile-tested.
>
> Signed-off-by: Asbjørn Sloth Tønnesen <ast@fiberby.net>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Tested-by: Ido Schimmel <idosch@nvidia.com>

Without patch:

+ tc qdisc add dev swp1 clsact
+ tc filter add dev swp1 ingress pref 1 proto ip flower skip_sw ip_flags frag action drop
+ tc filter add dev swp1 ingress pref 1 proto ip flower skip_sw ip_flags nofrag action drop
+ tc filter add dev swp1 ingress pref 1 proto ip flower skip_sw ip_flags firstfrag action drop
+ tc filter add dev swp1 ingress pref 1 proto ip flower skip_sw ip_flags nofirstfrag action drop

With patch:

+ tc qdisc add dev swp1 clsact
+ tc filter add dev swp1 ingress pref 1 proto ip flower skip_sw ip_flags frag action drop
Error: mlxsw_spectrum: Unsupported match on control.flags 0x1.
We have an error talking to the kernel
+ tc filter add dev swp1 ingress pref 1 proto ip flower skip_sw ip_flags nofrag action drop
Error: mlxsw_spectrum: Unsupported match on control.flags 0x1.
We have an error talking to the kernel
+ tc filter add dev swp1 ingress pref 1 proto ip flower skip_sw ip_flags firstfrag action drop
Error: mlxsw_spectrum: Unsupported match on control.flags 0x2.
We have an error talking to the kernel
+ tc filter add dev swp1 ingress pref 1 proto ip flower skip_sw ip_flags nofirstfrag action drop
Error: mlxsw_spectrum: Unsupported match on control.flags 0x2.
We have an error talking to the kernel

Thanks!

\
 
 \ /
  Last update: 2024-04-17 19:06    [W:0.057 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site