From: Ganesh Goudar Date: Tue, 18 Oct 2016 08:51:25 +0000 (+0530) Subject: cxgb4: Fix number of queue sets corssing the limit X-Git-Tag: v4.9-rc4~28^2~84 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a56177e18f2e44499a8bf5bc03dbe896dbec657d;p=platform%2Fkernel%2Flinux-exynos.git 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 Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c index f320497..57eb4e1 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +++ b/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;