Skip to content

Commit

Permalink
net/bnxt: fix VNIC config on Rx queue stop
Browse files Browse the repository at this point in the history
[ upstream commit e36b1cd ]

Reconfigure a vnic's default ring if the current default ring is stopped
by the application. It picks the lowest numbered ring that is currently
active to be the new default, and issues the hwrm_vnic_cfg command to
update the configuration. Applies to adapters that are not Thor-based.

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

Signed-off-by: Samik Gupta <samik.gupta@broadcom.com>
Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Lance Richardson <lance.richardson@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
  • Loading branch information
sg-sray authored and bluca committed Feb 2, 2021
1 parent 906f23c commit 87fc956
Showing 1 changed file with 21 additions and 5 deletions.
26 changes: 21 additions & 5 deletions drivers/net/bnxt/bnxt_rxq.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,12 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
rc = bnxt_vnic_rss_configure(bp, vnic);
}

if (BNXT_CHIP_THOR(bp)) {
/* Compute current number of active receive queues. */
for (i = vnic->start_grp_id; i < vnic->end_grp_id; i++)
if (bp->rx_queues[i]->rx_started)
active_queue_cnt++;
/* Compute current number of active receive queues. */
for (i = vnic->start_grp_id; i < vnic->end_grp_id; i++)
if (bp->rx_queues[i]->rx_started)
active_queue_cnt++;

if (BNXT_CHIP_THOR(bp)) {
/*
* For Thor, we need to ensure that the VNIC default receive
* ring corresponds to an active receive queue. When no queue
Expand All @@ -582,6 +582,22 @@ int bnxt_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)
/* Reconfigure default receive ring. */
bnxt_hwrm_vnic_cfg(bp, vnic);
}
} else if (active_queue_cnt) {
/*
* If the queue being stopped is the current default queue and
* there are other active queues, pick one of them as the
* default and reconfigure the vnic.
*/
if (vnic->dflt_ring_grp == bp->grp_info[rx_queue_id].fw_grp_id) {
for (i = vnic->start_grp_id; i < vnic->end_grp_id; i++) {
if (bp->rx_queues[i]->rx_started) {
vnic->dflt_ring_grp =
bp->grp_info[i].fw_grp_id;
bnxt_hwrm_vnic_cfg(bp, vnic);
break;
}
}
}
}

if (rc == 0)
Expand Down

0 comments on commit 87fc956

Please sign in to comment.