net: hns3: refactor out RX completion checksum
authorHuazhong Tan <tanhuazhong@huawei.com>
Fri, 14 May 2021 03:25:10 +0000 (11:25 +0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 May 2021 22:07:33 +0000 (15:07 -0700)
commit1ddc028ac84988b6b1c9ceb9d15acbf321735ca3
treee8fb978c0232ab1df6a6b25a36fcdce310710f87
parent796640778c26f3d99fde173bb7b1d726b5f0d816
net: hns3: refactor out RX completion checksum

Only when RXD advanced layout is enabled, in some cases
(e.g. ip fragments), the checksum of entire packet will be
calculated and filled in the least significant 16 bits of
the unused addr field.

So refactor out the handling of RX completion checksum: adjust
the location of the checksum in RX descriptor, and use ptype table
to identify whether this kind of checksum is calculated.

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