*/
#include "bnxt.h"
-#include "ulp_template_db.h"
+#include "ulp_template_db_enum.h"
#include "ulp_template_struct.h"
#include "bnxt_tf_common.h"
#include "ulp_rte_parser.h"
uint16_t port_id = svif;
uint32_t dir = 0;
struct ulp_rte_hdr_field *hdr_field;
+ enum bnxt_ulp_svif_type svif_type;
+ enum bnxt_ulp_intf_type if_type;
uint32_t ifindex;
int32_t rc;
"Invalid port id\n");
return BNXT_TF_RC_ERROR;
}
- ulp_port_db_svif_get(params->ulp_ctx, ifindex, dir, &svif);
+
+ if (dir == ULP_DIR_INGRESS) {
+ svif_type = BNXT_ULP_PHY_PORT_SVIF;
+ } else {
+ if_type = bnxt_get_interface_type(port_id);
+ if (if_type == BNXT_ULP_INTF_TYPE_VF_REP)
+ svif_type = BNXT_ULP_VF_FUNC_SVIF;
+ else
+ svif_type = BNXT_ULP_DRV_FUNC_SVIF;
+ }
+ ulp_port_db_svif_get(params->ulp_ctx, ifindex, svif_type,
+ &svif);
svif = rte_cpu_to_be_16(svif);
}
hdr_field = ¶ms->hdr_field[BNXT_ULP_PROTO_HDR_FIELD_SVIF_IDX];
/* Update the vnic details */
ulp_rte_pf_act_handler(NULL, params);
+ /* Reset the hdr_bitmap with vnic bit */
+ ULP_BITMAP_RESET(params->act_bitmap.bits, BNXT_ULP_ACTION_BIT_VNIC);
+
return BNXT_TF_RC_SUCCESS;
}
memcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_L3_TYPE],
&ip_type, sizeof(uint32_t));
+ /* update the computed field to notify it is ipv4 header */
+ ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_ENCAP_IPV4_FLAG,
+ 1);
+
if (!ulp_rte_item_skip_void(&item, 1))
return BNXT_TF_RC_ERROR;
} else if (item->type == RTE_FLOW_ITEM_TYPE_IPV6) {
memcpy(&ap->act_details[BNXT_ULP_ACT_PROP_IDX_ENCAP_L3_TYPE],
&ip_type, sizeof(uint32_t));
+ /* update the computed field to notify it is ipv6 header */
+ ULP_COMP_FLD_IDX_WR(params, BNXT_ULP_CF_IDX_ACT_ENCAP_IPV6_FLAG,
+ 1);
+
if (!ulp_rte_item_skip_void(&item, 1))
return BNXT_TF_RC_ERROR;
} else {
/* copy the PF of the current device into VNIC Property */
svif = ULP_COMP_FLD_IDX_RD(params, BNXT_ULP_CF_IDX_INCOMING_IF);
- svif = bnxt_get_vnic_id(svif);
+ svif = bnxt_get_vnic_id(svif, BNXT_ULP_INTF_TYPE_INVALID);
svif = rte_cpu_to_be_32(svif);
memcpy(¶ms->act_prop.act_details[BNXT_ULP_ACT_PROP_IDX_VNIC],
&svif, BNXT_ULP_ACT_PROP_SZ_VNIC);
return BNXT_TF_RC_PARSE_ERR;
}
/* TBD: Update the computed VNIC using VF conversion */
- pid = bnxt_get_vnic_id(vf_action->id);
+ pid = bnxt_get_vnic_id(vf_action->id,
+ BNXT_ULP_INTF_TYPE_INVALID);
pid = rte_cpu_to_be_32(pid);
memcpy(¶m->act_prop.act_details[BNXT_ULP_ACT_PROP_IDX_VNIC],
&pid, BNXT_ULP_ACT_PROP_SZ_VNIC);
return BNXT_TF_RC_PARSE_ERR;
}
/* TBD: Update the computed VNIC using port conversion */
- pid = bnxt_get_vnic_id(port_id->id);
+ pid = bnxt_get_vnic_id(port_id->id, BNXT_ULP_INTF_TYPE_INVALID);
pid = rte_cpu_to_be_32(pid);
memcpy(¶m->act_prop.act_details[BNXT_ULP_ACT_PROP_IDX_VNIC],
&pid, BNXT_ULP_ACT_PROP_SZ_VNIC);