From db5d0f98bea612db5c29ea2cda3ce2b31c375eb4 Mon Sep 17 00:00:00 2001 From: Lance Richardson Date: Thu, 18 Jul 2019 09:06:10 +0530 Subject: [PATCH] net/bnxt: fix HWRM messages for thor RSS config Fully initialize hwrm messages for thor RSS configuration to avoid hwrm duplicate sequence numbers. Fixes: 38412304b50a ("net/bnxt: enable RSS for thor-based controllers") Signed-off-by: Lance Richardson Reviewed-by: Kalesh AP --- drivers/net/bnxt/bnxt_hwrm.c | 42 +++++++++++++++++------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/drivers/net/bnxt/bnxt_hwrm.c b/drivers/net/bnxt/bnxt_hwrm.c index b412d4dc6d..6f3a04514d 100644 --- a/drivers/net/bnxt/bnxt_hwrm.c +++ b/drivers/net/bnxt/bnxt_hwrm.c @@ -1737,16 +1737,16 @@ bnxt_hwrm_vnic_rss_cfg_thor(struct bnxt *bp, struct bnxt_vnic_info *vnic) struct hwrm_vnic_rss_cfg_input req = {.req_type = 0 }; struct hwrm_vnic_rss_cfg_output *resp = bp->hwrm_cmd_resp_addr; - HWRM_PREP(req, VNIC_RSS_CFG, BNXT_USE_CHIMP_MB); + for (i = 0; i < nr_ctxs; i++) { + HWRM_PREP(req, VNIC_RSS_CFG, BNXT_USE_CHIMP_MB); - req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id); - req.hash_type = rte_cpu_to_le_32(vnic->hash_type); - req.hash_mode_flags = vnic->hash_mode; + req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id); + req.hash_type = rte_cpu_to_le_32(vnic->hash_type); + req.hash_mode_flags = vnic->hash_mode; - req.hash_key_tbl_addr = - rte_cpu_to_le_64(vnic->rss_hash_key_dma_addr); + req.hash_key_tbl_addr = + rte_cpu_to_le_64(vnic->rss_hash_key_dma_addr); - for (i = 0; i < nr_ctxs; i++) { req.ring_grp_tbl_addr = rte_cpu_to_le_64(vnic->rss_table_dma_addr + i * HW_HASH_INDEX_SIZE); @@ -1757,10 +1757,9 @@ bnxt_hwrm_vnic_rss_cfg_thor(struct bnxt *bp, struct bnxt_vnic_info *vnic) BNXT_USE_CHIMP_MB); HWRM_CHECK_RESULT(); + HWRM_UNLOCK(); } - HWRM_UNLOCK(); - return rc; } @@ -4124,21 +4123,21 @@ bnxt_vnic_rss_configure_thor(struct bnxt *bp, struct bnxt_vnic_info *vnic) int i, j, k, cnt; int rc = 0; - HWRM_PREP(req, VNIC_RSS_CFG, BNXT_USE_CHIMP_MB); - - req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id); - req.hash_type = rte_cpu_to_le_32(vnic->hash_type); - req.hash_mode_flags = vnic->hash_mode; - - req.ring_grp_tbl_addr = - rte_cpu_to_le_64(vnic->rss_table_dma_addr); - req.hash_key_tbl_addr = - rte_cpu_to_le_64(vnic->rss_hash_key_dma_addr); - for (i = 0, k = 0; i < nr_ctxs; i++) { struct bnxt_rx_ring_info *rxr; struct bnxt_cp_ring_info *cpr; + HWRM_PREP(req, VNIC_RSS_CFG, BNXT_USE_CHIMP_MB); + + req.vnic_id = rte_cpu_to_le_16(vnic->fw_vnic_id); + req.hash_type = rte_cpu_to_le_32(vnic->hash_type); + req.hash_mode_flags = vnic->hash_mode; + + req.ring_grp_tbl_addr = + rte_cpu_to_le_64(vnic->rss_table_dma_addr); + req.hash_key_tbl_addr = + rte_cpu_to_le_64(vnic->rss_hash_key_dma_addr); + req.ring_table_pair_index = i; req.rss_ctx_idx = rte_cpu_to_le_16(vnic->fw_grp_ids[i]); @@ -4174,10 +4173,9 @@ bnxt_vnic_rss_configure_thor(struct bnxt *bp, struct bnxt_vnic_info *vnic) BNXT_USE_CHIMP_MB); HWRM_CHECK_RESULT(); + HWRM_UNLOCK(); } - HWRM_UNLOCK(); - return rc; } -- 2.20.1