net/bnxt: configure PARIF for offload miss rules
[dpdk.git] / drivers / net / bnxt / tf_ulp / ulp_def_rules.c
index b01ad0b..d86e4c9 100644 (file)
@@ -12,8 +12,6 @@
 #include "ulp_flow_db.h"
 #include "ulp_mapper.h"
 
-#define BNXT_ULP_FREE_PARIF_BASE 11
-
 struct bnxt_ulp_def_param_handler {
        int32_t (*vfr_func)(struct bnxt_ulp_context *ulp_ctx,
                            struct ulp_tlv_param *param,
@@ -85,6 +83,8 @@ ulp_set_parif_in_comp_fld(struct bnxt_ulp_context *ulp_ctx,
 
        if (parif_type == BNXT_ULP_PHY_PORT_PARIF) {
                idx = BNXT_ULP_CF_IDX_PHY_PORT_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;
                /* Parif needs to be reset to a free partition */
@@ -309,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));
@@ -329,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) {