net/ice/base: fix advanced switch rule stale information
[dpdk.git] / drivers / net / ice / base / ice_switch.c
index b4aab67..f379a5f 100644 (file)
@@ -542,6 +542,15 @@ static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_offsets[] = {
        { ICE_PROTOCOL_LAST,    0 },
 };
 
+static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv4_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_VLAN_OFOS,        14},
+       { ICE_PPPOE,            18 },
+       { ICE_IPV4_OFOS,        26 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
 static const u8 dummy_pppoe_ipv4_packet[] = {
        0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
        0x00, 0x00, 0x00, 0x00,
@@ -565,6 +574,92 @@ static const u8 dummy_pppoe_ipv4_packet[] = {
        0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
 };
 
+static const
+struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_tcp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_VLAN_OFOS,        14},
+       { ICE_PPPOE,            18 },
+       { ICE_IPV4_OFOS,        26 },
+       { ICE_TCP_IL,           46 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv4_tcp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
+
+       0x00, 0x00, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x16,
+
+       0x00, 0x21,             /* PPP Link Layer 24 */
+
+       0x45, 0x00, 0x00, 0x28, /* ICE_IPV4_OFOS 26 */
+       0x00, 0x01, 0x00, 0x00,
+       0x00, 0x06, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 46 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x50, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_pppoe_ipv4_udp_packet_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_VLAN_OFOS,        14},
+       { ICE_PPPOE,            18 },
+       { ICE_IPV4_OFOS,        26 },
+       { ICE_UDP_ILOS,         46 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv4_udp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
+
+       0x00, 0x00, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x16,
+
+       0x00, 0x21,             /* PPP Link Layer 24 */
+
+       0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_OFOS 26 */
+       0x00, 0x01, 0x00, 0x00,
+       0x00, 0x11, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 46 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_VLAN_OFOS,        14},
+       { ICE_PPPOE,            18 },
+       { ICE_IPV6_OFOS,        26 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
 static const u8 dummy_pppoe_ipv6_packet[] = {
        0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
        0x00, 0x00, 0x00, 0x00,
@@ -593,6 +688,93 @@ static const u8 dummy_pppoe_ipv6_packet[] = {
        0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
 };
 
+static const
+struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_tcp_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_VLAN_OFOS,        14},
+       { ICE_PPPOE,            18 },
+       { ICE_IPV6_OFOS,        26 },
+       { ICE_TCP_IL,           66 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv6_tcp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
+
+       0x00, 0x00, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x2a,
+
+       0x00, 0x57,             /* PPP Link Layer 24 */
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 26 */
+       0x00, 0x14, 0x06, 0x00, /* Next header is TCP */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 66 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x50, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
+static const
+struct ice_dummy_pkt_offsets dummy_pppoe_packet_ipv6_udp_offsets[] = {
+       { ICE_MAC_OFOS,         0 },
+       { ICE_ETYPE_OL,         12 },
+       { ICE_VLAN_OFOS,        14},
+       { ICE_PPPOE,            18 },
+       { ICE_IPV6_OFOS,        26 },
+       { ICE_UDP_ILOS,         66 },
+       { ICE_PROTOCOL_LAST,    0 },
+};
+
+static const u8 dummy_pppoe_ipv6_udp_packet[] = {
+       0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x81, 0x00,             /* ICE_ETYPE_OL 12 */
+
+       0x00, 0x00, 0x88, 0x64, /* ICE_VLAN_OFOS 14 */
+
+       0x11, 0x00, 0x00, 0x00, /* ICE_PPPOE 18 */
+       0x00, 0x2a,
+
+       0x00, 0x57,             /* PPP Link Layer 24 */
+
+       0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 26 */
+       0x00, 0x08, 0x11, 0x00, /* Next header UDP*/
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+       0x00, 0x00, 0x00, 0x00,
+
+       0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 66 */
+       0x00, 0x08, 0x00, 0x00,
+
+       0x00, 0x00,             /* 2 bytes for 4 bytes alignment */
+};
+
 static const struct ice_dummy_pkt_offsets dummy_ipv4_esp_packet_offsets[] = {
        { ICE_MAC_OFOS,         0 },
        { ICE_IPV4_OFOS,        14 },
@@ -1007,8 +1189,7 @@ err_unroll:
  * this array is the recipe ID and the element is the mapping of which profiles
  * is this recipe mapped to.
  */
-static void
-ice_get_recp_to_prof_map(struct ice_hw *hw)
+static void ice_get_recp_to_prof_map(struct ice_hw *hw)
 {
        ice_declare_bitmap(r_bitmap, ICE_MAX_NUM_RECIPES);
        u16 i;
@@ -1869,6 +2050,7 @@ ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u16 rule_list_sz,
                u8 num_rules, enum ice_adminq_opc opc, struct ice_sq_cd *cd)
 {
        struct ice_aq_desc desc;
+       enum ice_status status;
 
        ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
@@ -1882,7 +2064,12 @@ ice_aq_sw_rules(struct ice_hw *hw, void *rule_list, u16 rule_list_sz,
        desc.flags |= CPU_TO_LE16(ICE_AQ_FLAG_RD);
        desc.params.sw_rules.num_rules_fltr_entry_index =
                CPU_TO_LE16(num_rules);
-       return ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd);
+       status = ice_aq_send_cmd(hw, &desc, rule_list, rule_list_sz, cd);
+       if (opc != ice_aqc_opc_add_sw_rules &&
+           hw->adminq.sq_last_status == ICE_AQ_RC_ENOENT)
+               status = ICE_ERR_DOES_NOT_EXIST;
+
+       return status;
 }
 
 /**
@@ -3511,8 +3698,7 @@ ice_add_mac_exit:
  *
  * Function add MAC rule for logical port from HW struct
  */
-enum ice_status
-ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)
+enum ice_status ice_add_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)
 {
        if (!m_list || !hw)
                return ICE_ERR_PARAM;
@@ -3710,8 +3896,7 @@ ice_add_vlan_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list,
  *
  * Function add VLAN rule for logical port from HW struct
  */
-enum ice_status
-ice_add_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list)
+enum ice_status ice_add_vlan(struct ice_hw *hw, struct LIST_HEAD_TYPE *v_list)
 {
        if (!v_list || !hw)
                return ICE_ERR_PARAM;
@@ -3814,7 +3999,6 @@ ice_add_eth_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *em_list,
        return ICE_SUCCESS;
 }
 
-enum ice_status
 /**
  * ice_add_eth_mac - Add a ethertype based filter rule
  * @hw: pointer to the hardware structure
@@ -3822,6 +4006,7 @@ enum ice_status
  *
  * Function add ethertype rule for logical port from HW struct
  */
+enum ice_status
 ice_add_eth_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *em_list)
 {
        if (!em_list || !hw)
@@ -3937,6 +4122,9 @@ void ice_rem_all_sw_rules_info(struct ice_hw *hw)
                        ice_rem_sw_rule_info(hw, rule_head);
                else
                        ice_rem_adv_rule_info(hw, rule_head);
+               if (sw->recp_list[i].adv_rule &&
+                   LIST_EMPTY(&sw->recp_list[i].filt_rules))
+                       sw->recp_list[i].adv_rule = false;
        }
 }
 
