"Michael S. Tsirkin" <mst@xxxxxxxxxx> writes: > On Tue, May 07, 2013 at 02:13:44PM +0930, Rusty Russell wrote: >> AFAICT we should always do zero copy. > > It seems not to be a win for small packets. > I speculate the issue is that ring space isn't released as promptly. > Further, we can't do it safely for guest to guest and guest to host. > And if we try, net core just does a packet copy later (which is less > efficient). So there's a hack in place to detect that and suppress zero > copy. AFAICT there are two places we should copy. One is small packets: latency plus refcount/callbacks aren't a win. The other is weird packets (eg. more than 1000 segements), which we currently drop. >> Though I do wonder if we should >> use a dedicated hook to get an skb into the tun driver and generate it >> ourselves, rather than going sg -> iov -> skb. >> >> Cheers, >> Rusty. > > I think we'd have to export two interfaces: > - alloc_skb() > .... add frags ... > - send_skb > > the code to add frags could maybe use some > library functions ... I think we just need send_skb for the socket. We can build the skb ourselves. But yes that frag-handling code should be factored out. I'll see how I go. Cheers, Rusty. _______________________________________________ Virtualization mailing list Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linuxfoundation.org/mailman/listinfo/virtualization