The following commit has been merged in the linux branch: commit 49b2de8e6febfea5a8791b6476195903af83a35d Merge: 8633322c5fd5b2a986b279f88a7559d8409f7da3 b5dd884e682cae6b8c037f9d11f3b623b4cf2011 Author: Linus Torvalds torvalds@linux-foundation.org Date: Thu Oct 29 09:22:08 2009 -0700
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (43 commits) net: Fix 'Re: PACKET_TX_RING: packet size is too long' netdev: usb: dm9601.c can drive a device not supported yet, add support for it qlge: Fix firmware mailbox command timeout. qlge: Fix EEH handling. AF_RAW: Augment raw_send_hdrinc to expand skb to fit iphdr->ihl (v2) bonding: fix a race condition in calls to slave MII ioctls virtio-net: fix data corruption with OOM sfc: Set ip_summed correctly for page buffers passed to GRO cnic: Fix L2CTX_STATUSB_NUM offset in context memory. MAINTAINERS: rt2x00 list is moderated airo: Reorder tests, check bounds before element mac80211: fix for incorrect sequence number on hostapd injected frames libertas spi: fix sparse errors mac80211: trivial: fix spelling in mesh_hwmp cfg80211: sme: deauthenticate on assoc failure mac80211: keep auth state when assoc fails mac80211: fix ibss joining b43: add 'struct b43_wl' missing declaration b43: Fix Bugzilla #14181 and the bug from the previous 'fix' rt2x00: Fix crypto in TX frame for rt2800usb ...
diff --combined drivers/net/igb/igb_ethtool.c index deaea8f,aab3d97..b243ed3 --- a/drivers/net/igb/igb_ethtool.c +++ b/drivers/net/igb/igb_ethtool.c @@@ -34,7 -34,6 +34,7 @@@ #include <linux/interrupt.h> #include <linux/if_ether.h> #include <linux/ethtool.h> +#include <linux/sched.h>
#include "igb.h"
@@@ -732,7 -731,7 +732,7 @@@ static int igb_set_ringparam(struct net { struct igb_adapter *adapter = netdev_priv(netdev); struct igb_ring *temp_ring; - int i, err; + int i, err = 0; u32 new_rx_count, new_tx_count;
if ((ring->rx_mini_pending) || (ring->rx_jumbo_pending)) @@@ -752,18 -751,30 +752,30 @@@ return 0; }
+ while (test_and_set_bit(__IGB_RESETTING, &adapter->state)) + msleep(1); + + if (!netif_running(adapter->netdev)) { + for (i = 0; i < adapter->num_tx_queues; i++) + adapter->tx_ring[i].count = new_tx_count; + for (i = 0; i < adapter->num_rx_queues; i++) + adapter->rx_ring[i].count = new_rx_count; + adapter->tx_ring_count = new_tx_count; + adapter->rx_ring_count = new_rx_count; + goto clear_reset; + } + if (adapter->num_tx_queues > adapter->num_rx_queues) temp_ring = vmalloc(adapter->num_tx_queues * sizeof(struct igb_ring)); else temp_ring = vmalloc(adapter->num_rx_queues * sizeof(struct igb_ring)); - if (!temp_ring) - return -ENOMEM;
- while (test_and_set_bit(__IGB_RESETTING, &adapter->state)) - msleep(1); + if (!temp_ring) { + err = -ENOMEM; + goto clear_reset; + }
- if (netif_running(adapter->netdev)) - igb_down(adapter); + igb_down(adapter);
/* * We can't just free everything and then setup again, @@@ -820,14 -831,11 +832,11 @@@
adapter->rx_ring_count = new_rx_count; } - - err = 0; err_setup: - if (netif_running(adapter->netdev)) - igb_up(adapter); - - clear_bit(__IGB_RESETTING, &adapter->state); + igb_up(adapter); vfree(temp_ring); + clear_reset: + clear_bit(__IGB_RESETTING, &adapter->state); return err; }
diff --combined drivers/net/virtio_net.c index 3709d6a,d9ebac8..05630f2 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c @@@ -22,6 -22,7 +22,6 @@@ #include <linux/ethtool.h> #include <linux/module.h> #include <linux/virtio.h> -#include <linux/virtio_ids.h> #include <linux/virtio_net.h> #include <linux/scatterlist.h> #include <linux/if_vlan.h> @@@ -516,8 -517,7 +516,7 @@@ again /* Free up any pending old buffers before queueing new ones. */ free_old_xmit_skbs(vi);
- /* Put new one in send queue and do transmit */ - __skb_queue_head(&vi->send, skb); + /* Try to transmit */ capacity = xmit_skb(vi, skb);
/* This can happen with OOM and indirect buffers. */ @@@ -531,8 -531,17 +530,17 @@@ } return NETDEV_TX_BUSY; } - vi->svq->vq_ops->kick(vi->svq); + + /* + * Put new one in send queue. You'd expect we'd need this before + * xmit_skb calls add_buf(), since the callback can be triggered + * immediately after that. But since the callback just triggers + * another call back here, normal network xmit locking prevents the + * race. + */ + __skb_queue_head(&vi->send, skb); + /* Don't wait up for transmitted skbs to be freed. */ skb_orphan(skb); nf_reset(skb); diff --combined net/packet/af_packet.c index d7ecca0,48b18da..f2d116a --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@@ -982,10 -982,7 +982,7 @@@ static int tpacket_snd(struct packet_so goto out_put;
size_max = po->tx_ring.frame_size - - sizeof(struct skb_shared_info) - - po->tp_hdrlen - - LL_ALLOCATED_SPACE(dev) - - sizeof(struct sockaddr_ll); + - (po->tp_hdrlen - sizeof(struct sockaddr_ll));
if (size_max > dev->mtu + reserve) size_max = dev->mtu + reserve; @@@ -2084,7 -2081,7 +2081,7 @@@ static void packet_mm_close(struct vm_a atomic_dec(&pkt_sk(sk)->mapped); }
-static struct vm_operations_struct packet_mmap_ops = { +static const struct vm_operations_struct packet_mmap_ops = { .open = packet_mm_open, .close = packet_mm_close, };