12 Jan, 2012

4 commits


06 Jan, 2012

1 commit

  • Currently, the refill path for RX buffers will always allocate the
    buffers as GFP_ATOMIC, even if we are in process context. This will
    fail to apply memory pressure as the worker thread will not contribute
    to the freeing of memory.

    Fix this by changing add_recvbuf_small to use the gfp variant allocator,
    __netdev_alloc_skb_ip_align().

    Signed-off-by: Mike Waychison
    Acked-by: Rusty Russell
    Signed-off-by: David S. Miller

    Mike Waychison
     

30 Dec, 2011

2 commits

  • Michael S. Tsirkin also noticed that we could run the refill work
    multiple CPUs: if we kick off a refill on one CPU and then on another,
    they would both manipulate the queue at the same time (they use
    napi_disable to avoid racing against the receive handler itself).

    Tejun points out that this is what the WQ_NON_REENTRANT flag is for,
    and that there is a convenient system kthread we can use.

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

    Rusty Russell
     
  • Michael S. Tsirkin noticed that we could run the refill work after
    ndo_close, which can re-enable napi - we don't disable it until
    virtnet_remove. This is clearly wrong, so move the workqueue control
    to ndo_open and ndo_stop (aka. virtnet_open and virtnet_close).

    One subtle point: virtnet_probe() could simply fail if it couldn't
    allocate a receive buffer, but that's less polite in virtnet_open() so
    we schedule a refill as we do in the normal receive path if we run out
    of memory.

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

    Rusty Russell
     

20 Dec, 2011

1 commit

  • module_param(bool) used to counter-intuitively take an int. In
    fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
    trick.

    It's time to remove the int/unsigned int option. For this version
    it'll simply give a warning, but it'll break next kernel version.

    (Thanks to Joe Perches for suggesting coccinelle for 0/1 -> true/false).

    Cc: "David S. Miller"
    Cc: netdev@vger.kernel.org
    Signed-off-by: Rusty Russell
    Signed-off-by: David S. Miller

    Rusty Russell
     

09 Dec, 2011

1 commit


27 Nov, 2011

1 commit


17 Nov, 2011

1 commit


02 Nov, 2011

1 commit

  • This patch modifies virtio-net to use virtio_config_val() instead
    of a 'if(virtio_has_feature()) vdev->config->get()' construct to retrieve
    optional values from the config space.

    Cc: Amit Shah
    Cc: "Michael S. Tsirkin"
    Cc: Rusty Russell
    Cc: virtualization@lists.linux-foundation.org
    Signed-off-by: Sasha Levin
    Signed-off-by: Rusty Russell

    Sasha Levin
     

24 Oct, 2011

1 commit


21 Oct, 2011

1 commit

  • We must account in skb->truesize, the size of the fragments, not the
    used part of them.

    Doing this work is important to avoid unexpected OOM situations.

    Signed-off-by: Eric Dumazet
    CC: Rusty Russell
    CC: "Michael S. Tsirkin"
    CC: virtualization@lists.linux-foundation.org
    CC: Krishna Kumar
    Signed-off-by: David S. Miller

    Eric Dumazet
     

20 Oct, 2011

1 commit


19 Oct, 2011

1 commit

  • To ease skb->truesize sanitization, its better to be able to localize
    all references to skb frags size.

    Define accessors : skb_frag_size() to fetch frag size, and
    skb_frag_size_{set|add|sub}() to manipulate it.

    Signed-off-by: Eric Dumazet
    Signed-off-by: David S. Miller

    Eric Dumazet
     

07 Oct, 2011

1 commit

  • This patch verifies that the length of a buffer stored in a linked list
    of pages is small enough to fit into a skb.

    If the size is larger than a max size of a skb, it means that we shouldn't
    go ahead building skbs anyway since we won't be able to send the buffer as
    the user requested.

    Cc: Rusty Russell
    Cc: "Michael S. Tsirkin"
    Cc: virtualization@lists.linux-foundation.org
    Cc: netdev@vger.kernel.org
    Cc: kvm@vger.kernel.org
    Signed-off-by: Sasha Levin
    Signed-off-by: David S. Miller

    Sasha Levin
     

23 Sep, 2011

1 commit


18 Aug, 2011

1 commit

  • Use IFF_UNICAST_FTL to find out if driver handles unicast address
    filtering. In case it does not, promisc mode is entered.

    Patch also fixes following drivers:
    stmmac, niu: support uc filtering and yet it propagated
    ndo_set_multicast_list
    bna, benet, pxa168_eth, ks8851, ks8851_mll, ksz884x : has set
    ndo_set_rx_mode but do not support uc filtering

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

    Jiri Pirko
     

22 Jul, 2011

1 commit

  • Fix a panic in virtnet_remove. unregister_netdev has already
    freed up the netdev (and virtnet_info) due to dev->destructor
    being set, while virtnet_info is still required. Remove
    virtnet_free altogether, and move the freeing of the per-cpu
    statistics from virtnet_free to virtnet_remove.

    Tested patch below.

    Signed-off-by: Krishna Kumar
    Acked-by: Michael S. Tsirkin
    Signed-off-by: David S. Miller

    Krishna Kumar
     

01 Jul, 2011

1 commit


12 Jun, 2011

1 commit

  • There's no need for the guest to validate the checksum if it have been
    validated by host nics. So this patch introduces a new flag -
    VIRTIO_NET_HDR_F_DATA_VALID which is used to bypass the checksum
    examing in guest. The backend (tap/macvtap) may set this flag when
    met skbs with CHECKSUM_UNNECESSARY to save cpu utilization.

    No feature negotiation is needed as old driver just ignore this flag.

    Iperf shows 12%-30% performance improvement for UDP traffic. For TCP,
    when gro is on no difference as it produces skb with partial
    checksum. But when gro is disabled, 20% or even higher improvement
    could be measured by netperf.

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

    Jason Wang
     

30 May, 2011

1 commit


02 Apr, 2011

1 commit


11 Feb, 2011

1 commit

  • Under harsh testing conditions, including low memory, the guest would
    stop receiving packets. With this patch applied we no longer see any
    problems in the driver while performing these tests for extended periods
    of time.

    Make sure napi is scheduled subsequent to each napi_enable.

    Signed-off-by: Bruce Rogers
    Signed-off-by: Olaf Kirch
    Cc: stable@kernel.org
    Signed-off-by: Rusty Russell
    Signed-off-by: David S. Miller

    Bruce Rogers
     

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