]> git.itanic.dy.fi Git - linux-stable/commit
ice: tc: allow zero flags in parsing tc flower
authorMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Fri, 15 Mar 2024 11:08:21 +0000 (12:08 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 16 Apr 2024 17:54:20 +0000 (10:54 -0700)
commit73278715725a8347032acf233082ca4eb31e6a56
treecfce0c0d752612809b9282e26d776e47c7ef3de7
parent428051600cb4e5a61d81aba3f8009b6c4f5e7582
ice: tc: allow zero flags in parsing tc flower

The check for flags is done to not pass empty lookups to adding switch
rule functions. Since metadata is always added to lookups there is no
need to check against the flag.

It is also fixing the problem with such rule:
$ tc filter add dev gtp_dev ingress protocol ip prio 0 flower \
enc_dst_port 2123 action drop
Switch block in case of GTP can't parse the destination port, because it
should always be set to GTP specific value. The same with ethertype. The
result is that there is no other matching criteria than GTP tunnel. In
this case flags is 0, rule can't be added only because of defensive
check against flags.

Fixes: 9a225f81f540 ("ice: Support GTP-U and GTP-C offload in switchdev")
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Tested-by: Sujai Buvaneswaran <sujai.buvaneswaran@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_tc_lib.c