build: disable experimental API check internally
[dpdk.git] / drivers / net / ice / ice_switch_filter.c
index 79fb811..66dc158 100644 (file)
@@ -587,11 +587,16 @@ ice_switch_inset_get(const struct rte_flow_item pattern[],
                                                (RTE_IPV6_HDR_TC_MASK))
                                                == rte_cpu_to_be_32
                                                (RTE_IPV6_HDR_TC_MASK)) {
-                                       f->tc = (rte_be_to_cpu_32
+                                       struct ice_le_ver_tc_flow vtf;
+                                       vtf.u.fld.version = 0;
+                                       vtf.u.fld.flow_label = 0;
+                                       vtf.u.fld.tc = (rte_be_to_cpu_32
                                                (ipv6_spec->hdr.vtc_flow) &
                                                        RTE_IPV6_HDR_TC_MASK) >>
                                                        RTE_IPV6_HDR_TC_SHIFT;
-                                       s->tc = UINT8_MAX;
+                                       f->be_ver_tc_flow = CPU_TO_BE32(vtf.u.val);
+                                       vtf.u.fld.tc = UINT8_MAX;
+                                       s->be_ver_tc_flow = CPU_TO_BE32(vtf.u.val);
                                }
                                t++;
                        } else if (!ipv6_spec && !ipv6_mask) {
@@ -925,7 +930,7 @@ ice_switch_parse_action(struct ice_pf *pf,
        uint16_t valid_qgrop_number[MAX_QGRP_NUM_TYPE] = {
                 2, 4, 8, 16, 32, 64, 128};
 
-       base_queue = pf->base_queue;
+       base_queue = pf->base_queue + vsi->base_queue;
        for (action = actions; action->type !=
                        RTE_FLOW_ACTION_TYPE_END; action++) {
                action_type = action->type;
@@ -1083,10 +1088,17 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad,
                                   "Invalid input action");
                goto error;
        }
-       *meta = sw_meta_ptr;
-       ((struct sw_meta *)*meta)->list = list;
-       ((struct sw_meta *)*meta)->lkups_num = lkups_num;
-       ((struct sw_meta *)*meta)->rule_info = rule_info;
+
+       if (meta) {
+               *meta = sw_meta_ptr;
+               ((struct sw_meta *)*meta)->list = list;
+               ((struct sw_meta *)*meta)->lkups_num = lkups_num;
+               ((struct sw_meta *)*meta)->rule_info = rule_info;
+       } else {
+               rte_free(list);
+               rte_free(sw_meta_ptr);
+       }
+
        rte_free(pattern_match_item);
 
        return 0;
@@ -1122,8 +1134,10 @@ ice_switch_init(struct ice_adapter *ad)
 
        if (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)
                dist_parser = &ice_switch_dist_parser_comms;
-       else
+       else if (ad->active_pkg_type == ICE_PKG_TYPE_OS_DEFAULT)
                dist_parser = &ice_switch_dist_parser_os;
+       else
+               return -EINVAL;
 
        if (ad->devargs.pipe_mode_support)
                ret = ice_register_parser(perm_parser, ad);