Skip to content

Commit 402c506

Browse files
Marcin Szycikgregkh
Marcin Szycik
authored andcommitted
ice: Fix checking for unsupported keys on non-tunnel device
[ Upstream commit 2cca35f ] 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: 9e30098 ("ice: VXLAN and Geneve TC support") Reviewed-by: Michal Swiatkowski <[email protected]> Signed-off-by: Marcin Szycik <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Tested-by: Sujai Buvaneswaran <[email protected]> Signed-off-by: Tony Nguyen <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 02f3084 commit 402c506

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/net/ethernet/intel/ice/ice_tc_lib.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,10 @@ ice_parse_cls_flower(struct net_device *filter_dev, struct ice_vsi *vsi,
14891489
(BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV4_ADDRS) |
14901490
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IPV6_ADDRS) |
14911491
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_KEYID) |
1492-
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS))) {
1492+
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_PORTS) |
1493+
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_IP) |
1494+
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_OPTS) |
1495+
BIT_ULL(FLOW_DISSECTOR_KEY_ENC_CONTROL))) {
14931496
NL_SET_ERR_MSG_MOD(fltr->extack, "Tunnel key used, but device isn't a tunnel");
14941497
return -EOPNOTSUPP;
14951498
} else {

0 commit comments

Comments
 (0)