nfp: fix incorrectly set csum flag for nfd3 path
authorHuanhuan Wang <huanhuan.wang@corigine.com>
Thu, 2 Mar 2023 09:58:28 +0000 (10:58 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 3 Mar 2023 08:28:44 +0000 (08:28 +0000)
commit3e04419cbe2d0bc10ffc20c006c6513ffa4b1ca3
tree4c7f009ae404c292de52bd2b93bc6d1e465b3b96
parent84cba1840e68430325ac133a11be06bfb2f7acd8
nfp: fix incorrectly set csum flag for nfd3 path

The csum flag of IPsec packet are set repeatedly. Therefore, the csum
flag set of IPsec and non-IPsec packet need to be distinguished.

As the ipv6 header does not have a csum field, so l3-csum flag is not
required to be set for ipv6 case.

L4-csum flag include the tcp csum flag and udp csum flag, we shouldn't
set the udp and tcp csum flag at the same time for one packet, should
set l4-csum flag according to the transport layer is tcp or udp.

Fixes: 57f273adbcd4 ("nfp: add framework to support ipsec offloading")
Signed-off-by: Huanhuan Wang <huanhuan.wang@corigine.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/nfd3/dp.c
drivers/net/ethernet/netronome/nfp/nfd3/ipsec.c