[dpdk-dev] [PATCH 05/11] net/bnxt: fix RSS reta indirection table update

Ajit Khaparde ajit.khaparde at broadcom.com
Tue May 21 23:39:47 CEST 2019


We are trying to update the indirection table for all the VNICs.
We should update the table only for the default vnic0.
This patch fixes the above issue.

Fixes: d819382543f3 ("net/bnxt: add RSS redirection table operations")
Signed-off-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta at broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson at broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 18 ++++++++++--------
 drivers/net/bnxt/bnxt_hwrm.c   |  1 +
 2 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 52a6b94e0..2d892cd4f 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -983,8 +983,13 @@ static int bnxt_reta_update_op(struct rte_eth_dev *eth_dev,
 {
 	struct bnxt *bp = (struct bnxt *)eth_dev->data->dev_private;
 	struct rte_eth_conf *dev_conf = &bp->eth_dev->data->dev_conf;
-	struct bnxt_vnic_info *vnic;
-	int i;
+	struct bnxt_vnic_info *vnic = &bp->vnic_info[0];
+
+	/* Update the default RSS VNIC */
+	if (!vnic)
+		return -EINVAL;
+	if (!vnic->rss_table)
+		return -EINVAL;
 
 	if (!(dev_conf->rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG))
 		return -EINVAL;
@@ -995,12 +1000,9 @@ static int bnxt_reta_update_op(struct rte_eth_dev *eth_dev,
 			"(%d)\n", reta_size, HW_HASH_INDEX_SIZE);
 		return -EINVAL;
 	}
-	/* Update the RSS VNIC(s) */
-	for (i = 0; i < bp->max_vnics; i++) {
-		vnic = &bp->vnic_info[i];
-		memcpy(vnic->rss_table, reta_conf, reta_size);
-		bnxt_hwrm_vnic_rss_cfg(bp, vnic);
-	}
+
+	memcpy(vnic->rss_table, reta_conf, reta_size);
+	bnxt_hwrm_vnic_rss_cfg(bp, vnic);
 	return 0;
 }
 
diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c
index eb5c41ebb..8c4fa556d 100644
--- a/drivers/net/bnxt/bnxt_hwrm.c
+++ b/drivers/net/bnxt/bnxt_hwrm.c
@@ -1607,6 +1607,7 @@ int bnxt_hwrm_vnic_rss_cfg(struct bnxt *bp,
 	req.hash_key_tbl_addr =
 	    rte_cpu_to_le_64(vnic->rss_hash_key_dma_addr);
 	req.rss_ctx_idx = rte_cpu_to_le_16(vnic->rss_rule);
+	req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id);
 
 	rc = bnxt_hwrm_send_message(bp, &req, sizeof(req), BNXT_USE_CHIMP_MB);
 
-- 
2.20.1 (Apple Git-117)



More information about the dev mailing list