17 Dec, 2010

1 commit


13 Nov, 2010

1 commit

  • For device that supports VIRTIO_NET_F_STATUS, there's no need to
    assume the link is up and we need to call nerif_carrier_off() before
    querying device status, otherwise we may get wrong operstate after
    diver was loaded because the link watch event was not fired as
    expected.

    For device that does not support VIRITO_NET_F_STATUS, we could not get
    its status through virtnet_update_status() and what we can only do is
    always assuming the link is up.

    Acked-by: Michael S. Tsirkin
    Signed-off-by: Jason Wang
    Signed-off-by: Rusty Russell
    Signed-off-by: David S. Miller

    Jason Wang
     

17 Aug, 2010

1 commit

  • The driver name and bus address for a net_device can normally be found
    through the driver model now. Instead of requiring drivers to provide
    this information redundantly through the ethtool_ops::get_drvinfo
    operation, use the driver model to do so if the driver does not define
    the operation. Since ETHTOOL_GDRVINFO no longer requires the driver
    to implement any operations, do not require net_device::ethtool_ops to
    be set either.

    Remove implementations of get_drvinfo and ethtool_ops that provide
    only this information.

    Signed-off-by: Ben Hutchings
    Signed-off-by: David S. Miller

    Ben Hutchings
     

05 Aug, 2010

1 commit

  • I often use "ethtool -i" command to check what driver controls the
    ehternet device. But because current virtio_net driver doesn't
    support "ethtool -i", it becomes the following:

    # ethtool -i eth3
    Cannot get driver information: Operation not supported

    This patch simply adds the "ethtool -i" support. The following is the
    result when using the virtio_net driver with my patch applied to.

    # ethtool -i eth3
    driver: virtio_net
    version: N/A
    firmware-version: N/A
    bus-info: virtio0

    Personally, "-i" is one of the most frequently-used option, and most
    network drivers support "ethtool -i", so I think virtio_net also
    should do.

    Signed-off-by: Taku Izumi
    Signed-off-by: Rusty Russell (use ARRAY_SIZE)
    Signed-off-by: David S. Miller

    Rusty Russell
     

03 Jul, 2010

2 commits

  • virtio net will never try to overflow the TX ring, so the only reason
    add_buf may fail is out of memory. Thus, we can not stop the
    device until some request completes - there's no guarantee anything
    at all is outstanding.

    Make the error message clearer as well: error here does not
    indicate queue full.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell (...and avoid TX_BUSY)
    Cc: stable@kernel.org # .34.x (s/virtqueue_/vi->svq->vq_ops->/)
    Signed-off-by: David S. Miller

    Rusty Russell
     
  • We currently fill all of RX ring, then add_buf
    returns ENOSPC, which gets mis-detected as an out of
    memory condition and causes us to reschedule the work,
    and so on forever. Fix this by oom = err == -ENOMEM;

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell
    Cc: stable@kernel.org # .34.x
    Signed-off-by: David S. Miller

    Michael S. Tsirkin
     

01 Jun, 2010

1 commit

  • virtio-net bounces buffer allocations off to
    a thread if it can't allocate buffers from the atomic
    pool. However, if posting buffers still requires atomic
    buffers, this is unlikely to succeed.
    Fix by passing in the proper gfp_t parameter.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell
    Signed-off-by: David S. Miller

    Michael S. Tsirkin
     

22 May, 2010

1 commit

  • * 'virtio' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux-2.6-for-linus: (27 commits)
    drivers/char: Eliminate use after free
    virtio: console: Accept console size along with resize control message
    virtio: console: Store each console's size in the console structure
    virtio: console: Resize console port 0 on config intr only if multiport is off
    virtio: console: Add support for nonblocking write()s
    virtio: console: Rename wait_is_over() to will_read_block()
    virtio: console: Don't always create a port 0 if using multiport
    virtio: console: Use a control message to add ports
    virtio: console: Move code around for future patches
    virtio: console: Remove config work handler
    virtio: console: Don't call hvc_remove() on unplugging console ports
    virtio: console: Return -EPIPE to hvc_console if we lost the connection
    virtio: console: Let host know of port or device add failures
    virtio: console: Add a __send_control_msg() that can send messages without a valid port
    virtio: Revert "virtio: disable multiport console support."
    virtio: add_buf_gfp
    trans_virtio: use virtqueue_xxx wrappers
    virtio-rng: use virtqueue_xxx wrappers
    virtio_ring: remove a level of indirection
    virtio_net: use virtqueue_xxx wrappers
    ...

    Fix up conflicts in drivers/net/virtio_net.c due to new virtqueue_xxx
    wrappers changes conflicting with some other cleanups.

    Linus Torvalds
     

