datapath: Assert IFF_TX_SKB_SHARING on internal devices.
authorJesse Gross <jesse@nicira.com>
Wed, 21 Sep 2011 02:09:50 +0000 (19:09 -0700)
committerJesse Gross <jesse@nicira.com>
Tue, 18 Oct 2011 16:24:37 +0000 (09:24 -0700)
Linux 3.1 adds a flag to check whether it's OK for shared skbs to
be transmitted on devices.  This generally isn't a problem for
hardware devices but software devices such as OVS that hold state
in the skb need to clear the flag, which is enabled by default.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
datapath/linux/compat/include/linux/if.h
datapath/vport-internal_dev.c

index 43128b7..5ea620d 100644 (file)
 
 #endif /* linux kernel < 2.6.31 */
 
+#ifndef IFF_TX_SKB_SHARING
+#define IFF_TX_SKB_SHARING 0
+#endif
+
 #if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,36)
 #define IFF_OVS_DATAPATH IFF_BRIDGE_PORT
 #elif LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
index 2d46343..a468ac8 100644 (file)
@@ -171,6 +171,7 @@ static void do_setup(struct net_device *netdev)
        netdev->change_mtu = internal_dev_change_mtu;
 #endif
 
+       netdev->priv_flags &= ~IFF_TX_SKB_SHARING;
        netdev->destructor = internal_dev_destructor;
        SET_ETHTOOL_OPS(netdev, &internal_dev_ethtool_ops);
        netdev->tx_queue_len = 0;