net: hns3: change SSU's buffer allocation according to UM
authorYunsheng Lin <linyunsheng@huawei.com>
Fri, 28 Jun 2019 11:50:09 +0000 (19:50 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Jun 2019 16:39:49 +0000 (09:39 -0700)
commit9e15be90b85a793815cae92aef80a2907a58bcfc
treef24ffaa361340c93c8b4de91af5bc4239dcedcf8
parentae179b2f05189844616ce629ec1e644ad52f35fd
net: hns3: change SSU's buffer allocation according to UM

Currently when there is share buffer in the SSU(storage
switching unit), the low waterline for RX private buffer is
too low to keep the hardware running. Hardware may have
processed all the packet stored in the private buffer of the
low waterline before the new packet comes, because hardware
only tell the peer send packet again when the private buffer
is under the low waterline.

So this patch only allocate RX private buffer if there is
enough buffer according to hardware user manual.

This patch also reserve some buffer for reusing when TC num
is less than or equal to 2, and change PAUSE_TRANS_GAP &
HCLGE_NON_DCB_ADDITIONAL_BUF according to hardware user
manual.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_cmd.h
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.h