qede: GSO support for tunnels with outer csum
This patch adds GSO support for GRE and UDP tunnels where outer checksums are enabled. Signed-off-by: Manish Chopra <manish.chopra@caviumnetworks.com> Signed-off-by: Yuval Mintz <Yuval.Mintz@caviumnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c3aaa40384
commit
a150241ccf
|
@ -320,6 +320,7 @@ struct qede_fastpath {
|
||||||
#define XMIT_L4_CSUM BIT(0)
|
#define XMIT_L4_CSUM BIT(0)
|
||||||
#define XMIT_LSO BIT(1)
|
#define XMIT_LSO BIT(1)
|
||||||
#define XMIT_ENC BIT(2)
|
#define XMIT_ENC BIT(2)
|
||||||
|
#define XMIT_ENC_GSO_L4_CSUM BIT(3)
|
||||||
|
|
||||||
#define QEDE_CSUM_ERROR BIT(0)
|
#define QEDE_CSUM_ERROR BIT(0)
|
||||||
#define QEDE_CSUM_UNNECESSARY BIT(1)
|
#define QEDE_CSUM_UNNECESSARY BIT(1)
|
||||||
|
|
|
@ -400,8 +400,19 @@ static u32 qede_xmit_type(struct qede_dev *edev,
|
||||||
(ipv6_hdr(skb)->nexthdr == NEXTHDR_IPV6))
|
(ipv6_hdr(skb)->nexthdr == NEXTHDR_IPV6))
|
||||||
*ipv6_ext = 1;
|
*ipv6_ext = 1;
|
||||||
|
|
||||||
if (skb->encapsulation)
|
if (skb->encapsulation) {
|
||||||
rc |= XMIT_ENC;
|
rc |= XMIT_ENC;
|
||||||
|
if (skb_is_gso(skb)) {
|
||||||
|
unsigned short gso_type = skb_shinfo(skb)->gso_type;
|
||||||
|
|
||||||
|
if ((gso_type & SKB_GSO_UDP_TUNNEL_CSUM) ||
|
||||||
|
(gso_type & SKB_GSO_GRE_CSUM))
|
||||||
|
rc |= XMIT_ENC_GSO_L4_CSUM;
|
||||||
|
|
||||||
|
rc |= XMIT_LSO;
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (skb_is_gso(skb))
|
if (skb_is_gso(skb))
|
||||||
rc |= XMIT_LSO;
|
rc |= XMIT_LSO;
|
||||||
|
@ -637,6 +648,12 @@ static netdev_tx_t qede_start_xmit(struct sk_buff *skb,
|
||||||
if (unlikely(xmit_type & XMIT_ENC)) {
|
if (unlikely(xmit_type & XMIT_ENC)) {
|
||||||
first_bd->data.bd_flags.bitfields |=
|
first_bd->data.bd_flags.bitfields |=
|
||||||
1 << ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_SHIFT;
|
1 << ETH_TX_1ST_BD_FLAGS_TUNN_IP_CSUM_SHIFT;
|
||||||
|
|
||||||
|
if (xmit_type & XMIT_ENC_GSO_L4_CSUM) {
|
||||||
|
u8 tmp = ETH_TX_1ST_BD_FLAGS_TUNN_L4_CSUM_SHIFT;
|
||||||
|
|
||||||
|
first_bd->data.bd_flags.bitfields |= 1 << tmp;
|
||||||
|
}
|
||||||
hlen = qede_get_skb_hlen(skb, true);
|
hlen = qede_get_skb_hlen(skb, true);
|
||||||
} else {
|
} else {
|
||||||
first_bd->data.bd_flags.bitfields |=
|
first_bd->data.bd_flags.bitfields |=
|
||||||
|
@ -2320,11 +2337,14 @@ static void qede_init_ndev(struct qede_dev *edev)
|
||||||
|
|
||||||
/* Encap features*/
|
/* Encap features*/
|
||||||
hw_features |= NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL |
|
hw_features |= NETIF_F_GSO_GRE | NETIF_F_GSO_UDP_TUNNEL |
|
||||||
NETIF_F_TSO_ECN;
|
NETIF_F_TSO_ECN | NETIF_F_GSO_UDP_TUNNEL_CSUM |
|
||||||
|
NETIF_F_GSO_GRE_CSUM;
|
||||||
ndev->hw_enc_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
|
ndev->hw_enc_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
|
||||||
NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO_ECN |
|
NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO_ECN |
|
||||||
NETIF_F_TSO6 | NETIF_F_GSO_GRE |
|
NETIF_F_TSO6 | NETIF_F_GSO_GRE |
|
||||||
NETIF_F_GSO_UDP_TUNNEL | NETIF_F_RXCSUM;
|
NETIF_F_GSO_UDP_TUNNEL | NETIF_F_RXCSUM |
|
||||||
|
NETIF_F_GSO_UDP_TUNNEL_CSUM |
|
||||||
|
NETIF_F_GSO_GRE_CSUM;
|
||||||
|
|
||||||
ndev->vlan_features = hw_features | NETIF_F_RXHASH | NETIF_F_RXCSUM |
|
ndev->vlan_features = hw_features | NETIF_F_RXHASH | NETIF_F_RXCSUM |
|
||||||
NETIF_F_HIGHDMA;
|
NETIF_F_HIGHDMA;
|
||||||
|
|
Loading…
Reference in New Issue