12 Jan, 2012
4 commits
-
Remove all the vqs, disable napi and detach from the netdev on
hibernation.Re-create vqs after restoring from a hibernated image, re-enable napi
and re-attach the netdev. This keeps networking working across
hibernation.Signed-off-by: Amit Shah
Signed-off-by: Rusty Russell -
The remove and PM freeze functions will share this code.
Signed-off-by: Amit Shah
Signed-off-by: Rusty Russell -
The probe and PM restore functions will share this code.
Signed-off-by: Amit Shah
Signed-off-by: Rusty Russell -
Remove wrapper functions. This makes the allocation type explicit in
all callers; I used GPF_KERNEL where it seemed obvious, left it at
GFP_ATOMIC otherwise.Signed-off-by: Rusty Russell
Reviewed-by: Christoph Hellwig
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
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 -
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
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
09 Dec, 2011
1 commit
-
Let caller know the result of adding/removing vlan id to/from vlan
filter.In some drivers I make those functions to just return 0. But in those
where there is able to see if hw setup went correctly, return value is
set appropriately.Signed-off-by: Jiri Pirko
Signed-off-by: David S. Miller
27 Nov, 2011
1 commit
-
Tx_fifo_errors are tracked in start_xmit_ for virtio_net, but not
reported in the tallies returned by virtnet_stats(). Return them
as the rx "sub-stats" rx_length_errors and rx_frame_errors are.Signed-off-by: Rick Jones
Acked-by: Rusty Russell
Signed-off-by: David S. Miller
17 Nov, 2011
1 commit
-
Add a new .bus_name to virtio_config_ops then modify virtio_net to
call through to it in an ethtool .get_drvinfo routine to report
bus_info in ethtool -i output which is consistent with other
emulated NICs and the output of lspci.Signed-off-by: Rick Jones
Signed-off-by: David S. Miller
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
24 Oct, 2011
1 commit
-
Add support for reporting ring sizes via ethtool -g to the virtio_net
driver.Signed-off-by: Rick Jones
Acked-by: Rusty Russell
Acked-by: Michael S. Tsirkin
Signed-off-by: David S. Miller
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
20 Oct, 2011
1 commit
-
Remove manual initialization in set_skb_frag, and instead
use __skb_fill_page_desc() to do the same. Patch tested
on net-next.Signed-off-by: Krishna Kumar
Acked-by: Eric Dumazet
Signed-off-by: David S. Miller
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
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
23 Sep, 2011
1 commit
-
Signed-off-by: Ian Campbell
Cc: Rusty Russell
Cc: "Michael S. Tsirkin"
Cc: virtualization@lists.linux-foundation.org
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller
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 filteringSigned-off-by: Jiri Pirko
Signed-off-by: David S. Miller
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
01 Jul, 2011
1 commit
-
Use per-cpu variables to maintain 64 bit statistics.
Signed-off-by: Stephen Hemminger
Signed-off-by: David S. Miller
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
30 May, 2011
1 commit
-
Ask for delayed callbacks on TX ring full, to give the
other side more of a chance to make progress.Signed-off-by: Michael S. Tsirkin
Acked-by: David S. Miller
Signed-off-by: Rusty Russell
02 Apr, 2011
1 commit
-
Signed-off-by: Michał Mirosław
Signed-off-by: David S. Miller
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
17 Dec, 2010
1 commit
-
Replace skb->csum_start - skb_headroom(skb) with skb_checksum_start_offset().
Note for usb/smsc95xx: skb->data - skb->head == skb_headroom(skb).
Signed-off-by: Michał Mirosław
Signed-off-by: David S. Miller
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
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
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 supportedThis 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: virtio0Personally, "-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
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 -
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
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
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.
19 May, 2010
1 commit
-
Switch virtio_net to new virtqueue_xxx wrappers.
Signed-off-by: Michael S. Tsirkin
Signed-off-by: Rusty Russell
14 Apr, 2010
2 commits
-
Pointed out by Stephen Rothwell.
Signed-off-by: David S. Miller
-
Conflicts:
drivers/net/pcmcia/smc91c92_cs.c
drivers/net/virtio_net.c
13 Apr, 2010
1 commit
-
Add missing sg_init_table for sg_set_buf in virtio_net which
induced in defer skb patch.Reported-by: Thomas Müller
Tested-by: Thomas Müller
Signed-off-by: Shirley Ma
Signed-off-by: David S. Miller
12 Apr, 2010
1 commit
-
Conflicts:
drivers/net/stmmac/stmmac_main.c
drivers/net/wireless/wl12xx/wl1271_cmd.c
drivers/net/wireless/wl12xx/wl1271_main.c
drivers/net/wireless/wl12xx/wl1271_spi.c
net/core/ethtool.c
net/mac80211/scan.c
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
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