[05/11] net/bnxt: fix RSS reta indirection table update
Checks
Commit Message
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@broadcom.com>
Reviewed-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
---
drivers/net/bnxt/bnxt_ethdev.c | 18 ++++++++++--------
drivers/net/bnxt/bnxt_hwrm.c | 1 +
2 files changed, 11 insertions(+), 8 deletions(-)
@@ -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;
}
@@ -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);