From: Jesse Gross Date: Wed, 21 Sep 2011 02:09:50 +0000 (-0700) Subject: datapath: Assert IFF_TX_SKB_SHARING on internal devices. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c8482e9e3459ee429ce093b6038b0ed49949c1b;p=openvswitch datapath: Assert IFF_TX_SKB_SHARING on internal devices. 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 Acked-by: Ben Pfaff --- diff --git a/datapath/linux/compat/include/linux/if.h b/datapath/linux/compat/include/linux/if.h index 43128b76..5ea620dc 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 2d463432..a468ac83 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;