aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/ice/ice_switch.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_switch.c')
-rw-r--r--drivers/net/ethernet/intel/ice/ice_switch.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_switch.c b/drivers/net/ethernet/intel/ice/ice_switch.c
index 40c9c6558956..107ca08899b6 100644
--- a/drivers/net/ethernet/intel/ice/ice_switch.c
+++ b/drivers/net/ethernet/intel/ice/ice_switch.c
@@ -629,25 +629,36 @@ enum ice_status ice_get_initial_sw_cfg(struct ice_hw *hw)
629/** 629/**
630 * ice_fill_sw_info - Helper function to populate lb_en and lan_en 630 * ice_fill_sw_info - Helper function to populate lb_en and lan_en
631 * @hw: pointer to the hardware structure 631 * @hw: pointer to the hardware structure
632 * @f_info: filter info structure to fill/update 632 * @fi: filter info structure to fill/update
633 * 633 *
634 * This helper function populates the lb_en and lan_en elements of the provided 634 * This helper function populates the lb_en and lan_en elements of the provided
635 * ice_fltr_info struct using the switch's type and characteristics of the 635 * ice_fltr_info struct using the switch's type and characteristics of the
636 * switch rule being configured. 636 * switch rule being configured.
637 */ 637 */
638static void ice_fill_sw_info(struct ice_hw *hw, struct ice_fltr_info *f_info) 638static void ice_fill_sw_info(struct ice_hw *hw, struct ice_fltr_info *fi)
639{ 639{
640 f_info->lb_en = false; 640 fi->lb_en = false;
641 f_info->lan_en = false; 641 fi->lan_en = false;
642 if ((f_info->flag & ICE_FLTR_TX) && 642 if ((fi->flag & ICE_FLTR_TX) &&
643 (f_info->fltr_act == ICE_FWD_TO_VSI || 643 (fi->fltr_act == ICE_FWD_TO_VSI ||
644 f_info->fltr_act == ICE_FWD_TO_VSI_LIST || 644 fi->fltr_act == ICE_FWD_TO_VSI_LIST ||
645 f_info->fltr_act == ICE_FWD_TO_Q || 645 fi->fltr_act == ICE_FWD_TO_Q ||
646 f_info->fltr_act == ICE_FWD_TO_QGRP)) { 646 fi->fltr_act == ICE_FWD_TO_QGRP)) {
647 f_info->lb_en = true; 647 fi->lb_en = true;
648 if (!(hw->evb_veb && f_info->lkup_type == ICE_SW_LKUP_MAC && 648 /* Do not set lan_en to TRUE if
649 is_unicast_ether_addr(f_info->l_data.mac.mac_addr))) 649 * 1. The switch is a VEB AND
650 f_info->lan_en = true; 650 * 2
651 * 2.1 The lookup is MAC with unicast addr for MAC, OR
652 * 2.2 The lookup is MAC_VLAN with unicast addr for MAC
653 *
654 * In all other cases, the LAN enable has to be set to true.
655 */
656 if (!(hw->evb_veb &&
657 ((fi->lkup_type == ICE_SW_LKUP_MAC &&
658 is_unicast_ether_addr(fi->l_data.mac.mac_addr)) ||
659 (fi->lkup_type == ICE_SW_LKUP_MAC_VLAN &&
660 is_unicast_ether_addr(fi->l_data.mac_vlan.mac_addr)))))
661 fi->lan_en = true;
651 } 662 }
652} 663}
653 664