]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
nfp: fix esp-tx-csum-offload doesn't take effect
authorHuanhuan Wang <huanhuan.wang@corigine.com>
Thu, 2 Mar 2023 09:58:30 +0000 (10:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 17 Mar 2023 07:57:54 +0000 (08:57 +0100)
[ Upstream commit 1cf78d4c4144ffdbc2c9d505db482cb204bb480b ]

When esp-tx-csum-offload is set to on, the protocol stack shouldn't
calculate the IPsec offload packet's csum, but it does. Because the
callback `.ndo_features_check` incorrectly masked NETIF_F_CSUM_MASK bit.

Fixes: 57f273adbcd4 ("nfp: add framework to support ipsec offloading")
Signed-off-by: Huanhuan Wang <huanhuan.wang@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/netronome/nfp/nfp_net_common.c

index 70d7484c82af4cc8cf7894f4fdce99e7857a94b3..1182fa48a3b54f2a8853b1f43294c6e57a33a680 100644 (file)
@@ -38,6 +38,7 @@
 #include <net/tls.h>
 #include <net/vxlan.h>
 #include <net/xdp_sock_drv.h>
+#include <net/xfrm.h>
 
 #include "nfpcore/nfp_dev.h"
 #include "nfpcore/nfp_nsp.h"
@@ -1897,6 +1898,9 @@ nfp_net_features_check(struct sk_buff *skb, struct net_device *dev,
                        features &= ~NETIF_F_GSO_MASK;
        }
 
+       if (xfrm_offload(skb))
+               return features;
+
        /* VXLAN/GRE check */
        switch (vlan_get_protocol(skb)) {
        case htons(ETH_P_IP):