datapath: compat: Set OVS-GSO segment handler only for GSO packet.
authorPravin B Shelar <pshelar@ovn.org>
Sun, 17 Jul 2016 16:52:02 +0000 (09:52 -0700)
committerPravin B Shelar <pshelar@ovn.org>
Sun, 17 Jul 2016 17:25:08 +0000 (10:25 -0700)
This simplify OVS compat code where non gso packet can be directly sent
to network stack.

Signed-off-by: Pravin B Shelar <pshelar@ovn.org>
Acked-by: Jesse Gross <jesse@kernel.org>
datapath/linux/compat/ip_tunnels_core.c

index 65b5aea..3964c4b 100644 (file)
@@ -104,17 +104,18 @@ int ovs_iptunnel_handle_offloads(struct sk_buff *skb,
                goto error;
        }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
-       if (gso_type_mask)
-               fix_segment = NULL;
-
-       OVS_GSO_CB(skb)->fix_segment = fix_segment;
-#endif
        if (skb_is_gso(skb)) {
                err = skb_unclone(skb, GFP_ATOMIC);
                if (unlikely(err))
                        goto error;
                skb_shinfo(skb)->gso_type |= gso_type_mask;
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,18,0)
+               if (gso_type_mask)
+                       fix_segment = NULL;
+
+               OVS_GSO_CB(skb)->fix_segment = fix_segment;
+#endif
                return 0;
        }