]> git.itanic.dy.fi Git - linux-stable/commit
net: hns3: check FE bit before calling hns3_add_frag()
authorYunsheng Lin <linyunsheng@huawei.com>
Thu, 19 Dec 2019 06:57:40 +0000 (14:57 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Dec 2019 05:20:39 +0000 (21:20 -0800)
commitb2598318eb455c306e703ab30e18b88a1dc7df97
tree9b2b1f45650722223a58527335d79afd4f208e74
parente1b5e598e5a51b453328879682b178b4acc15105
net: hns3: check FE bit before calling hns3_add_frag()

A BD with FE bit means that it is the last BD of a packet,
currently the FE bit is checked before calling hns3_add_frag(),
which is unnecessary because the FE bit may have been checked
in some case.

This patch checks the FE bit before calling hns3_add_frag()
after processing the first BD of a SKB and adjust the location
of memcpy() to reduce duplication.

Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c