Skip to content

Commit 7fa57ca

Browse files
Shannon NelsonJeff Kirsher
authored andcommitted
ixgbe: allow IPsec Tx offload in VEPA mode
When it's possible that the PF might end up trying to send a packet to one of its own VFs, we have to forbid IPsec offload because the device drops the packets into a black hole. See commit 47b6f50 ("ixgbe: disallow IPsec Tx offload when in SR-IOV mode") for more info. This really is only necessary when the device is in the default VEB mode. If instead the device is running in VEPA mode, the packets will go through the encryption engine and out the MAC/PHY as normal, and get "hairpinned" as needed by the switch. So let's not block IPsec offload when in VEPA mode. To get there with the ixgbe device, use the handy 'bridge' command: bridge link set dev eth1 hwmode vepa Signed-off-by: Shannon Nelson <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 0db4a47 commit 7fa57ca

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include "ixgbe.h"
55
#include <net/xfrm.h>
66
#include <crypto/aead.h>
7+
#include <linux/if_bridge.h>
78

89
#define IXGBE_IPSEC_KEY_BITS 160
910
static const char aes_gcm_name[] = "rfc4106(gcm(aes))";
@@ -693,7 +694,8 @@ static int ixgbe_ipsec_add_sa(struct xfrm_state *xs)
693694
} else {
694695
struct tx_sa tsa;
695696

696-
if (adapter->num_vfs)
697+
if (adapter->num_vfs &&
698+
adapter->bridge_mode != BRIDGE_MODE_VEPA)
697699
return -EOPNOTSUPP;
698700

699701
/* find the first unused index */

0 commit comments

Comments
 (0)