[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <566EDC99.1010604@solarflare.com>
Date: Mon, 14 Dec 2015 15:13:29 +0000
From: Edward Cree <ecree@...arflare.com>
To: Tom Herbert <tom@...bertland.com>
CC: netdev <netdev@...r.kernel.org>, David Miller <davem@...emloft.net>
Subject: [PATCH 2/2] net: vxlan: enable local checksum offload on HW_CSUM
devices
Signed-off-by: Edward Cree <ecree@...arflare.com>
---
drivers/net/vxlan.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 6369a57..c1660d6 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -1785,6 +1785,9 @@ static int vxlan_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *sk
bool udp_sum = !!(vxflags & VXLAN_F_UDP_CSUM);
int type = udp_sum ? SKB_GSO_UDP_TUNNEL_CSUM : SKB_GSO_UDP_TUNNEL;
u16 hdrlen = sizeof(struct vxlanhdr);
+ /* Is device able to do the inner checksum? */
+ bool inner_csum = skb_dst(skb) && skb_dst(skb)->dev &&
+ (skb_dst(skb)->dev->features & NETIF_F_HW_CSUM);
if ((vxflags & VXLAN_F_REMCSUM_TX) &&
skb->ip_summed == CHECKSUM_PARTIAL) {
@@ -1814,7 +1817,7 @@ static int vxlan_xmit_skb(struct rtable *rt, struct sock *sk, struct sk_buff *sk
if (WARN_ON(!skb))
return -ENOMEM;
- skb = iptunnel_handle_offloads(skb, udp_sum, type);
+ skb = iptunnel_handle_offloads(skb, udp_sum && !inner_csum, type);
if (IS_ERR(skb))
return PTR_ERR(skb);
--
2.4.3
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists