ice: Fix checking for unsupported keys on non-tunnel device
authorMarcin Szycik <marcin.szycik@linux.intel.com>
Tue, 9 Apr 2024 15:45:44 +0000 (17:45 +0200)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 16 Apr 2024 17:55:25 +0000 (10:55 -0700)
commit2cca35f5dd78b9f8297c879c5db5ab137c5d86c3
tree93c8a192d999ed784e9d32aabdf2011e9d767f22
parent73278715725a8347032acf233082ca4eb31e6a56
ice: Fix checking for unsupported keys on non-tunnel device

Add missing FLOW_DISSECTOR_KEY_ENC_* checks to TC flower filter parsing.
Without these checks, it would be possible to add filters with tunnel
options on non-tunnel devices. enc_* options are only valid for tunnel
devices.

Example:
  devlink dev eswitch set $PF1_PCI mode switchdev
  echo 1 > /sys/class/net/$PF1/device/sriov_numvfs
  tc qdisc add dev $VF1_PR ingress
  ethtool -K $PF1 hw-tc-offload on
  tc filter add dev $VF1_PR ingress flower enc_ttl 12 skip_sw action drop

Fixes: 9e300987d4a8 ("ice: VXLAN and Geneve TC support")
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: Marcin Szycik <marcin.szycik@linux.intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
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