lkml.org 
[lkml]   [2019]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net] net: hns3: fix for not calculating tx bd num correctly
From
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.

\
 
 \ /
  Last update: 2019-03-21 22:00    [W:0.046 / U:3.076 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site