net: hns3: add max vector number check for pf
commit0453c5dd8b826b7c4a711670357448b83d72d846
authorJian Shen <shenjian15@huawei.com>
Thu, 20 Dec 2018 03:52:01 +0000 (20 11:52 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 19:02:24 +0000 (12 20:02 +0100)
tree872af75d4f565745fee0270b69853f7f31a3eee9
parente8fdcc65642ec6865f0a6d865e5ec5fab1f5ca19
net: hns3: add max vector number check for pf

[ Upstream commit 75edb610860fda65ceedb017fc69afabd2806b8b ]

Each pf supports max 64 vectors and 128 tqps. For 2p/4p core scenario,
there may be more than 64 cpus online. So the result of min_t(u16,
num_Online_cpus(), tqp_num) may be more than 64. This patch adds check
for the vector number.

Fixes: dd38c72604dc ("net: hns3: fix for coalesce configuration lost during reset")
Signed-off-by: Jian Shen <shenjian15@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c