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 43128b763362c8f7d613c02ce909fc3681fc325d..5ea620dcc0d46d819ff4b4e5b208ccd02ef3a01b 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 2d4634326b844d52a1c90b36be85981baa75521b..a468ac83506212f9b98985bcb3843f3d07b066ef 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;