Skip to content

Commit

Permalink
net/bnxt: fix queue stop operation
Browse files Browse the repository at this point in the history
[ upstream commit 3e6fae2 ]

When there are no active Rx queues(i.e when all queues have been
stopped), clear the RSS redirection table of the VNIC on Thor.

Fixes: 9b63c6f ("net/bnxt: support Rx/Tx queue start/stop")

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
  • Loading branch information
Kalesh AP authored and bluca committed Feb 14, 2022
1 parent 3ea46b6 commit c612a4b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions drivers/net/bnxt/bnxt_hwrm.c
Expand Up @@ -5961,3 +5961,26 @@ int bnxt_hwrm_poll_ver_get(struct bnxt *bp)

return rc;
}

int
bnxt_vnic_rss_clear_p5(struct bnxt *bp, struct bnxt_vnic_info *vnic)
{
struct hwrm_vnic_rss_cfg_output *resp = bp->hwrm_cmd_resp_addr;
struct hwrm_vnic_rss_cfg_input req = {0};
int nr_ctxs = vnic->num_lb_ctxts;
int i, rc = 0;

for (i = 0; i < nr_ctxs; i++) {
HWRM_PREP(&req, HWRM_VNIC_RSS_CFG, BNXT_USE_CHIMP_MB);

req.rss_ctx_idx = rte_cpu_to_le_16(vnic->fw_grp_ids[i]);
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);

HWRM_CHECK_RESULT();
HWRM_UNLOCK();
}

return rc;
}
1 change: 1 addition & 0 deletions drivers/net/bnxt/bnxt_hwrm.h
Expand Up @@ -297,4 +297,5 @@ int bnxt_hwrm_poll_ver_get(struct bnxt *bp);
int bnxt_hwrm_ring_stats(struct bnxt *bp, uint32_t cid, int idx,
struct bnxt_ring_stats *stats, bool rx);
int bnxt_hwrm_rx_ring_reset(struct bnxt *bp, int queue_index);
int bnxt_vnic_rss_clear_p5(struct bnxt *bp, struct bnxt_vnic_info *vnic);
#endif
3 changes: 3 additions & 0 deletions drivers/net/bnxt/bnxt_rxq.c
Expand Up @@ -546,6 +546,9 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
if (active_queue_cnt == 0) {
uint16_t saved_mru = vnic->mru;

/* clear RSS setting on vnic. */
bnxt_vnic_rss_clear_p5(bp, vnic);

vnic->mru = 0;
/* Reconfigure default receive ring and MRU. */
bnxt_hwrm_vnic_cfg(bp, vnic);
Expand Down

0 comments on commit c612a4b

Please sign in to comment.