const struct rte_flow_action actions[],
struct rte_flow_error *error)
{
+ struct bnxt_ulp_mapper_create_parms mapper_cparms = { 0 };
struct ulp_rte_parser_params params;
struct bnxt_ulp_context *ulp_ctx = NULL;
uint32_t class_id, act_tmpl;
struct rte_flow *flow_id;
- uint32_t app_priority;
uint32_t fid;
uint8_t *buffer;
uint32_t vnic;
if (ret != BNXT_TF_RC_SUCCESS)
goto parse_error;
- app_priority = attr->priority;
+ mapper_cparms.app_priority = attr->priority;
+ mapper_cparms.hdr_bitmap = ¶ms.hdr_bitmap;
+ mapper_cparms.hdr_field = params.hdr_field;
+ mapper_cparms.act = ¶ms.act_bitmap;
+ mapper_cparms.act_prop = ¶ms.act_prop;
+ mapper_cparms.class_tid = class_id;
+ mapper_cparms.act_tid = act_tmpl;
+
/* call the ulp mapper to create the flow in the hardware */
ret = ulp_mapper_flow_create(ulp_ctx,
- app_priority,
- ¶ms.hdr_bitmap,
- params.hdr_field,
- ¶ms.act_bitmap,
- ¶ms.act_prop,
- class_id,
- act_tmpl,
+ &mapper_cparms,
&fid);
if (!ret) {
flow_id = (struct rte_flow *)((uintptr_t)fid);
*/
int32_t
ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,
- uint32_t app_priority __rte_unused,
- struct ulp_rte_hdr_bitmap *hdr_bitmap __rte_unused,
- struct ulp_rte_hdr_field *hdr_field,
- struct ulp_rte_act_bitmap *act_bitmap,
- struct ulp_rte_act_prop *act_prop,
- uint32_t class_tid,
- uint32_t act_tid,
- uint32_t *flow_id)
+ struct bnxt_ulp_mapper_create_parms *cparms,
+ uint32_t *flowid)
{
- struct ulp_regfile regfile;
- struct bnxt_ulp_mapper_parms parms;
- struct bnxt_ulp_device_params *device_params;
- int32_t rc, trc;
+ struct bnxt_ulp_device_params *device_params;
+ struct bnxt_ulp_mapper_parms parms;
+ struct ulp_regfile regfile;
+ int32_t rc, trc;
+
+ if (!ulp_ctx || !cparms)
+ return -EINVAL;
/* Initialize the parms structure */
memset(&parms, 0, sizeof(parms));
- parms.act_prop = act_prop;
- parms.act_bitmap = act_bitmap;
+ parms.act_prop = cparms->act_prop;
+ parms.act_bitmap = cparms->act;
parms.regfile = ®file;
- parms.hdr_field = hdr_field;
+ parms.hdr_field = cparms->hdr_field;
parms.tfp = bnxt_ulp_cntxt_tfp_get(ulp_ctx);
parms.ulp_ctx = ulp_ctx;
}
/* Get the action table entry from device id and act context id */
- parms.act_tid = act_tid;
+ parms.act_tid = cparms->act_tid;
parms.atbls = ulp_mapper_action_tbl_list_get(parms.dev_id,
parms.act_tid,
&parms.num_atbls);
}
/* Get the class table entry from device id and act context id */
- parms.class_tid = class_tid;
+ parms.class_tid = cparms->class_tid;
parms.ctbls = ulp_mapper_class_tbl_list_get(parms.dev_id,
parms.class_tid,
&parms.num_ctbls);
goto flow_error;
}
- *flow_id = parms.fid;
+ *flowid = parms.fid;
return rc;
enum bnxt_ulp_flow_db_tables tbl_idx;
};
+struct bnxt_ulp_mapper_create_parms {
+ uint32_t app_priority;
+ struct ulp_rte_hdr_bitmap *hdr_bitmap;
+ struct ulp_rte_hdr_field *hdr_field;
+ struct ulp_rte_act_bitmap *act;
+ struct ulp_rte_act_prop *act_prop;
+ uint32_t class_tid;
+ uint32_t act_tid;
+};
+
/*
* Function to handle the mapping of the Flow to be compatible
* with the underlying hardware.
*/
int32_t
ulp_mapper_flow_create(struct bnxt_ulp_context *ulp_ctx,
- uint32_t app_priority,
- struct ulp_rte_hdr_bitmap *hdr_bitmap,
- struct ulp_rte_hdr_field *hdr_field,
- struct ulp_rte_act_bitmap *act,
- struct ulp_rte_act_prop *act_prop,
- uint32_t class_tid,
- uint32_t act_tid,
- uint32_t *flow_id);
+ struct bnxt_ulp_mapper_create_parms *parms,
+ uint32_t *flowid);
/* Function that frees all resources associated with the flow. */
int32_t