linux-uconsole/drivers/net
Jason Wang 7d9e6dd88c macvtap: do not zerocopy if iov needs more pages than MAX_SKB_FRAGS
[ Upstream commit ece793fcfc ]

We try to linearize part of the skb when the number of iov is greater than
MAX_SKB_FRAGS. This is not enough since each single vector may occupy more than
one pages, so zerocopy_sg_fromiovec() may still fail and may break the guest
network.

Solve this problem by calculate the pages needed for iov before trying to do
zerocopy and switch to use copy instead of zerocopy if it needs more than
MAX_SKB_FRAGS.

This is done through introducing a new helper to count the pages for iov, and
call uarg->callback() manually when switching from zerocopy to copy to notify
vhost.

We can do further optimization on top.

This bug were introduced from b92946e291
(macvtap: zerocopy: validate vectors before building skb).

Cc: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-28 16:30:05 -07:00
..
appletalk
arcnet
bonding bonding: fix slave speed reporting in bond_miimon_commit 2013-06-24 00:04:55 -07:00
caif caif: CAIF_VIRTIO should depend on HAS_DMA 2013-05-11 16:28:24 -07:00
can can: usb_8dev: unregister netdev before free()ing 2013-06-19 08:56:10 +02:00
cris
dsa
ethernet be2net: Fix to avoid hardware workaround when not needed 2013-07-28 16:30:04 -07:00
fddi
hamradio drivers/net: rename random32() to prandom_u32() 2013-05-07 18:38:27 -07:00
hippi
hyperv hyperv: Fix the NETIF_F_SG flag setting in netvsc 2013-07-28 16:30:04 -07:00
ieee802154 at86rf230: change irq handling to prevent lockups with edge type irq 2013-04-16 16:34:08 -04:00
irda net/irda: fix error return code in bfin_sir_open() 2013-05-08 13:13:29 -07:00
phy net: phy: fix a bug when verify the EEE support 2013-05-27 23:30:09 -07:00
plip
ppp Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-05-01 14:08:52 -07:00
slip
team team: move add to port list before port enablement 2013-06-12 00:56:27 -07:00
usb qmi_wwan: add various Novatel Gobi1K IDs 2013-06-24 00:08:38 -07:00
vmxnet3 net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
wan dlci: validate the net device in dlci_del() 2013-06-26 15:36:42 -07:00
wimax
wireless b43: ensue that BCMA is "y" when B43 is "y" 2013-07-25 14:07:31 -07:00
xen-netback xen-netback: don't de-reference vif pointer after having called xenvif_put() 2013-06-13 01:25:24 -07:00
dummy.c dummy: fix oops when loading the dummy failed 2013-07-28 16:30:01 -07:00
eql.c
ifb.c ifb: fix oops when loading the ifb failed 2013-07-28 16:30:01 -07:00
Kconfig
LICENSE.SRC
loopback.c
macvlan.c macvlan: don't touch promisc without passthrough 2013-06-13 01:20:33 -07:00
macvtap.c macvtap: do not zerocopy if iov needs more pages than MAX_SKB_FRAGS 2013-07-28 16:30:05 -07:00
Makefile
mdio.c
mii.c
netconsole.c
ntb_netdev.c ntb_netdev: remove from list on exit 2013-05-15 10:58:14 -07:00
rionet.c
sb1000.c
Space.c
sungem_phy.c
tun.c tuntap: do not zerocopy if iov needs more pages than MAX_SKB_FRAGS 2013-07-28 16:30:04 -07:00
veth.c net: vlan: announce STAG offload capability in some drivers 2013-04-19 14:46:06 -04:00
virtio_net.c virtio_net: fix race in RX VQ processing 2013-07-28 16:29:56 -07:00
vxlan.c vxlan: fix check for migration of static entry 2013-06-19 00:50:58 -07:00
xen-netfront.c xen-netfront: reduce gso_max_size to account for max TCP header 2013-04-22 15:37:01 -04:00