net/bnxt: configure PARIF for offload miss rules
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_def_rules.c
index 46b558f..d86e4c9 100644 (file)
@@ -81,12 +81,17 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx,
        if (rc)
                return rc;
 
-       if (parif_type == BNXT_ULP_PHY_PORT_PARIF)
+       if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
                idx = BNXT_ULP_CF_IDX_PHY_PORT_PARIF;
-       else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF)
+               /* Parif needs to be reset to a free partition */
+               parif += BNXT_ULP_FREE_PARIF_BASE;
+       } else if (parif_type == BNXT_ULP_DRV_FUNC_PARIF) {
                idx = BNXT_ULP_CF_IDX_DRV_FUNC_PARIF;
-       else
+               /* Parif needs to be reset to a free partition */
+               parif += BNXT_ULP_FREE_PARIF_BASE;
+       } else {
                idx = BNXT_ULP_CF_IDX_VF_FUNC_PARIF;
+       }
 
        ULP_COMP_FLD_IDX_WR(mapper_params, idx, parif);
 
@@ -304,7 +309,7 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
        struct ulp_rte_act_prop         act_prop;
        struct ulp_rte_act_bitmap       act = { 0 };
        struct bnxt_ulp_context         *ulp_ctx;
-       uint32_t type;
+       uint32_t type, ulp_flags = 0;
        int rc;
 
        memset(&mapper_params, 0, sizeof(mapper_params));
@@ -324,6 +329,15 @@ ulp_default_flow_create(struct rte_eth_dev *eth_dev,
                return -EINVAL;
        }
 
+       /* update the vf rep flag */
+       if (bnxt_ulp_cntxt_ptr2_ulp_flags_get(ulp_ctx, &ulp_flags)) {
+               BNXT_TF_DBG(ERR, "Error in getting ULP context flags\n");
+               return -EINVAL;
+       }
+       if (ULP_VF_REP_IS_ENABLED(ulp_flags))
+               ULP_COMP_FLD_IDX_WR(&mapper_params,
+                                   BNXT_ULP_CF_IDX_VFR_MODE, 1);
+
        type = param_list->type;
        while (type != BNXT_ULP_DF_PARAM_TYPE_LAST) {
                if (ulp_def_handler_tbl[type].vfr_func) {