+static int bnxt_tf_vfr_alloc(struct rte_eth_dev *vfr_ethdev)
+{
+ int rc;
+ struct bnxt_vf_representor *vfr = vfr_ethdev->data->dev_private;
+ struct rte_eth_dev *parent_dev = vfr->parent_dev;
+ struct bnxt *parent_bp = parent_dev->data->dev_private;
+ uint16_t vfr_port_id = vfr_ethdev->data->port_id;
+ struct ulp_tlv_param param_list[] = {
+ {
+ .type = BNXT_ULP_DF_PARAM_TYPE_DEV_PORT_ID,
+ .length = 2,
+ .value = {(vfr_port_id >> 8) & 0xff, vfr_port_id & 0xff}
+ },
+ {
+ .type = BNXT_ULP_DF_PARAM_TYPE_LAST,
+ .length = 0,
+ .value = {0}
+ }
+ };
+
+ ulp_port_db_dev_port_intf_update(parent_bp->ulp_ctx, vfr_ethdev);
+
+ rc = ulp_default_flow_create(parent_dev, param_list,
+ BNXT_ULP_DF_TPL_VFREP_TO_VF,
+ &vfr->rep2vf_flow_id);
+ if (rc) {
+ BNXT_TF_DBG(DEBUG,
+ "Default flow rule creation for VFR->VF failed!\n");
+ return -EIO;
+ }
+
+ BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VFR->VF! ***\n");
+ BNXT_TF_DBG(DEBUG, "rep2vf_flow_id = %d\n", vfr->rep2vf_flow_id);
+ rc = ulp_default_flow_db_cfa_action_get(parent_bp->ulp_ctx,
+ vfr->rep2vf_flow_id,
+ &vfr->vfr_tx_cfa_action);
+ if (rc) {
+ BNXT_TF_DBG(DEBUG,
+ "Failed to get action_ptr for VFR->VF dflt rule\n");
+ return -EIO;
+ }
+ BNXT_TF_DBG(DEBUG, "tx_cfa_action = %d\n", vfr->vfr_tx_cfa_action);
+ rc = ulp_default_flow_create(parent_dev, param_list,
+ BNXT_ULP_DF_TPL_VF_TO_VFREP,
+ &vfr->vf2rep_flow_id);
+ if (rc) {
+ BNXT_TF_DBG(DEBUG,
+ "Default flow rule creation for VF->VFR failed!\n");
+ return -EIO;
+ }
+
+ BNXT_TF_DBG(DEBUG, "*** Default flow rule created for VF->VFR! ***\n");
+ BNXT_TF_DBG(DEBUG, "vfr2rep_flow_id = %d\n", vfr->vf2rep_flow_id);
+
+ return 0;
+}
+
+static int bnxt_vfr_alloc(struct rte_eth_dev *vfr_ethdev)