net: hns3: divide shared buffer between TC
authorYunsheng Lin <linyunsheng@huawei.com>
Sun, 14 Apr 2019 01:47:42 +0000 (09:47 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 14 Apr 2019 20:47:35 +0000 (13:47 -0700)
commit1a49f3c6146f33c42523c8e4f5a72b6f322d5357
tree65bd6847c875209a6f5981e168147326fab6c45b
parentdb5936db8f9e024cdbb988dab1606f2c205bb385
net: hns3: divide shared buffer between TC

Currently hardware may have not enough buffer to receive packet
when it has used more than two MPS(maximum packet size) of
buffer, but there are still a lot of shared buffer left unused
when TC num is small.

This patch divides shared buffer to be used between TC when
the port supports DCB, and adjusts the waterline and threshold
according to user manual for the port that does not support
DCB.

This patch also change hclge_get_tc_num's return type to u32
to avoid signed-unsigned mix with divide.

Signed-off-by: Yunsheng Lin <linyunsheng@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_main.c