ACK: [PATCH][SRU][Disco] net: hns3: fix for not calculating tx bd num correctly

Seth Forshee seth.forshee at canonical.com
Thu Apr 11 14:17:50 UTC 2019


On Wed, Apr 10, 2019 at 11:08:07AM -0600, dann frazier wrote:
> From: Yunsheng Lin <linyunsheng at huawei.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1824194
> 
> 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 at huawei.com>
> Signed-off-by: David S. Miller <davem at davemloft.net>
> (cherry picked from commit 5f543a54eec08228ab0cc0a49cf5d79dd32c9e5e)
> Signed-off-by: dann frazier <dann.frazier at canonical.com>

Upsteam cherry pick, limited impact, positive testing.

Acked-by: Seth Forshee <seth.forshee at canonical.com>



More information about the kernel-team mailing list