OpenCloudOS-Kernel/drivers/net
Jason Wang ece793fcfc macvtap: do not zerocopy if iov needs more pages than MAX_SKB_FRAGS
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>
2013-07-18 13:04:25 -07:00
..
appletalk appletalk: remove "config IPDDP_DECAP" 2013-03-22 10:21:09 -04:00
arcnet drivers/net: use module_pcmcia_driver() in pcmcia drivers 2013-03-15 12:27:33 -07:00
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-07-03 14:55:13 -07:00
caif drivers/net: caif: fix wrong rtnl_is_locked() usage 2013-07-09 12:55:48 -07:00
can drivers/net/can/c_can: don't use devm_pinctrl_get_select_default() in probe 2013-07-11 17:18:26 -07:00
cris
dsa
ethernet be2net: Fix to avoid hardware workaround when not needed 2013-07-16 13:01:57 -07:00
fddi net/fddi/skfp/skfddi: Use module_pci_driver to register driver 2013-05-22 14:35:05 -07:00
hamradio net: pass info struct via netdevice notifier 2013-05-28 13:11:01 -07:00
hippi net/hippi/rrunner: Use module_pci_driver to register driver 2013-05-22 14:35:05 -07:00
hyperv hyperv: Fix the NETIF_F_SG flag setting in netvsc 2013-07-16 23:02:24 -07:00
ieee802154 drivers/net/ieee802154: don't use devm_pinctrl_get_select_default() in probe 2013-07-11 17:18:27 -07:00
irda net: irda: remove unnecessary platform_set_drvdata() 2013-05-27 22:34:51 -07:00
phy Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-07-13 17:42:22 -07:00
plip net: add ETH_P_802_3_MIN 2013-03-28 01:20:42 -04:00
ppp net: pass info struct via netdevice notifier 2013-05-28 13:11:01 -07:00
slip
team Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-06-19 16:49:39 -07:00
usb usb/net/r815x: fix cast to restricted __le32 2013-07-12 16:13:34 -07:00
vmxnet3 net: vlan: add protocol argument to packet tagging functions 2013-04-19 14:46:06 -04:00
wan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-07-03 14:55:13 -07:00
wimax
wireless Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-07-09 18:24:39 -07:00
xen-netback xen-netback: xenbus.c: use more current logging styles 2013-07-02 00:52:55 -07:00
Kconfig packet: nlmon: virtual netlink monitoring device for packet sockets 2013-06-24 16:39:05 -07:00
LICENSE.SRC
Makefile packet: nlmon: virtual netlink monitoring device for packet sockets 2013-06-24 16:39:05 -07:00
Space.c
dummy.c dummy: fix oops when loading the dummy failed 2013-07-11 11:59:20 -07:00
eql.c
ifb.c ifb: fix oops when loading the ifb failed 2013-07-11 12:00:05 -07:00
loopback.c
macvlan.c macvtap: Let TUNSETOFFLOAD actually controll offload features. 2013-06-25 16:44:56 -07:00
macvtap.c macvtap: do not zerocopy if iov needs more pages than MAX_SKB_FRAGS 2013-07-18 13:04:25 -07:00
mdio.c
mii.c
netconsole.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2013-07-09 18:24:39 -07:00
nlmon.c nlmon: use standard rtnetlink link api for add/del devices 2013-07-02 12:53:17 -07:00
ntb_netdev.c ntb_netdev: remove from list on exit 2013-05-15 10:58:14 -07:00
rionet.c rapidio/rionet: rework driver initialization and removal 2013-07-03 16:08:04 -07:00
sb1000.c
sungem_phy.c
tun.c tuntap: do not zerocopy if iov needs more pages than MAX_SKB_FRAGS 2013-07-18 13:04:25 -07:00
veth.c veth: remove redundant call of dev_alloc_name 2013-06-12 01:21:20 -07:00
virtio_net.c No real surprises. 2013-07-10 14:50:58 -07:00
vxlan.c vxlan: add necessary locking on device removal 2013-07-17 12:51:19 -07:00
xen-netfront.c xen-netfront: pull on receive skb may need to happen earlier 2013-07-17 12:51:19 -07:00