• Yunsheng Lin's avatar
    net: hns3: fix a SSU buffer checking bug · af854724
    Yunsheng Lin authored
    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: 46a3df9f ("net: hns3: Add HNS3 Acceleration Engine & Compatibility Layer Support")
    Signed-off-by: default avatarYunsheng Lin <linyunsheng@huawei.com>
    Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    af854724
hclge_main.c 209 KB