xref: /linux/drivers/net/ethernet/netronome/nfp/nfdk/ipsec.c (revision 5e0266f0e5f57617472d5aac4013f58a3ef264ac)
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 /* Copyright (C) 2023 Corigine, Inc */
3 
4 #include <net/xfrm.h>
5 
6 #include "../nfp_net.h"
7 #include "nfdk.h"
8 
9 u64 nfp_nfdk_ipsec_tx(u64 flags, struct sk_buff *skb)
10 {
11 	struct xfrm_state *x = xfrm_input_state(skb);
12 
13 	if (x->xso.dev && (x->xso.dev->features & NETIF_F_HW_ESP_TX_CSUM))
14 		flags |= NFDK_DESC_TX_L3_CSUM | NFDK_DESC_TX_L4_CSUM;
15 
16 	return flags;
17 }
18