net: hns3: fix a SSU buffer checking bug
authorYunsheng Lin <linyunsheng@huawei.com>
Tue, 18 Dec 2018 11:37:59 +0000 (19:37 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Dec 2018 20:01:01 +0000 (12:01 -0800)
commitaf854724e51e4047f534ac6d19b3ef9fb3c35c49
treec384b2bf3bbc62018e1e711c875dec96dcca5eed
parentb9a400ac295728b2d47445e09814e1880409b311
net: hns3: fix a SSU buffer checking bug

When caculating the SSU buffer, it first allocate tx and
rx private buffer, then the remaining buffer is for rx
shared buffer. The remaining buffer size should be at
least bigger than or equal to the shared_std, which is the
minimum shared buffer size required by the driver, but
currently if the remaining buffer size is equal to the
shared_std, it returns failure, which causes SSU buffer
allocation failure problem.

This patch fixes this problem by rounding up shared_std before
checking the the remaining buffer size bigger than or equal to
the shared_std.

Fixes: 46a3df9f9718 ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c