net: hns3: fix for multiple unmapping DMA problem
authorFuyun Liang <liangfuyun1@huawei.com>
Tue, 16 Oct 2018 11:58:52 +0000 (19:58 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 16 Oct 2018 17:09:59 +0000 (10:09 -0700)
commitbcdb12b70c5266a78430a248e57c8c122839b951
tree0daebb53cf98740b417c343b8490f2d75a231d36
parentba3f808f5cc15882e5aa565d253522e179148c64
net: hns3: fix for multiple unmapping DMA problem

When sending a big fragment using multiple buffer descriptor,
hns3 does one maping, but do multiple unmapping when tx is done,
which may cause unmapping problem.

To fix it, this patch makes sure the value of desc_cb.length of
the non-first bd is zero. If desc_cb.length is zero, we do not
unmap the buffer.

Fixes: 76ad4f0ee747 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Fuyun Liang <liangfuyun1@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c