compress/qat: enable compression on GEN3
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_matcher.c
index e5f23ef..e23867f 100644 (file)
@@ -1,5 +1,5 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2014-2020 Broadcom
+ * Copyright(c) 2014-2021 Broadcom
  * All rights reserved.
  */
 
@@ -34,22 +34,6 @@ ulp_matcher_action_hash_calculate(uint64_t hi_sig)
        return (uint32_t)hash;
 }
 
-/* Utility function to mask the computed and internal proto headers. */
-static void
-ulp_matcher_hdr_fields_normalize(struct ulp_rte_hdr_bitmap *hdr1,
-                                struct ulp_rte_hdr_bitmap *hdr2)
-{
-       /* copy the contents first */
-       rte_memcpy(hdr2, hdr1, sizeof(struct ulp_rte_hdr_bitmap));
-
-       /* reset the computed fields */
-       ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_SVIF);
-       ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_OO_VLAN);
-       ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_OI_VLAN);
-       ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_IO_VLAN);
-       ULP_BITMAP_RESET(hdr2->bits, BNXT_ULP_HDR_BIT_II_VLAN);
-}
-
 /*
  * Function to handle the matching of RTE Flows and validating
  * the pattern masks against the flow templates.
@@ -58,27 +42,16 @@ int32_t
 ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
                          uint32_t *class_id)
 {
-       struct ulp_rte_hdr_bitmap hdr_bitmap_masked;
        struct bnxt_ulp_class_match_info *class_match;
        uint32_t class_hid;
        uint8_t vf_to_vf;
        uint16_t tmpl_id;
 
-       /* Remove the hdr bit maps that are internal or computed */
-       ulp_matcher_hdr_fields_normalize(&params->hdr_bitmap,
-                                        &hdr_bitmap_masked);
-
-       /* determine vf to vf flow */
-       if (params->dir == ULP_DIR_EGRESS &&
-           ULP_BITMAP_ISSET(params->act_bitmap.bits,
-                            BNXT_ULP_ACTION_BIT_VNIC)) {
-               vf_to_vf = 1;
-       } else {
-               vf_to_vf = 0;
-       }
+       /* Get vf to vf flow */
+       vf_to_vf = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_VF_TO_VF);
 
        /* calculate the hash of the given flow */
-       class_hid = ulp_matcher_class_hash_calculate(hdr_bitmap_masked.bits,
+       class_hid = ulp_matcher_class_hash_calculate(params->hdr_bitmap.bits,
                                                     params->fld_bitmap.bits);
 
        /* validate the calculate hash values */
@@ -89,7 +62,7 @@ ulp_matcher_pattern_match(struct ulp_rte_parser_params *params,
                goto error;
 
        class_match = &ulp_class_match_list[tmpl_id];
-       if (ULP_BITMAP_CMP(&hdr_bitmap_masked, &class_match->hdr_sig)) {
+       if (ULP_BITMAP_CMP(&params->hdr_bitmap, &class_match->hdr_sig)) {
                BNXT_TF_DBG(DEBUG, "Proto Header does not match\n");
                goto error;
        }