[PATCH v3 5/5] net/cnxk: fix representor port mapping

Harman Kalra hkalra at marvell.com
Mon Jun 24 15:24:15 CEST 2024


From: Hanumanth Pothula <hpothula at marvell.com>

As part of ready and exit messages only first half of the ports
were processed, i.e. represented to representor port mapping was
setup and released. While later half of the ports were not
processed.

Fixes: 804c585658ea ("net/cnxk: add representor control plane")

Signed-off-by: Hanumanth Pothula <hpothula at marvell.com>
---
V2:
 * Added fixes tag
 * Better commit message

 drivers/net/cnxk/cnxk_rep_msg.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/cnxk/cnxk_rep_msg.c b/drivers/net/cnxk/cnxk_rep_msg.c
index f3a62a805e..29ce94e5c6 100644
--- a/drivers/net/cnxk/cnxk_rep_msg.c
+++ b/drivers/net/cnxk/cnxk_rep_msg.c
@@ -369,12 +369,12 @@ notify_rep_dev_ready(cnxk_rep_msg_ready_data_t *rdata, void *data,
 
 	memset(rep_id_arr, 0, RTE_MAX_ETHPORTS * sizeof(uint64_t));
 	/* For ready state */
-	if ((rdata->nb_ports / 2) > eswitch_dev->repr_cnt.nb_repr_probed) {
+	if (rdata->nb_ports > eswitch_dev->repr_cnt.nb_repr_probed) {
 		rc = CNXK_REP_CTRL_MSG_NACK_INV_REP_CNT;
 		goto fail;
 	}
 
-	for (i = 0; i < rdata->nb_ports / 2; i++) {
+	for (i = 0; i < rdata->nb_ports; i++) {
 		rep_id = UINT16_MAX;
 		rc = cnxk_rep_state_update(eswitch_dev, rdata->data[i], &rep_id);
 		if (rc) {
@@ -475,7 +475,7 @@ notify_rep_dev_exit(cnxk_rep_msg_exit_data_t *edata, void *data)
 		rc = -EINVAL;
 		goto fail;
 	}
-	if ((edata->nb_ports / 2) > eswitch_dev->repr_cnt.nb_repr_probed) {
+	if (edata->nb_ports > eswitch_dev->repr_cnt.nb_repr_probed) {
 		rc = CNXK_REP_CTRL_MSG_NACK_INV_REP_CNT;
 		goto fail;
 	}
-- 
2.18.0



More information about the dev mailing list