net/mlx5: adjust hash bucket size
[dpdk.git] / drivers / net / bnxt / tf_ulp / bnxt_ulp_flow.c
index 9c27217..19e9dba 100644 (file)
@@ -11,6 +11,7 @@
 #include "ulp_mapper.h"
 #include "ulp_fc_mgr.h"
 #include "ulp_port_db.h"
+#include "ulp_ha_mgr.h"
 #include <rte_malloc.h>
 
 static int32_t
@@ -102,6 +103,7 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
        mapper_cparms->flow_pattern_id = params->flow_pattern_id;
        mapper_cparms->act_pattern_id = params->act_pattern_id;
        mapper_cparms->app_id = params->app_id;
+       mapper_cparms->port_id = params->port_id;
 
        /* update the signature fields into the computed field list */
        ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_HDR_SIG_ID,
@@ -112,11 +114,17 @@ bnxt_ulp_init_mapper_params(struct bnxt_ulp_mapper_create_parms *mapper_cparms,
        /* update the WC Priority flag */
        if (!bnxt_ulp_cntxt_ptr2_ulp_flags_get(params->ulp_ctx, &ulp_flags) &&
            ULP_HIGH_AVAIL_IS_ENABLED(ulp_flags)) {
-               /* TBD: read the state and Set the WC priority */
-               ULP_COMP_FLD_IDX_WR(params,
-                                   BNXT_ULP_CF_IDX_WC_IS_HA_HIGH_REG, 1);
+               enum ulp_ha_mgr_region region = ULP_HA_REGION_LOW;
+               int32_t rc;
+
+               rc = ulp_ha_mgr_region_get(params->ulp_ctx, &region);
+               if (rc)
+                       BNXT_TF_DBG(ERR, "Unable to get WC region\n");
+               if (region == ULP_HA_REGION_HI)
+                       ULP_COMP_FLD_IDX_WR(params,
+                                           BNXT_ULP_CF_IDX_WC_IS_HA_HIGH_REG,
+                                           1);
        }
-
 }
 
 /* Function to create the rte flow. */