Skip to contentSkip to conversation

net/bnxt: fix check for on-chip resources

PATCH In review Ajit Khaparde 2 participants 2 messages Jan 10, 2018 – Jan 11, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/bnxt: fix check for on-chip resources

In some cases tx_nr_rings/rx_nr_rings may not be initialized. In those scenarios, we may wrongly fail device initialization. This patch fixes it. Use max_tx_rings/max_rx_rings instead.

Fixes 2da0426e7cf8 ("net/bnxt: check on-chip resources")
---
 drivers/net/bnxt/bnxt_ethdev.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/bnxt/bnxt_ethdev.c +3 -3
index 87a07bab9..36c01fa69 100644
@@ -530,8 +530,8 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
 	bp->tx_queues = (void *)eth_dev->data->tx_queues;
 
 	/* Inherit new configurations */
-	if (eth_dev->data->nb_rx_queues > bp->rx_nr_rings ||
-	    eth_dev->data->nb_tx_queues > bp->tx_nr_rings ||
+	if (eth_dev->data->nb_rx_queues > bp->max_rx_rings ||
+	    eth_dev->data->nb_tx_queues > bp->max_tx_rings ||
 	    eth_dev->data->nb_rx_queues + eth_dev->data->nb_tx_queues + 1 >
 	    bp->max_cp_rings ||
 	    eth_dev->data->nb_rx_queues + eth_dev->data->nb_tx_queues >
@@ -545,7 +545,7 @@ static int bnxt_dev_configure_op(struct rte_eth_dev *eth_dev)
 			eth_dev->data->nb_rx_queues);
 		RTE_LOG(ERR, PMD,
 			"Res available: TxQ %d, RxQ %d, CQ %d Stat %d, Grp %d\n",
-			bp->tx_nr_rings, bp->rx_nr_rings, bp->max_cp_rings,
+			bp->max_tx_rings, bp->max_rx_rings, bp->max_cp_rings,
 			bp->max_stat_ctx, bp->max_ring_grps);
 		return -ENOSPC;
 	}
Signature · 1 line
2.14.3 (Apple Git-98)
#1 lore raw
Quoted 6 lines · Ajit Khaparde

In some cases tx_nr_rings/rx_nr_rings may not be initialized. In those scenarios, we may wrongly fail device initialization. This patch fixes it. Use max_tx_rings/max_rx_rings instead.

Fixes 2da0426e7cf8 ("net/bnxt: check on-chip resources")

Squashed into relevant commit in next-net, thanks.