Messages in this thread | | | Date | Thu, 21 Mar 2019 13:59:55 -0700 (PDT) | Subject | Re: [PATCH net] net: hns3: fix for not calculating tx bd num correctly | From | David Miller <> |
| |
From: l00371289 <linyunsheng@huawei.com> Date: Thu, 21 Mar 2019 11:28:43 +0800
> From: Yunsheng Lin <linyunsheng@huawei.com> > > 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: 3fe13ed95dd3 ("net: hns3: avoid mult + div op in critical data path") > Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Applied.
| |