19 May, 2010

1 commit


14 Apr, 2010

2 commits


13 Apr, 2010

1 commit


12 Apr, 2010

1 commit


08 Apr, 2010

1 commit

  • Move sg structure off stack and into virtnet_info structure.
    This helps remove extra sg_init_table calls as well as reduce
    stack usage.

    Signed-off-by: Michael S. Tsirkin
    Tested-by: Michael S. Tsirkin
    Signed-off-by: David S. Miller

    Michael S. Tsirkin
     

04 Apr, 2010

1 commit

  • Converts the list and the core manipulating with it to be the same as uc_list.

    +uses two functions for adding/removing mc address (normal and "global"
    variant) instead of a function parameter.
    +removes dev_mcast.c completely.
    +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
    manipulation with lists on a sandbox (used in bonding and 80211 drivers)

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

31 Mar, 2010

1 commit


30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

02 Mar, 2010

1 commit


26 Feb, 2010

1 commit


13 Feb, 2010

2 commits

  • Now we have a virtio detach API (in commit
    f9bfbebf34eab707b065116cdc9699d25ba4252a), we don't need to track xmit
    skbs in the virio_net driver, which improves transmission performance.

    Signed-off-by: Shirley Ma
    Acked-by: Rusty Russell
    Acked-by: Michael S. Tsirkin
    Signed-off-by: David S. Miller

    Shirley Ma
     
  • This patch replaces dev->mc_count in all drivers (hopefully I didn't miss
    anything). Used spatch and did small tweaks and conding style changes when
    it was suitable.

    Jirka

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

03 Feb, 2010

1 commit

  • virtio_net receives packets from its pre-allocated vring buffers, then it
    delivers these packets to upper layer protocols as skb buffs. So it's not
    necessary to pre-allocate skb for each mergable buffer, then frees extra
    skbs when buffers are merged into a large packet. This patch has deferred
    skb allocation in receiving packets for both big packets and mergeable buffers
    to reduce skb pre-allocations and skb frees. It frees unused buffers by calling
    detach_unused_buf in vring, so recv skb queue is not needed.

    Signed-off-by: Shirley Ma
    Signed-off-by: Rusty Russell
    Signed-off-by: David S. Miller

    Shirley Ma
     

28 Jan, 2010

1 commit


26 Jan, 2010

2 commits

  • 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: Herbert Xu
    Acked-by: Rusty Russell
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This patch introduces three macros to work with uc list from net drivers.

    Signed-off-by: Jiri Pirko
    Signed-off-by: David S. Miller

    Jiri Pirko
     

04 Dec, 2009

1 commit

  • Only files where David Miller is the primary git-signer.
    wireless, wimax, ixgbe, etc are not modified.

    Compile tested x86 allyesconfig only
    Not all files compiled (not x86 compatible)

    Added a few > 80 column lines, which I ignored.
    Existing checkpatch complaints ignored.

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches
     

19 Nov, 2009

1 commit


10 Nov, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (34 commits)
    net/fsl_pq_mdio: add module license GPL
    can: fix WARN_ON dump in net/core/rtnetlink.c:rtmsg_ifinfo()
    can: should not use __dev_get_by_index() without locks
    hisax: remove bad udelay call to fix build error on ARM
    ipip: Fix handling of DF packets when pmtudisc is OFF
    qlge: Set PCIe reset type for EEH to fundamental.
    qlge: Fix early exit from mbox cmd complete wait.
    ixgbe: fix traffic hangs on Tx with ioatdma loaded
    ixgbe: Fix checking TFCS register for TXOFF status when DCB is enabled
    ixgbe: Fix gso_max_size for 82599 when DCB is enabled
    macsonic: fix crash on PowerBook 520
    NET: cassini, fix lock imbalance
    ems_usb: Fix byte order issues on big endian machines
    be2net: Bug fix to send config commands to hardware after netdev_register
    be2net: fix to set proper flow control on resume
    netfilter: xt_connlimit: fix regression caused by zero family value
    rt2x00: Don't queue ieee80211 work after USB removal
    Revert "ipw2200: fix oops on missing firmware"
    decnet: netdevice refcount leak
    netfilter: nf_nat: fix NAT issue in 2.6.30.4+
    ...

    Linus Torvalds
     

