linux-stable/drivers/net/ethernet/hisilicon
Yunsheng Lin 5f543a54ee net: hns3: fix for not calculating tx bd num correctly
When there is only one byte in a frag, the current calculation
using "(size + HNS3_MAX_BD_SIZE - 1) >> HNS3_MAX_BD_SIZE_OFFSET"
will return zero, because HNS3_MAX_BD_SIZE is 65535 and
HNS3_MAX_BD_SIZE_OFFSET is 16. So it will cause tx error when
a frag's size is one byte.

This patch fixes it by using DIV_ROUND_UP.

Fixes: 3fe13ed95d ("net: hns3: avoid mult + div op in critical data path")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2019-03-21 13:59:24 -07:00
..
hns net: hns: use struct_size() in devm_kzalloc() 2019-02-27 21:47:42 -08:00
hns3 net: hns3: fix for not calculating tx bd num correctly 2019-03-21 13:59:24 -07:00
hip04_eth.c net: hisilicon: remove unexpected free_netdev 2018-11-28 10:41:15 -08:00
hisi_femac.c
hix5hd2_gmac.c cross-tree: phase out dma_zalloc_coherent() 2019-01-08 07:58:37 -05:00
hns_mdio.c net: hns: Fix wrong read accesses via Clause 45 MDIO protocol 2019-01-27 23:01:56 -08:00
Kconfig hns3: prevent building without CONFIG_INET 2018-12-14 13:17:50 -08:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00