1. 13 2月, 2010 2 次提交
  2. 03 2月, 2010 1 次提交
  3. 26 1月, 2010 2 次提交
    • H
      virtio_net: Make delayed refill more reliable · 39d32157
      Herbert Xu 提交于
      I have seen RX stalls on a machine that experienced a suspected
      OOM.  After the stall, the RX buffer is empty on the guest side
      and there are exactly 16 entries available on the host side.  As
      the number of entries is less than that required by a maximal
      skb, the host cannot proceed.
      
      The guest did not have a refill job scheduled.
      
      My diagnosis is that an OOM had occured, with the delayed refill
      job scheduled.  The job was able to allocate at least one skb, but
      not enough to overcome the minimum required by the host to proceed.
      
      As the refill job would only reschedule itself if it failed completely
      to allocate any skbs, this would lead to an RX stall.
      
      The following patch removes this stall possibility by always
      rescheduling the refill job until the ring is totally refilled.
      
      Testing has shown that the RX stall no longer occurs whereas
      previously it would occur within a day.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Acked-by: NRusty Russell <rusty@rustcorp.com.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      39d32157
    • J
      net: use helpers to access uc list V2 · 32e7bfc4
      Jiri Pirko 提交于
      This patch introduces three macros to work with uc list from net drivers.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      32e7bfc4
  4. 04 12月, 2009 1 次提交
  5. 05 11月, 2009 1 次提交
  6. 28 10月, 2009 1 次提交
  7. 22 10月, 2009 1 次提交
    • C
      virtio: let header files include virtio_ids.h · e95646c3
      Christian Borntraeger 提交于
      Rusty,
      
      commit 3ca4f5ca
          virtio: add virtio IDs file
      moved all device IDs into a single file. While the change itself is
      a very good one, it can break userspace applications. For example
      if a userspace tool wanted to get the ID of virtio_net it used to
      include virtio_net.h. This does no longer work, since virtio_net.h
      does not include virtio_ids.h.
      This patch moves all "#include <linux/virtio_ids.h>" from the C
      files into the header files, making the header files compatible with
      the old ones.
      
      In addition, this patch exports virtio_ids.h to userspace.
      
      CC: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      e95646c3
  8. 15 10月, 2009 1 次提交
    • E
      virtio_net: use dev_kfree_skb_any() in free_old_xmit_skbs() · ed79bab8
      Eric Dumazet 提交于
      Because netpoll can call netdevice start_xmit() method with
      irqs disabled, drivers should not call kfree_skb() from
      their start_xmit(), but use dev_kfree_skb_any() instead.
      
      Oct  8 11:16:52 172.30.1.31 [113074.791813] ------------[ cut here ]------------
      Oct  8 11:16:52 172.30.1.31 [113074.791813] WARNING: at net/core/skbuff.c:398 \
                      skb_release_head_state+0x64/0xc8()
      Oct  8 11:16:52 172.30.1.31 [113074.791813] Hardware name:
      Oct  8 11:16:52 172.30.1.31 [113074.791813] Modules linked in: netconsole ocfs2 jbd2 quota_tree \
      ocfs2_dlmfs ocfs2_stack_o2cb ocfs2_dlm ocfs2_nodemanager ocfs2_stackglue configfs crc32c drbd cn loop \
      serio_raw psmouse snd_pcm snd_timer snd soundcore snd_page_alloc virtio_net pcspkr parport_pc parport \
      i2c_piix4 i2c_core button processor evdev ext3 jbd mbcache dm_mirror dm_region_hash dm_log dm_snapshot \
      dm_mod ide_cd_mod cdrom ata_generic ata_piix virtio_blk libata scsi_mod piix ide_pci_generic ide_core \
                      virtio_pci virtio_ring virtio floppy thermal fan thermal_sys [last unloaded: netconsole]
      Oct  8 11:16:52 172.30.1.31 [113074.791813] Pid: 11132, comm: php5-cgi Tainted: G        W  \
                      2.6.31.2-vserver #1
      Oct  8 11:16:52 172.30.1.31 [113074.791813] Call Trace:
      Oct  8 11:16:52 172.30.1.31 [113074.791813] <IRQ>  [<ffffffff81253cd5>] ? \
                      skb_release_head_state+0x64/0xc8
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81253cd5>] ? skb_release_head_state+0x64/0xc8
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81049ae1>] ? warn_slowpath_common+0x77/0xa3
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81253cd5>] ? skb_release_head_state+0x64/0xc8
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81253a1a>] ? __kfree_skb+0x9/0x7d
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffffa01cb139>] ? free_old_xmit_skbs+0x51/0x6e \
                      [virtio_net]
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffffa01cbc85>] ? start_xmit+0x26/0xf2 [virtio_net]
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8126934f>] ? netpoll_send_skb+0xd2/0x205
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffffa0429216>] ? write_msg+0x90/0xeb [netconsole]
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81049f06>] ? __call_console_drivers+0x5e/0x6f
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8102b49d>] ? kvm_clock_read+0x4d/0x52
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8104a082>] ? release_console_sem+0x115/0x1ba
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8104a632>] ? vprintk+0x2f2/0x34b
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8106b142>] ? vx_update_load+0x18/0x13e
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81308309>] ? printk+0x4e/0x5d
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff8102b49d>] ? kvm_clock_read+0x4d/0x52
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81070b62>] ? getnstimeofday+0x55/0xaf
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81062683>] ? ktime_get_ts+0x21/0x49
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff810626b7>] ? ktime_get+0xc/0x41
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81062788>] ? hrtimer_interrupt+0x9c/0x146
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81024a4b>] ? smp_apic_timer_interrupt+0x80/0x93
      Oct  8 11:16:52 172.30.1.31 [113074.791813] [<ffffffff81011663>] ? apic_timer_interrupt+0x13/0x20
      Oct  8 11:16:52 172.30.1.31 [113074.791813] <EOI>  [<ffffffff8130a9eb>] ? _spin_unlock_irq+0xd/0x31
      Reported-and-tested-by: NMassimo Cetra <mcetra@navynet.it>
      Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
      Bug-Entry: http://bugzilla.kernel.org/show_bug.cgi?id=14378Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ed79bab8
  9. 14 10月, 2009 1 次提交
  10. 02 10月, 2009 1 次提交
  11. 24 9月, 2009 6 次提交
    • A
      virtio_net: Check for room in the vq before adding buffer · 0aea51c3
      Amit Shah 提交于
      Saves us one cycle of alloc-add-free if the queue was full.
      Signed-off-by: NAmit Shah <amit.shah@redhat.com>
      Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (modified)
      0aea51c3
    • R
      virtio_net: avoid (most) NETDEV_TX_BUSY by stopping queue early. · 48925e37
      Rusty Russell 提交于
      Now we can tell the theoretical capacity remaining in the output
      queue, virtio_net can waste entries by stopping the queue early.
      
      It doesn't work in the case of indirect buffers and kmalloc failure,
      but that's rare (we could drop the packet in that case, but other
      drivers return TX_BUSY for similar reasons).
      
      For the record, I think this patch reflects poorly on the linux
      network API.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Dinesh Subhraveti <dineshs@us.ibm.com>
      48925e37
    • R
      virtio_net: formalize skb_vnet_hdr · b3f24698
      Rusty Russell 提交于
      We put the virtio_net_hdr into the skb's cb region; turn this into a
      union to clean up the code slightly and allow future expansion.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Mark McLoughlin <markmc@redhat.com>
      Cc: Dinesh Subhraveti <dineshs@us.ibm.com>
      b3f24698
    • R
      virtio_net: don't free buffers in xmit ring · b0c39dbd
      Rusty Russell 提交于
      The virtio_net driver is complicated by the two methods of freeing old
      xmit buffers (in addition to freeing old ones at the start of the xmit
      path).
      
      The original code used a 1/10 second timer attached to xmit_free(),
      reset on every xmit.  Before we orphaned skbs on xmit, the
      transmitting userspace could block with a full socket until the timer
      fired, the skb destructor was called, and they were re-woken.
      
      So we added the VIRTIO_F_NOTIFY_ON_EMPTY feature: supporting devices
      send an interrupt (even if normally suppressed) on an empty xmit ring
      which makes us schedule xmit_tasklet().  This was a benchmark win.
      
      Unfortunately, VIRTIO_F_NOTIFY_ON_EMPTY makes quite a lot of work: a
      host which is faster than the guest will fire the interrupt every xmit
      packet (slowing the guest down further).  Attempting mitigation in the
      host adds overhead of userspace timers (possibly with the additional
      pain of signals), and risks increasing latency anyway if you get it
      wrong.
      
      In practice, this effect was masked by benchmarks which take advantage
      of GSO (with its inherent transmit batching), but it's still there.
      
      Now we orphan xmitted skbs, the pressure is off: remove both paths and
      no longer request VIRTIO_F_NOTIFY_ON_EMPTY.  Note that the current
      QEMU will notify us even if we don't negotiate this feature (legal,
      but suboptimal); a patch is outstanding to improve that.
      
      Move the skb_orphan/nf_reset to after we've done the send and notified
      the other end, for a slight optimization.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Mark McLoughlin <markmc@redhat.com>
      b0c39dbd
    • R
      virtio_net: return NETDEV_TX_BUSY instead of queueing an extra skb. · 8958f574
      Rusty Russell 提交于
      This effectively reverts 99ffc696
      "virtio: wean net driver off NETDEV_TX_BUSY".
      
      The complexity of queuing an skb (setting a tasklet to re-xmit) is
      questionable, especially once we get rid of the other reason for the
      tasklet in the next patch.
      
      If the skb won't fit in the tx queue, just return NETDEV_TX_BUSY.
      This is frowned upon, so a followup patch uses a more complex solution.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      8958f574
    • R
      virtio_net: skb_orphan() and nf_reset() in xmit path. · 2b5bbe3b
      Rusty Russell 提交于
      The complex transmit free logic was introduced to avoid hangs on
      removing the ip_conntrack module and also because drivers aren't
      generally supposed to keep stale skbs for unbounded times.
      
      After some debate, it was decided that while doing skb_orphan()
      generally is a rat's nest, we can do it in this driver.  Following
      patches take advantage of this.
      Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
      2b5bbe3b
  12. 23 9月, 2009 2 次提交
  13. 02 9月, 2009 1 次提交
  14. 01 9月, 2009 1 次提交
  15. 27 8月, 2009 1 次提交
  16. 18 7月, 2009 1 次提交
  17. 18 6月, 2009 1 次提交
    • J
      net: group address list and its count · 31278e71
      Jiri Pirko 提交于
      This patch is inspired by patch recently posted by Johannes Berg. Basically what
      my patch does is to group list and a count of addresses into newly introduced
      structure netdev_hw_addr_list. This brings us two benefits:
      1) struct net_device becames a bit nicer.
      2) in the future there will be a possibility to operate with lists independently
         on netdevices (with exporting right functions).
      I wanted to introduce this patch before I'll post a multicast lists conversion.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      
       drivers/net/bnx2.c              |    4 +-
       drivers/net/e1000/e1000_main.c  |    4 +-
       drivers/net/ixgbe/ixgbe_main.c  |    6 +-
       drivers/net/mv643xx_eth.c       |    2 +-
       drivers/net/niu.c               |    4 +-
       drivers/net/virtio_net.c        |   10 ++--
       drivers/s390/net/qeth_l2_main.c |    2 +-
       include/linux/netdevice.h       |   17 +++--
       net/core/dev.c                  |  130 ++++++++++++++++++--------------------
       9 files changed, 89 insertions(+), 90 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      31278e71
  18. 12 6月, 2009 3 次提交
  19. 08 6月, 2009 1 次提交
  20. 30 5月, 2009 1 次提交
    • J
      net: convert unicast addr list · ccffad25
      Jiri Pirko 提交于
      This patch converts unicast address list to standard list_head using
      previously introduced struct netdev_hw_addr. It also relaxes the
      locking. Original spinlock (still used for multicast addresses) is not
      needed and is no longer used for a protection of this list. All
      reading and writing takes place under rtnl (with no changes).
      
      I also removed a possibility to specify the length of the address
      while adding or deleting unicast address. It's always dev->addr_len.
      
      The convertion touched especially e1000 and ixgbe codes when the
      change is not so trivial.
      Signed-off-by: NJiri Pirko <jpirko@redhat.com>
      
       drivers/net/bnx2.c               |   13 +--
       drivers/net/e1000/e1000_main.c   |   24 +++--
       drivers/net/ixgbe/ixgbe_common.c |   14 ++--
       drivers/net/ixgbe/ixgbe_common.h |    4 +-
       drivers/net/ixgbe/ixgbe_main.c   |    6 +-
       drivers/net/ixgbe/ixgbe_type.h   |    4 +-
       drivers/net/macvlan.c            |   11 +-
       drivers/net/mv643xx_eth.c        |   11 +-
       drivers/net/niu.c                |    7 +-
       drivers/net/virtio_net.c         |    7 +-
       drivers/s390/net/qeth_l2_main.c  |    6 +-
       drivers/scsi/fcoe/fcoe.c         |   16 ++--
       include/linux/netdevice.h        |   18 ++--
       net/8021q/vlan.c                 |    4 +-
       net/8021q/vlan_dev.c             |   10 +-
       net/core/dev.c                   |  195 +++++++++++++++++++++++++++-----------
       net/dsa/slave.c                  |   10 +-
       net/packet/af_packet.c           |    4 +-
       18 files changed, 227 insertions(+), 137 deletions(-)
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ccffad25
  21. 02 5月, 2009 2 次提交
  22. 14 4月, 2009 1 次提交
  23. 05 4月, 2009 1 次提交
  24. 19 3月, 2009 1 次提交
  25. 05 2月, 2009 5 次提交