06 Nov, 2009

1 commit


05 Nov, 2009

1 commit

  • Commit

    3d1285b (move virtnet_remove to .devexit.text)

    introduced the first reference to __devexit in struct virtio_driver
    virtio_net which upset modpost ("Section mismatch in reference from the
    variable virtio_net to the function .devexit.text:virtnet_remove()").

    Fix this by renaming virtio_net to virtio_net_driver.

    Signed-off-by: Uwe Kleine-König
    Reported-by: Michael S. Tsirkin
    Blame-taken-by: Rusty Russell
    Signed-off-by: David S. Miller

    Uwe Kleine-König
     

30 Oct, 2009

2 commits

  • David S. Miller
     
  • * 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
    ...

    Linus Torvalds
     

28 Oct, 2009

1 commit

  • virtio net used to unlink skbs from send queues on error,
    but ever since 48925e372f04f5e35fec6269127c62b2c71ab794
    we do not do this. This causes guest data corruption and crashes
    with vhost since net core can requeue the skb or free it without
    it being taken off the list.

    This patch fixes this by queueing the skb after successful
    transmit.

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell
    Signed-off-by: David S. Miller

    Michael S. Tsirkin
     

27 Oct, 2009

1 commit


23 Oct, 2009

1 commit


22 Oct, 2009

1 commit

  • Rusty,

    commit 3ca4f5ca73057a617f9444a91022d7127041970a
    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 " 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
    Signed-off-by: Christian Borntraeger
    Signed-off-by: Rusty Russell

    Christian Borntraeger
     

15 Oct, 2009

1 commit

  • 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] [] ? \
    skb_release_head_state+0x64/0xc8
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? skb_release_head_state+0x64/0xc8
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? warn_slowpath_common+0x77/0xa3
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? skb_release_head_state+0x64/0xc8
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? __kfree_skb+0x9/0x7d
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? free_old_xmit_skbs+0x51/0x6e \
    [virtio_net]
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? start_xmit+0x26/0xf2 [virtio_net]
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? netpoll_send_skb+0xd2/0x205
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? write_msg+0x90/0xeb [netconsole]
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? __call_console_drivers+0x5e/0x6f
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? kvm_clock_read+0x4d/0x52
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? release_console_sem+0x115/0x1ba
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? vprintk+0x2f2/0x34b
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? vx_update_load+0x18/0x13e
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? printk+0x4e/0x5d
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? kvm_clock_read+0x4d/0x52
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? getnstimeofday+0x55/0xaf
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? ktime_get_ts+0x21/0x49
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? ktime_get+0xc/0x41
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? hrtimer_interrupt+0x9c/0x146
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? smp_apic_timer_interrupt+0x80/0x93
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? apic_timer_interrupt+0x13/0x20
    Oct 8 11:16:52 172.30.1.31 [113074.791813] [] ? _spin_unlock_irq+0xd/0x31

    Reported-and-tested-by: Massimo Cetra
    Signed-off-by: Eric Dumazet
    Bug-Entry: http://bugzilla.kernel.org/show_bug.cgi?id=14378
    Signed-off-by: David S. Miller

    Eric Dumazet
     

14 Oct, 2009

1 commit


02 Oct, 2009

1 commit

  • The function virtnet_remove is used only wrapped by __devexit_p so define
    it using __devexit.

    Signed-off-by: Uwe Kleine-König
    Acked-by: Sam Ravnborg
    Cc: David S. Miller
    Cc: Rusty Russell
    Cc: Alex Williamson
    Cc: Mark McLoughlin
    Cc: netdev@vger.kernel.org
    Cc: linux-kernel@vger.kernel.org
    Signed-off-by: David S. Miller

    Uwe Kleine-König
     

24 Sep, 2009

1 commit