net: hns3: replace macro HNS3_MAX_NON_TSO_BD_NUM
authorHuazhong Tan <tanhuazhong@huawei.com>
Tue, 29 Sep 2020 09:31:59 +0000 (17:31 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 Sep 2020 20:14:24 +0000 (13:14 -0700)
commitfd665b3dbafdfb6c1caa4908849ce545f8066f58
tree2e80c505f9f645f265e923273c8de3d4bfb0be90
parentc2f8cedae8c2a56e6e86bfdac40821ec1a0a760d
net: hns3: replace macro HNS3_MAX_NON_TSO_BD_NUM

Currently, the driver is able to query the device's specifications,
which includes the maximum BD number of non TSO packet, so replace
macro HNS3_MAX_NON_TSO_BD_NUM with the queried value, and rewrite
macro HNS3_MAX_NON_TSO_SIZE whose value depends on the the maximum
BD number of non TSO packet.

Also, add a new parameter max_non_tso_bd_num to function
hns3_tx_bd_num() and hns3_skb_need_linearized(), then they can get
the maximum BD number of non TSO packet from the caller instead of
calculating by themself, The note of hns3_skb_need_linearized()
should be update as well.

Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h