net/mlx5: support yellow meter action in hierarchy
[dpdk.git] / drivers / net / ice / ice_hash.c
index 4b682a4..f357278 100644 (file)
@@ -653,13 +653,15 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
        const struct rte_flow_item_raw *raw_spec, *raw_mask;
        struct ice_parser_profile prof;
        struct ice_parser_result rslt;
-       struct ice_parser *psr;
        uint8_t *pkt_buf, *msk_buf;
        uint8_t spec_len, pkt_len;
        uint8_t tmp_val = 0;
        uint8_t tmp_c = 0;
        int i, j;
 
+       if (ad->psr == NULL)
+               return -rte_errno;
+
        raw_spec = item->spec;
        raw_mask = item->mask;
 
@@ -713,11 +715,8 @@ ice_hash_parse_raw_pattern(struct ice_adapter *ad,
                        msk_buf[j] = tmp_val * 16 + tmp_c - '0';
        }
 
-       if (ice_parser_create(&ad->hw, &psr))
-               return -rte_errno;
-       if (ice_parser_run(psr, pkt_buf, pkt_len, &rslt))
+       if (ice_parser_run(ad->psr, pkt_buf, pkt_len, &rslt))
                return -rte_errno;
-       ice_parser_destroy(psr);
 
        if (ice_parser_profile_init(&rslt, pkt_buf, msk_buf,
                pkt_len, ICE_BLK_RSS, true, &prof))
@@ -1055,10 +1054,9 @@ ice_any_invalid_rss_type(enum rte_eth_hash_function rss_func,
 static int
 ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,
                const struct rte_flow_action actions[],
-               uint64_t pattern_hint, void **meta,
+               uint64_t pattern_hint, struct ice_rss_meta *rss_meta,
                struct rte_flow_error *error)
 {
-       struct ice_rss_meta *rss_meta = (struct ice_rss_meta *)*meta;
        struct ice_rss_hash_cfg *cfg = pattern_match_item->meta;
        enum rte_flow_action_type action_type;
        const struct rte_flow_action_rss *rss;
@@ -1196,7 +1194,7 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad,
 
        /* Check rss action. */
        ret = ice_hash_parse_action(pattern_match_item, actions, phint,
-                                   (void **)&rss_meta_ptr, error);
+                                   rss_meta_ptr, error);
 
 error:
        if (!ret && meta)