]> git.hungrycats.org Git - linux/commitdiff
ice: block LAN in case of VF to VF offload
authorMichal Swiatkowski <michal.swiatkowski@linux.intel.com>
Wed, 3 May 2023 15:39:35 +0000 (08:39 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 11:58:50 +0000 (13:58 +0200)
[ Upstream commit 9f699b71c2f31c51bd1483a20e1c8ddc5986a8c9 ]

VF to VF traffic shouldn't go outside. To enforce it, set only the loopback
enable bit in case of all ingress type rules added via the tc tool.

Fixes: 0d08a441fb1a ("ice: ndo_setup_tc implementation for PF")
Reported-by: Sujai Buvaneswaran <Sujai.Buvaneswaran@intel.com>
Signed-off-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Tested-by: George Kuruvinakunnel <george.kuruvinakunnel@intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/ice/ice_tc_lib.c

index ce72d512eddf9bad7478638cc56108d1b3dddf26..a9db9bdd72629c03e689cd622f00d14ed9ad75da 100644 (file)
@@ -693,17 +693,18 @@ ice_eswitch_add_tc_fltr(struct ice_vsi *vsi, struct ice_tc_flower_fltr *fltr)
         * results into order of switch rule evaluation.
         */
        rule_info.priority = 7;
+       rule_info.flags_info.act_valid = true;
 
        if (fltr->direction == ICE_ESWITCH_FLTR_INGRESS) {
                rule_info.sw_act.flag |= ICE_FLTR_RX;
                rule_info.sw_act.src = hw->pf_id;
                rule_info.rx = true;
+               rule_info.flags_info.act = ICE_SINGLE_ACT_LB_ENABLE;
        } else {
                rule_info.sw_act.flag |= ICE_FLTR_TX;
                rule_info.sw_act.src = vsi->idx;
                rule_info.rx = false;
                rule_info.flags_info.act = ICE_SINGLE_ACT_LAN_ENABLE;
-               rule_info.flags_info.act_valid = true;
        }
 
        /* specify the cookie as filter_rule_id */