aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorNeil Horman <nhorman@tuxdriver.com>2011-07-26 02:05:38 -0400
committerDavid S. Miller <davem@davemloft.net>2011-07-28 01:39:30 -0400
commit550fd08c2cebad61c548def135f67aba284c6162 (patch)
tree8aa7c4d20a9faeb42261b75cfa38d8fd27b574ff /drivers
parentd8873315065f1f527c7c380402cf59b1e1d0ae36 (diff)
net: Audit drivers to identify those needing IFF_TX_SKB_SHARING cleared
After the last patch, We are left in a state in which only drivers calling ether_setup have IFF_TX_SKB_SHARING set (we assume that drivers touching real hardware call ether_setup for their net_devices and don't hold any state in their skbs. There are a handful of drivers that violate this assumption of course, and need to be fixed up. This patch identifies those drivers, and marks them as not being able to support the safe transmission of skbs by clearning the IFF_TX_SKB_SHARING flag in priv_flags Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Karsten Keil <isdn@linux-pingi.de> CC: "David S. Miller" <davem@davemloft.net> CC: Jay Vosburgh <fubar@us.ibm.com> CC: Andy Gospodarek <andy@greyhouse.net> CC: Patrick McHardy <kaber@trash.net> CC: Krzysztof Halasa <khc@pm.waw.pl> CC: "John W. Linville" <linville@tuxdriver.com> CC: Greg Kroah-Hartman <gregkh@suse.de> CC: Marcel Holtmann <marcel@holtmann.org> CC: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/isdn/i4l/isdn_net.c3
-rw-r--r--drivers/net/bonding/bond_main.c6
-rw-r--r--drivers/net/ifb.c2
-rw-r--r--drivers/net/macvlan.c2
-rw-r--r--drivers/net/tun.c1
-rw-r--r--drivers/net/veth.c2
-rw-r--r--drivers/net/wan/hdlc_fr.c5
-rw-r--r--drivers/net/wireless/airo.c1
-rw-r--r--drivers/net/wireless/hostap/hostap_main.c1
-rw-r--r--drivers/staging/ath6kl/os/linux/ar6000_drv.c1
10 files changed, 18 insertions, 6 deletions
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c
index 48e9cc0369b1..1f73d7f7e024 100644
--- a/drivers/isdn/i4l/isdn_net.c
+++ b/drivers/isdn/i4l/isdn_net.c
@@ -2532,6 +2532,9 @@ static void _isdn_setup(struct net_device *dev)
2532 2532
2533 /* Setup the generic properties */ 2533 /* Setup the generic properties */
2534 dev->flags = IFF_NOARP|IFF_POINTOPOINT; 2534 dev->flags = IFF_NOARP|IFF_POINTOPOINT;
2535
2536 /* isdn prepends a header in the tx path, can't share skbs */
2537 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
2535 dev->header_ops = NULL; 2538 dev->header_ops = NULL;
2536 dev->netdev_ops = &isdn_netdev_ops; 2539 dev->netdev_ops = &isdn_netdev_ops;
2537 2540
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 02842d05c11f..df21e84f8198 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1557,8 +1557,10 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
1557 1557
1558 if (slave_dev->type != ARPHRD_ETHER) 1558 if (slave_dev->type != ARPHRD_ETHER)
1559 bond_setup_by_slave(bond_dev, slave_dev); 1559 bond_setup_by_slave(bond_dev, slave_dev);
1560 else 1560 else {
1561 ether_setup(bond_dev); 1561 ether_setup(bond_dev);
1562 bond_dev->priv_flags &= ~IFF_TX_SKB_SHARING;
1563 }
1562 1564
1563 netdev_bonding_change(bond_dev, 1565 netdev_bonding_change(bond_dev,
1564 NETDEV_POST_TYPE_CHANGE); 1566 NETDEV_POST_TYPE_CHANGE);
@@ -4330,7 +4332,7 @@ static void bond_setup(struct net_device *bond_dev)
4330 bond_dev->tx_queue_len = 0; 4332 bond_dev->tx_queue_len = 0;
4331 bond_dev->flags |= IFF_MASTER|IFF_MULTICAST; 4333 bond_dev->flags |= IFF_MASTER|IFF_MULTICAST;
4332 bond_dev->priv_flags |= IFF_BONDING; 4334 bond_dev->priv_flags |= IFF_BONDING;
4333 bond_dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; 4335 bond_dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
4334 4336
4335 /* At first, we block adding VLANs. That's the only way to 4337 /* At first, we block adding VLANs. That's the only way to
4336 * prevent problems that occur when adding VLANs over an 4338 * prevent problems that occur when adding VLANs over an
diff --git a/drivers/net/ifb.c b/drivers/net/ifb.c
index 6e82dd32e806..46b5f5fd686b 100644
--- a/drivers/net/ifb.c
+++ b/drivers/net/ifb.c
@@ -183,7 +183,7 @@ static void ifb_setup(struct net_device *dev)
183 183
184 dev->flags |= IFF_NOARP; 184 dev->flags |= IFF_NOARP;
185 dev->flags &= ~IFF_MULTICAST; 185 dev->flags &= ~IFF_MULTICAST;
186 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; 186 dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
187 random_ether_addr(dev->dev_addr); 187 random_ether_addr(dev->dev_addr);
188} 188}
189 189
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index ba631fcece34..05172c39a0ce 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -572,7 +572,7 @@ void macvlan_common_setup(struct net_device *dev)
572{ 572{
573 ether_setup(dev); 573 ether_setup(dev);
574 574
575 dev->priv_flags &= ~IFF_XMIT_DST_RELEASE; 575 dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_TX_SKB_SHARING);
576 dev->netdev_ops = &macvlan_netdev_ops; 576 dev->netdev_ops = &macvlan_netdev_ops;
577 dev->destructor = free_netdev; 577 dev->destructor = free_netdev;
578 dev->header_ops = &macvlan_hard_header_ops, 578 dev->header_ops = &macvlan_hard_header_ops,
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 9a6b3824da14..71f3d1a35b74 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -528,6 +528,7 @@ static void tun_net_init(struct net_device *dev)
528 dev->netdev_ops = &tap_netdev_ops; 528 dev->netdev_ops = &tap_netdev_ops;
529 /* Ethernet TAP Device */ 529 /* Ethernet TAP Device */
530 ether_setup(dev); 530 ether_setup(dev);
531 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
531 532
532 random_ether_addr(dev->dev_addr); 533 random_ether_addr(dev->dev_addr);
533 534
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 7f78db7bd68d..5b23767ea817 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -263,6 +263,8 @@ static void veth_setup(struct net_device *dev)
263{ 263{
264 ether_setup(dev); 264 ether_setup(dev);
265 265
266 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
267
266 dev->netdev_ops = &veth_netdev_ops; 268 dev->netdev_ops = &veth_netdev_ops;
267 dev->ethtool_ops = &veth_ethtool_ops; 269 dev->ethtool_ops = &veth_ethtool_ops;
268 dev->features |= NETIF_F_LLTX; 270 dev->features |= NETIF_F_LLTX;
diff --git a/drivers/net/wan/hdlc_fr.c b/drivers/net/wan/hdlc_fr.c
index b25c9229a6a9..eb2028187fbe 100644
--- a/drivers/net/wan/hdlc_fr.c
+++ b/drivers/net/wan/hdlc_fr.c
@@ -1074,9 +1074,10 @@ static int fr_add_pvc(struct net_device *frad, unsigned int dlci, int type)
1074 1074
1075 used = pvc_is_used(pvc); 1075 used = pvc_is_used(pvc);
1076 1076
1077 if (type == ARPHRD_ETHER) 1077 if (type == ARPHRD_ETHER) {
1078 dev = alloc_netdev(0, "pvceth%d", ether_setup); 1078 dev = alloc_netdev(0, "pvceth%d", ether_setup);
1079 else 1079 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
1080 } else
1080 dev = alloc_netdev(0, "pvc%d", pvc_setup); 1081 dev = alloc_netdev(0, "pvc%d", pvc_setup);
1081 1082
1082 if (!dev) { 1083 if (!dev) {
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 55cf71fbffe3..e1b3e3c134fd 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -2823,6 +2823,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
2823 dev->wireless_data = &ai->wireless_data; 2823 dev->wireless_data = &ai->wireless_data;
2824 dev->irq = irq; 2824 dev->irq = irq;
2825 dev->base_addr = port; 2825 dev->base_addr = port;
2826 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
2826 2827
2827 SET_NETDEV_DEV(dev, dmdev); 2828 SET_NETDEV_DEV(dev, dmdev);
2828 2829
diff --git a/drivers/net/wireless/hostap/hostap_main.c b/drivers/net/wireless/hostap/hostap_main.c
index d5084829c9e5..89a116fba1de 100644
--- a/drivers/net/wireless/hostap/hostap_main.c
+++ b/drivers/net/wireless/hostap/hostap_main.c
@@ -855,6 +855,7 @@ void hostap_setup_dev(struct net_device *dev, local_info_t *local,
855 855
856 iface = netdev_priv(dev); 856 iface = netdev_priv(dev);
857 ether_setup(dev); 857 ether_setup(dev);
858 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
858 859
859 /* kernel callbacks */ 860 /* kernel callbacks */
860 if (iface) { 861 if (iface) {
diff --git a/drivers/staging/ath6kl/os/linux/ar6000_drv.c b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
index 48dd9e363596..8ff52899ddee 100644
--- a/drivers/staging/ath6kl/os/linux/ar6000_drv.c
+++ b/drivers/staging/ath6kl/os/linux/ar6000_drv.c
@@ -6179,6 +6179,7 @@ int ar6000_create_ap_interface(struct ar6_softc *ar, char *ap_ifname)
6179 6179
6180 ether_setup(dev); 6180 ether_setup(dev);
6181 init_netdev(dev, ap_ifname); 6181 init_netdev(dev, ap_ifname);
6182 dev->priv_flags &= ~IFF_TX_SKB_SHARING;
6182 6183
6183 if (register_netdev(dev)) { 6184 if (register_netdev(dev)) {
6184 AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_create_ap_interface: register_netdev failed\n")); 6185 AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("ar6000_create_ap_interface: register_netdev failed\n"));