@@ -4124,8 +4312,7 @@ ice_remove_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,
  * @m_list: list of MAC addresses and forwarding information
  *
  */
-enum ice_status
-ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)
+enum ice_status ice_remove_mac(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list)
 {
        struct ice_sw_recipe *recp_list;
 
@@ -5651,12 +5838,12 @@ ice_find_free_recp_res_idx(struct ice_hw *hw, const ice_bitmap_t *profiles,
  * ice_add_sw_recipe - function to call AQ calls to create switch recipe
  * @hw: pointer to hardware structure
  * @rm: recipe management list entry
- * @match_tun: if field vector index for tunnel needs to be programmed
- * @profiles: bitmap of profiles that will be assocated.
+ * @match_tun_mask: tunnel mask that needs to be programmed
+ * @profiles: bitmap of profiles that will be associated.
  */
 static enum ice_status
 ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
-                 bool match_tun, ice_bitmap_t *profiles)
+                 u16 match_tun_mask, ice_bitmap_t *profiles)
 {
        ice_declare_bitmap(result_idx_bm, ICE_MAX_FV_WORDS);
        struct ice_aqc_recipe_data_elem *tmp;
@@ -5874,10 +6061,10 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
                /* To differentiate among different UDP tunnels, a meta data ID
                 * flag is used.
                 */
-               if (match_tun) {
+               if (match_tun_mask) {
                        buf[recps].content.lkup_indx[i] = ICE_TUN_FLAG_FV_IND;
                        buf[recps].content.mask[i] =
-                               CPU_TO_LE16(ICE_TUN_FLAG_MASK);
+                               CPU_TO_LE16(match_tun_mask);
                }
 
                recps++;
@@ -5946,7 +6133,6 @@ ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
                recp->n_grp_count = rm->n_grp_count;
                recp->tun_type = rm->tun_type;
                recp->recp_created = true;
-               recp->adv_rule = 1;
        }
        rm->root_buf = buf;
        ice_free(hw, tmp);
@@ -6038,12 +6224,19 @@ static bool ice_tun_type_match_word(enum ice_sw_tunnel_type tun_type, u16 *mask)
 {
        switch (tun_type) {
        case ICE_SW_TUN_VXLAN_GPE:
+       case ICE_SW_TUN_GENEVE:
+       case ICE_SW_TUN_VXLAN:
        case ICE_SW_TUN_NVGRE:
        case ICE_SW_TUN_UDP:
        case ICE_ALL_TUNNELS:
                *mask = ICE_TUN_FLAG_MASK;
                return true;
 
+       case ICE_SW_TUN_GENEVE_VLAN:
+       case ICE_SW_TUN_VXLAN_VLAN:
+               *mask = ICE_TUN_FLAG_MASK & ~ICE_TUN_FLAG_VLAN_MASK;
+               return true;
+
        default:
                *mask = 0;
                return false;
@@ -6101,7 +6294,9 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,
                break;
        case ICE_SW_TUN_VXLAN_GPE:
        case ICE_SW_TUN_GENEVE:
+       case ICE_SW_TUN_GENEVE_VLAN:
        case ICE_SW_TUN_VXLAN:
+       case ICE_SW_TUN_VXLAN_VLAN:
        case ICE_SW_TUN_UDP:
        case ICE_SW_TUN_GTP:
                prof_type = ICE_PROF_TUN_UDP;
@@ -6112,6 +6307,31 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo,
        case ICE_SW_TUN_PPPOE:
                prof_type = ICE_PROF_TUN_PPPOE;
                break;
+       case ICE_SW_TUN_PPPOE_PAY:
+               ice_set_bit(ICE_PROFID_PPPOE_PAY, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV4:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_OTHER, bm);
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_UDP, bm);
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV4_TCP:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_TCP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV4_UDP:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV4_UDP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV6:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_OTHER, bm);
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_UDP, bm);
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV6_TCP:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_TCP, bm);
+               return;
+       case ICE_SW_TUN_PPPOE_IPV6_UDP:
+               ice_set_bit(ICE_PROFID_PPPOE_IPV6_UDP, bm);
+               return;
        case ICE_SW_TUN_PROFID_IPV6_ESP:
        case ICE_SW_TUN_IPV6_ESP:
                ice_set_bit(ICE_PROFID_IPV6_ESP, bm);
