diff mbox series

[18/20] net/bnxt: use VF vnic when port action is for a VF rep port

Message ID 20200706082502.26935-19-somnath.kotur@broadcom.com (mailing list archive)
State Accepted, archived
Delegated to: Ajit Khaparde
Headers show
Series bnxt patches | expand

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Somnath Kotur July 6, 2020, 8:25 a.m. UTC
From: Kishore Padmanabha <kishore.padmanabha@broadcom.com>

Fix to use the vf's vnic port for ingress flows whose
port action is a vf rep port.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha@broadcom.com>
Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
index 2f6a15d..b943465 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
@@ -1425,6 +1425,8 @@  ulp_rte_parser_act_port_set(struct ulp_rte_parser_params *param,
 	uint16_t pid_s;
 	uint32_t pid;
 	struct ulp_rte_act_prop *act = &param->act_prop;
+	enum bnxt_ulp_intf_type port_type;
+	uint32_t vnic_type;
 
 	/* Get the direction */
 	dir = ULP_COMP_FLD_IDX_RD(param, BNXT_ULP_CF_IDX_DIRECTION);
@@ -1439,9 +1441,15 @@  ulp_rte_parser_act_port_set(struct ulp_rte_parser_params *param,
 		       &pid, BNXT_ULP_ACT_PROP_SZ_VPORT);
 	} else {
 		/* For ingress direction, fill vnic */
+		port_type = ULP_COMP_FLD_IDX_RD(param,
+						BNXT_ULP_CF_IDX_ACT_PORT_TYPE);
+		if (port_type == BNXT_ULP_INTF_TYPE_VF_REP)
+			vnic_type = BNXT_ULP_VF_FUNC_VNIC;
+		else
+			vnic_type = BNXT_ULP_DRV_FUNC_VNIC;
+
 		if (ulp_port_db_default_vnic_get(param->ulp_ctx, ifindex,
-						 BNXT_ULP_DRV_FUNC_VNIC,
-						 &pid_s))
+						 vnic_type, &pid_s))
 			return BNXT_TF_RC_ERROR;
 
 		pid = pid_s;