commit 127d061dc224962acca9ea55cff74aef1668ae30 Author: Paul Durrant Date: Fri Dec 6 16:36:07 2013 +0000 xen-netback: improve guest-receive-side flow control The way that flow control works without this patch is that, in start_xmit() the code uses xenvif_count_skb_slots() to predict how many slots xenvif_gop_skb() will consume and then adds this to a 'req_cons_peek' counter which it then uses to determine if the shared ring has that amount of space available by checking whether 'req_prod' has passed that value. If the ring doesn't have space the tx queue is stopped. xenvif_gop_skb() will then consume slots and update 'req_cons' and issue responses, updating 'rsp_prod' as it goes. The frontend will consume those responses and post new requests, by updating req_prod. So, req_prod chases req_cons which chases rsp_prod, and can never exceed that value. Thus if xenvif_count_skb_slots() ever returns a number of slots greater than xenvif_gop_skb() uses, req_cons_peek will get to a value that req_prod cannot possibly achieve (since it's limited by the 'real' req_cons) and, if this happens enough times, req_cons_peek gets more than a ring size ahead of req_cons and the tx queue then remains stopped forever waiting for an unachievable amount of space to become available in the ring. Having two routines trying to calculate the same value is always going to be fragile, so this patch does away with that. All we essentially need to do is make sure that we have 'enough stuff' on our internal queue without letting it build up uncontrollably. So start_xmit() makes a cheap optimistic check of how much space is needed for an skb and only turns the queue off if that is unachievable. net_rx_action() is the place where we could do with an accurate predicition but, since that has proven tricky to calculate, a cheap worse-case (but not too bad) estimate is all we really need since the only thing we *must* prevent is xenvif_gop_skb() consuming more slots than are available. Without this patch I can trivially stall netback permanently by just doing a large guest to guest file copy between two Windows Server 2008R2 VMs on a single host. Patch tested with frontends in: - Windows Server 2008R2 - CentOS 6.0 - Debian Squeeze - Debian Wheezy - SLES11 Signed-off-by: Paul Durrant Cc: Wei Liu Cc: Ian Campbell Cc: David Vrabel Cc: Annie Li Cc: Konrad Rzeszutek Wilk Acked-by: Wei Liu Signed-off-by: David S. Miller commit b5744778373de94dcc7089be0bbf7d78210da30e Merge: ca3f97e 7693dec Author: Sander Eikelenboom Date: Mon Mar 10 18:43:37 2014 +0100 Merge tag 'stable/for-linus-3.14-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip into HEAD Bug: - Fix compile dependency on Xen ARM to have MMU. commit ca3f97e643c9017510f2823a47795affaf32f0e0 Merge: d685a88 d8320b2 Author: Sander Eikelenboom Date: Mon Mar 10 18:42:51 2014 +0100 Merge tag 'stable/for-linus-3.14-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip into HEAD Bug-fix: - Fix ARM and Xen FIFO not working. - Remove more Xen ia64 vestigates. - Fix UAPI missing Xen files. commit d685a88845a6f82cb8bbb714ddf7647c1f2ee158 Merge: 0ac97c3 afca501 Author: Sander Eikelenboom Date: Mon Mar 10 18:42:08 2014 +0100 Merge tag 'stable/for-linus-3.14-rc1-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip into HEAD Bug-fixes: - Revert "xen/grant-table: Avoid m2p_override during mapping" as it broke Xen ARM build. - Fix CR4 not being set on AP processors in Xen PVH mode. commit 0ac97c365be141cc6fa70b685bbce6890ab4f99c Merge: 3c4aac9 f93576e Author: Sander Eikelenboom Date: Mon Mar 10 18:38:44 2014 +0100 Merge tag 'stable/for-linus-3.14-rc0-late-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip into HEAD Bug-fixes: - Xen ARM couldn't use the new FIFO events - Xen ARM couldn't use the SWIOTLB if compiled as 32-bit with 64-bit PCIe devices. - Grant table were doing needless M2P operations. - Ratchet down the self-balloon code so it won't OOM. - Fix misplaced kfree in Xen PVH error code paths. commit 3c4aac97ca0b8f8c67f3c62719d880ef3147fe78 Merge: 404df65 c9f6e99 Author: Sander Eikelenboom Date: Mon Mar 10 18:31:38 2014 +0100 Merge tag 'stable/for-linus-3.14-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip into HEAD Features: - FIFO event channels. Key advantages: support for over 100,000 events (2^17), 16 different event priorities, improved fairness in event latency through the use of FIFOs. - Xen PVH support. "It’s a fully PV kernel mode, running with paravirtualized disk and network, paravirtualized interrupts and timers, no emulated devices of any kind (and thus no qemu), no BIOS or legacy boot — but instead of requiring PV MMU, it uses the HVM hardware extensions to virtualize the pagetables, as well as system calls and other privileged operations." (from "The Paravirtualization Spectrum, Part 2: From poles to a spectrum") Bug-fixes: - Fixes in balloon driver (refactor and make it work under ARM) - Allow xenfb to be used in HVM guests. - Allow xen_platform_pci=0 to work properly. - Refactors in event channels. Conflicts: arch/arm/include/asm/xen/page.h include/xen/platform_pci.h commit 404df65d0480f6da2b768f6c9b5259436b1de10f Author: Greg Kroah-Hartman Date: Thu Mar 6 22:07:02 2014 -0800 Linux 3.13.6