#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,
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)
+ } 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);
}
/* Get the index details from computed field */
- if (tbl->index_opcode != BNXT_ULP_INDEX_OPCODE_COMP_FIELD) {
+ if (tbl->index_opcode == BNXT_ULP_INDEX_OPCODE_COMP_FIELD) {
+ idx = ULP_COMP_FLD_IDX_RD(parms, tbl->index_operand);
+ } else if (tbl->index_opcode == BNXT_ULP_INDEX_OPCODE_CONSTANT) {
+ idx = tbl->index_operand;
+ } else {
BNXT_TF_DBG(ERR, "Invalid tbl index opcode\n");
return -EINVAL;
}
- idx = ULP_COMP_FLD_IDX_RD(parms, tbl->index_operand);
/* Perform the tf table set by filling the set params */
iftbl_params.dir = tbl->direction;
BNXT_ULP_INDEX_OPCODE_ALLOCATE = 1,
BNXT_ULP_INDEX_OPCODE_GLOBAL = 2,
BNXT_ULP_INDEX_OPCODE_COMP_FIELD = 3,
- BNXT_ULP_INDEX_OPCODE_LAST = 4
+ BNXT_ULP_INDEX_OPCODE_CONSTANT = 4,
+ BNXT_ULP_INDEX_OPCODE_LAST = 5
};
enum bnxt_ulp_mapper_opc {
BNXT_ULP_SYM_IP_PROTO_IP_IN_IP = 4,
BNXT_ULP_SYM_IP_PROTO_TCP = 6,
BNXT_ULP_SYM_IP_PROTO_UDP = 17,
+ BNXT_ULP_SYM_VF_FUNC_PARIF = 15,
BNXT_ULP_SYM_NO = 0,
BNXT_ULP_SYM_YES = 1
};