[dpdk-dev] [PATCH 18/36] net/bnxt: use vport in the phy port act handler

Somnath Kotur somnath.kotur at broadcom.com
Wed Jun 10 13:44:09 CEST 2020


From: Kishore Padmanabha <kishore.padmanabha at broadcom.com>

The phy port action handler should get vport details and not
vnic id. The fix is to calculate the vport of the given
port.

Signed-off-by: Kishore Padmanabha <kishore.padmanabha at broadcom.com>
Reviewed-by: Michael Baucom <michael.baucom at broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur at broadcom.com>
---
 drivers/net/bnxt/tf_ulp/ulp_rte_parser.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
index 842466d..3dd941f 100644
--- a/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
+++ b/drivers/net/bnxt/tf_ulp/ulp_rte_parser.c
@@ -1284,7 +1284,7 @@ ulp_rte_phy_port_act_handler(const struct rte_flow_action *action_item,
 			     struct ulp_rte_parser_params *prm)
 {
 	const struct rte_flow_action_phy_port *phy_port;
-	uint32_t pid;
+	uint32_t vport;
 
 	phy_port = action_item->conf;
 	if (phy_port) {
@@ -1293,10 +1293,12 @@ ulp_rte_phy_port_act_handler(const struct rte_flow_action *action_item,
 				    "Parse Err:Port Original not supported\n");
 			return BNXT_TF_RC_PARSE_ERR;
 		}
-		pid = bnxt_get_vnic_id(phy_port->index);
-		pid = rte_cpu_to_be_32(pid);
+		/* Get the vport of the physical port */
+		/* TBD: shall be changed later to portdb call */
+		vport = 1 << phy_port->index;
+		vport = rte_cpu_to_be_32(vport);
 		memcpy(&prm->act_prop.act_details[BNXT_ULP_ACT_PROP_IDX_VPORT],
-		       &pid, BNXT_ULP_ACT_PROP_SZ_VPORT);
+		       &vport, BNXT_ULP_ACT_PROP_SZ_VPORT);
 	}
 
 	/* Update the hdr_bitmap with count */
-- 
2.7.4



More information about the dev mailing list