nfp: provide a better warning when ring allocation fails
authorJakub Kicinski <jakub.kicinski@netronome.com>
Wed, 19 Sep 2018 21:42:50 +0000 (14:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:00:18 +0000 (18:00 +0100)
commit93c6eddad8473bc6582b865200add350ddab40ea
tree5a7c4b938a56860c19fd887b89f9d8e94fc31917
parent947ef993e0cbd389f25c6deb545fc78bb55f7f55
nfp: provide a better warning when ring allocation fails

[ Upstream commit 23d9f5531c7c28546954b0bf332134a9b8a38c0a ]

NFP supports fairly enormous ring sizes (up to 256k descriptors).
In commit 466271703867 ("nfp: use kvcalloc() to allocate SW buffer
descriptor arrays") we have started using kvcalloc() functions to
make sure the allocation of software state arrays doesn't hit
the MAX_ORDER limit.  Unfortunately, we can't use virtual mappings
for the DMA region holding HW descriptors.  In case this allocation
fails instead of the generic (and fairly scary) warning/splat in
the logs print a helpful message explaining what happened and
suggesting how to fix it.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c