Browse Source

cxgb4: Fix number of queue sets corssing the limit

Do not let number of offload queue sets to go more than
MAX_OFLD_QSETS, which would otherwise crash the driver
on machines with cores more than MAX_OFLD_QSETS.

Signed-off-by: Ganesh Goudar <ganeshgr@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Ganesh Goudar 8 years ago
parent
commit
a56177e18f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

+ 1 - 1
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

@@ -4057,7 +4057,7 @@ static void cfg_queues(struct adapter *adap)
 		 * capped by the number of available cores.
 		 */
 		if (n10g) {
-			i = num_online_cpus();
+			i = min_t(int, MAX_OFLD_QSETS, num_online_cpus());
 			s->ofldqsets = roundup(i, adap->params.nports);
 		} else {
 			s->ofldqsets = adap->params.nports;