[ovs-dev] [PATCH 2/2] datapath: Assert IFF_TX_SKB_SHARING on internal devices.

Jesse Gross jesse at nicira.com
Mon Oct 17 22:10:53 PDT 2011


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 at nicira.com>
---
 datapath/linux/compat/include/linux/if.h |    4 ++++
 datapath/vport-internal_dev.c            |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/datapath/linux/compat/include/linux/if.h b/datapath/linux/compat/include/linux/if.h
index 43128b7..5ea620d 100644
--- a/datapath/linux/compat/include/linux/if.h
+++ b/datapath/linux/compat/include/linux/if.h
@@ -10,6 +10,10 @@
 
 #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)
diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c
index 2d46343..a468ac8 100644
--- a/datapath/vport-internal_dev.c
+++ b/datapath/vport-internal_dev.c
@@ -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;
-- 
1.7.5.4




More information about the dev mailing list