|
@@ -7799,10 +7799,12 @@ static inline bool ixgbe_ipv6_csum_is_sctp(struct sk_buff *skb)
|
|
}
|
|
}
|
|
|
|
|
|
static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring,
|
|
static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring,
|
|
- struct ixgbe_tx_buffer *first)
|
|
|
|
|
|
+ struct ixgbe_tx_buffer *first,
|
|
|
|
+ struct ixgbe_ipsec_tx_data *itd)
|
|
{
|
|
{
|
|
struct sk_buff *skb = first->skb;
|
|
struct sk_buff *skb = first->skb;
|
|
u32 vlan_macip_lens = 0;
|
|
u32 vlan_macip_lens = 0;
|
|
|
|
+ u32 fceof_saidx = 0;
|
|
u32 type_tucmd = 0;
|
|
u32 type_tucmd = 0;
|
|
|
|
|
|
if (skb->ip_summed != CHECKSUM_PARTIAL) {
|
|
if (skb->ip_summed != CHECKSUM_PARTIAL) {
|
|
@@ -7843,7 +7845,12 @@ no_csum:
|
|
vlan_macip_lens |= skb_network_offset(skb) << IXGBE_ADVTXD_MACLEN_SHIFT;
|
|
vlan_macip_lens |= skb_network_offset(skb) << IXGBE_ADVTXD_MACLEN_SHIFT;
|
|
vlan_macip_lens |= first->tx_flags & IXGBE_TX_FLAGS_VLAN_MASK;
|
|
vlan_macip_lens |= first->tx_flags & IXGBE_TX_FLAGS_VLAN_MASK;
|
|
|
|
|
|
- ixgbe_tx_ctxtdesc(tx_ring, vlan_macip_lens, 0, type_tucmd, 0);
|
|
|
|
|
|
+ if (first->tx_flags & IXGBE_TX_FLAGS_IPSEC) {
|
|
|
|
+ fceof_saidx |= itd->sa_idx;
|
|
|
|
+ type_tucmd |= itd->flags | itd->trailer_len;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ ixgbe_tx_ctxtdesc(tx_ring, vlan_macip_lens, fceof_saidx, type_tucmd, 0);
|
|
}
|
|
}
|
|
|
|
|
|
#define IXGBE_SET_FLAG(_input, _flag, _result) \
|
|
#define IXGBE_SET_FLAG(_input, _flag, _result) \
|
|
@@ -7886,11 +7893,16 @@ static void ixgbe_tx_olinfo_status(union ixgbe_adv_tx_desc *tx_desc,
|
|
IXGBE_TX_FLAGS_CSUM,
|
|
IXGBE_TX_FLAGS_CSUM,
|
|
IXGBE_ADVTXD_POPTS_TXSM);
|
|
IXGBE_ADVTXD_POPTS_TXSM);
|
|
|
|
|
|
- /* enble IPv4 checksum for TSO */
|
|
|
|
|
|
+ /* enable IPv4 checksum for TSO */
|
|
olinfo_status |= IXGBE_SET_FLAG(tx_flags,
|
|
olinfo_status |= IXGBE_SET_FLAG(tx_flags,
|
|
IXGBE_TX_FLAGS_IPV4,
|
|
IXGBE_TX_FLAGS_IPV4,
|
|
IXGBE_ADVTXD_POPTS_IXSM);
|
|
IXGBE_ADVTXD_POPTS_IXSM);
|
|
|
|
|
|
|
|
+ /* enable IPsec */
|
|
|
|
+ olinfo_status |= IXGBE_SET_FLAG(tx_flags,
|
|
|
|
+ IXGBE_TX_FLAGS_IPSEC,
|
|
|
|
+ IXGBE_ADVTXD_POPTS_IPSEC);
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* Check Context must be set if Tx switch is enabled, which it
|
|
* Check Context must be set if Tx switch is enabled, which it
|
|
* always is for case where virtual functions are running
|
|
* always is for case where virtual functions are running
|
|
@@ -8354,6 +8366,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
|
|
u32 tx_flags = 0;
|
|
u32 tx_flags = 0;
|
|
unsigned short f;
|
|
unsigned short f;
|
|
u16 count = TXD_USE_COUNT(skb_headlen(skb));
|
|
u16 count = TXD_USE_COUNT(skb_headlen(skb));
|
|
|
|
+ struct ixgbe_ipsec_tx_data ipsec_tx = { 0 };
|
|
__be16 protocol = skb->protocol;
|
|
__be16 protocol = skb->protocol;
|
|
u8 hdr_len = 0;
|
|
u8 hdr_len = 0;
|
|
|
|
|
|
@@ -8458,11 +8471,16 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
|
|
}
|
|
}
|
|
|
|
|
|
#endif /* IXGBE_FCOE */
|
|
#endif /* IXGBE_FCOE */
|
|
|
|
+
|
|
|
|
+#ifdef CONFIG_XFRM_OFFLOAD
|
|
|
|
+ if (skb->sp && !ixgbe_ipsec_tx(tx_ring, first, &ipsec_tx))
|
|
|
|
+ goto out_drop;
|
|
|
|
+#endif
|
|
tso = ixgbe_tso(tx_ring, first, &hdr_len);
|
|
tso = ixgbe_tso(tx_ring, first, &hdr_len);
|
|
if (tso < 0)
|
|
if (tso < 0)
|
|
goto out_drop;
|
|
goto out_drop;
|
|
else if (!tso)
|
|
else if (!tso)
|
|
- ixgbe_tx_csum(tx_ring, first);
|
|
|
|
|
|
+ ixgbe_tx_csum(tx_ring, first, &ipsec_tx);
|
|
|
|
|
|
/* add the ATR filter if ATR is on */
|
|
/* add the ATR filter if ATR is on */
|
|
if (test_bit(__IXGBE_TX_FDIR_INIT_DONE, &tx_ring->state))
|
|
if (test_bit(__IXGBE_TX_FDIR_INIT_DONE, &tx_ring->state))
|