@@ -6209,7 +6429,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        struct ice_sw_fv_list_entry *tmp;
        enum ice_status status = ICE_SUCCESS;
        struct ice_sw_recipe *rm;
-       bool match_tun = false;
+       u16 match_tun_mask = 0;
        u16 mask;
        u8 i;
 
@@ -6272,9 +6492,9 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
         * differentiate different tunnel types. A separate recipe needs to be
         * used for the metadata.
         */
-       if (ice_tun_type_match_word(rinfo->tun_type,  &mask) &&
+       if (ice_tun_type_match_word(rinfo->tun_type, &mask) &&
            rm->n_grp_count > 1)
-               match_tun = mask;
+               match_tun_mask = mask;
 
        /* set the recipe priority if specified */
        rm->priority = (u8)rinfo->priority;
@@ -6329,7 +6549,7 @@ ice_add_adv_recipe(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
 
        rm->tun_type = rinfo->tun_type;
        /* Recipe we need does not exist, add a recipe */
-       status = ice_add_sw_recipe(hw, rm, match_tun, profiles);
+       status = ice_add_sw_recipe(hw, rm, match_tun_mask, profiles);
        if (status)
                goto err_unroll;
 
@@ -6510,18 +6730,62 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
                *offsets = dummy_udp_gtp_packet_offsets;
                return;
        }
+
        if (tun_type == ICE_SW_TUN_PPPOE && ipv6) {
                *pkt = dummy_pppoe_ipv6_packet;
                *pkt_len = sizeof(dummy_pppoe_ipv6_packet);
                *offsets = dummy_pppoe_packet_offsets;
                return;
-       } else if (tun_type == ICE_SW_TUN_PPPOE) {
+       } else if (tun_type == ICE_SW_TUN_PPPOE ||
+               tun_type == ICE_SW_TUN_PPPOE_PAY) {
                *pkt = dummy_pppoe_ipv4_packet;
                *pkt_len = sizeof(dummy_pppoe_ipv4_packet);
                *offsets = dummy_pppoe_packet_offsets;
                return;
        }
 
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV4) {
+               *pkt = dummy_pppoe_ipv4_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv4_packet);
+               *offsets = dummy_pppoe_packet_ipv4_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV4_TCP) {
+               *pkt = dummy_pppoe_ipv4_tcp_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv4_tcp_packet);
+               *offsets = dummy_pppoe_ipv4_tcp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV4_UDP) {
+               *pkt = dummy_pppoe_ipv4_udp_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv4_udp_packet);
+               *offsets = dummy_pppoe_ipv4_udp_packet_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV6) {
+               *pkt = dummy_pppoe_ipv6_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv6_packet);
+               *offsets = dummy_pppoe_packet_ipv6_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV6_TCP) {
+               *pkt = dummy_pppoe_ipv6_tcp_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv6_tcp_packet);
+               *offsets = dummy_pppoe_packet_ipv6_tcp_offsets;
+               return;
+       }
+
+       if (tun_type == ICE_SW_TUN_PPPOE_IPV6_UDP) {
+               *pkt = dummy_pppoe_ipv6_udp_packet;
+               *pkt_len = sizeof(dummy_pppoe_ipv6_udp_packet);
+               *offsets = dummy_pppoe_packet_ipv6_udp_offsets;
+               return;
+       }
+
        if (tun_type == ICE_ALL_TUNNELS) {
                *pkt = dummy_gre_udp_packet;
                *pkt_len = sizeof(dummy_gre_udp_packet);
@@ -6544,7 +6808,9 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
        }
 
        if (tun_type == ICE_SW_TUN_VXLAN || tun_type == ICE_SW_TUN_GENEVE ||
-           tun_type == ICE_SW_TUN_VXLAN_GPE || tun_type == ICE_SW_TUN_UDP) {
+           tun_type == ICE_SW_TUN_VXLAN_GPE || tun_type == ICE_SW_TUN_UDP ||
+           tun_type == ICE_SW_TUN_GENEVE_VLAN ||
+           tun_type == ICE_SW_TUN_VXLAN_VLAN) {
                if (tcp) {
                        *pkt = dummy_udp_tun_tcp_packet;
                        *pkt_len = sizeof(dummy_udp_tun_tcp_packet);
@@ -6751,12 +7017,14 @@ ice_fill_adv_packet_tun(struct ice_hw *hw, enum ice_sw_tunnel_type tun_type,
        case ICE_SW_TUN_AND_NON_TUN:
        case ICE_SW_TUN_VXLAN_GPE:
        case ICE_SW_TUN_VXLAN:
+       case ICE_SW_TUN_VXLAN_VLAN:
        case ICE_SW_TUN_UDP:
                if (!ice_get_open_tunnel_port(hw, TNL_VXLAN, &open_port))
                        return ICE_ERR_CFG;
                break;
 
        case ICE_SW_TUN_GENEVE:
+       case ICE_SW_TUN_GENEVE_VLAN:
                if (!ice_get_open_tunnel_port(hw, TNL_GENEVE, &open_port))
                        return ICE_ERR_CFG;
                break;
@@ -6865,13 +7133,6 @@ ice_adv_add_update_vsi_list(struct ice_hw *hw,
             cur_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI_LIST))
                return ICE_ERR_NOT_IMPL;
 
-       /* Workaround fix for unexpected rule deletion by kernel PF
-        * during VF reset.
-        */
-       if (new_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI &&
-           cur_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI)
-               return ICE_ERR_NOT_IMPL;
-
        if (m_entry->vsi_count < 2 && !m_entry->vsi_list_info) {
                 /* Only one entry existed in the mapping and it was not already
                  * a part of a VSI list. So, create a VSI list with the old and
@@ -7351,12 +7612,16 @@ ice_rem_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
                status = ice_aq_sw_rules(hw, (struct ice_aqc_sw_rules *)s_rule,
                                         rule_buf_sz, 1,
                                         ice_aqc_opc_remove_sw_rules, NULL);
-               if (status == ICE_SUCCESS) {
+               if (status == ICE_SUCCESS || status == ICE_ERR_DOES_NOT_EXIST) {
+                       struct ice_switch_info *sw = hw->switch_info;
+
                        ice_acquire_lock(rule_lock);
                        LIST_DEL(&list_elem->list_entry);
                        ice_free(hw, list_elem->lkups);
                        ice_free(hw, list_elem);
                        ice_release_lock(rule_lock);
+                       if (LIST_EMPTY(&sw->recp_list[rid].filt_rules))
+                               sw->recp_list[rid].adv_rule = false;
                }
                ice_free(hw, s_rule);
        }
@@ -7408,8 +7673,7 @@ ice_rem_adv_rule_by_id(struct ice_hw *hw,
  * as removing a rule fails, it will return immediately with the error code,
  * else it will return ICE_SUCCESS
  */
-enum ice_status
-ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle)
+enum ice_status ice_rem_adv_rule_for_vsi(struct ice_hw *hw, u16 vsi_handle)
 {
        struct ice_adv_fltr_mgmt_list_entry *list_itr;
        struct ice_vsi_list_map_info *map_info;