summaryrefslogtreecommitdiff
path: root/drivers/memstick/host
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2013-07-18 06:55:15 +0400
committerDavid S. Miller <davem@davemloft.net>2013-07-19 00:04:25 +0400
commit885291761dba2bfe04df4c0f7bb75e4c920ab82e (patch)
tree832392fed4bc4e2deebebae235d46debf5b15fc5 /drivers/memstick/host
parent87f40dd6ce7042caca0b3b557e8923127f51f902 (diff)
downloadlinux-885291761dba2bfe04df4c0f7bb75e4c920ab82e.tar.xz
tuntap: 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. The bug were introduced from commit 0690899b4d4501b3505be069b9a687e68ccbe15b (tun: experimental zero copy tx support) Cc: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/memstick/host')
0 files changed, 0 insertions, 0 deletions