diff options
author | Edward Cree <ecree@solarflare.com> | 2020-11-12 16:20:05 +0100 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-11-14 00:33:30 +0100 |
commit | c5122cf584128f9d42655189e69fda7151c1f275 (patch) | |
tree | fd0dcb5c24fc2dd2dcc7e7bce6478f9ad8a25218 /drivers/net/ethernet/sfc/ef100_tx.c | |
parent | sfc: correctly support non-partial GSO_UDP_TUNNEL_CSUM on EF100 (diff) | |
download | linux-c5122cf584128f9d42655189e69fda7151c1f275.tar.xz linux-c5122cf584128f9d42655189e69fda7151c1f275.zip |
sfc: support GRE TSO on EF100
We can treat SKB_GSO_GRE almost exactly the same as UDP tunnels, except
that we don't want to edit the outer UDP len (as there isn't one).
For SKB_GSO_GRE_CSUM, we have to use GSO_PARTIAL as the device doesn't
support offload of non-UDP outer L4 checksums.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Acked-by: Martin Habets <mhabets@solarflare.com>
Reviewed-by: Alexander Duyck <alexanderduyck@fb.com>
Diffstat (limited to '')
-rw-r--r-- | drivers/net/ethernet/sfc/ef100_tx.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/ethernet/sfc/ef100_tx.c b/drivers/net/ethernet/sfc/ef100_tx.c index a9e045c54a79..26ef51d6b542 100644 --- a/drivers/net/ethernet/sfc/ef100_tx.c +++ b/drivers/net/ethernet/sfc/ef100_tx.c @@ -194,6 +194,7 @@ static void ef100_make_tso_desc(struct efx_nic *efx, u16 vlan_tci = skb_vlan_tag_get(skb); u32 mss = skb_shinfo(skb)->gso_size; bool encap = skb->encapsulation; + bool udp_encap = false; u16 vlan_enable = 0; struct tcphdr *tcp; bool outer_csum; @@ -212,6 +213,9 @@ static void ef100_make_tso_desc(struct efx_nic *efx, outer_l4_offset = skb_transport_offset(skb); ip_offset = skb_inner_network_offset(skb); tcp_offset = skb_inner_transport_offset(skb); + if (skb_shinfo(skb)->gso_type & + (SKB_GSO_UDP_TUNNEL | SKB_GSO_UDP_TUNNEL_CSUM)) + udp_encap = true; } else { ip_offset = skb_network_offset(skb); tcp_offset = skb_transport_offset(skb); @@ -239,7 +243,7 @@ static void ef100_make_tso_desc(struct efx_nic *efx, ESF_GZ_TX_TSO_ED_INNER_IP_LEN, 1, ESF_GZ_TX_TSO_OUTER_L3_OFF_W, outer_ip_offset >> 1, ESF_GZ_TX_TSO_OUTER_L4_OFF_W, outer_l4_offset >> 1, - ESF_GZ_TX_TSO_ED_OUTER_UDP_LEN, encap && !gso_partial, + ESF_GZ_TX_TSO_ED_OUTER_UDP_LEN, udp_encap && !gso_partial, ESF_GZ_TX_TSO_ED_OUTER_IP_LEN, encap && !gso_partial, ESF_GZ_TX_TSO_ED_OUTER_IP4_ID, encap ? mangleid : ESE_GZ_TX_DESC_IP4_ID_NO_OP, |