summaryrefslogtreecommitdiffstats
path: root/drivers/net/xen-netback/interface.c
diff options
context:
space:
mode:
authorWei Liu2017-06-21 11:21:22 +0200
committerDavid S. Miller2017-06-22 17:15:42 +0200
commitdfa523ae9f2542bee4cddaea37b3be3e157f6e6b (patch)
tree3c31b603c04bad0bb51c19305488cc12140ff7cb /drivers/net/xen-netback/interface.c
parentveth: Be more robust on network device creation when no attributes (diff)
downloadkernel-qcow2-linux-dfa523ae9f2542bee4cddaea37b3be3e157f6e6b.tar.gz
kernel-qcow2-linux-dfa523ae9f2542bee4cddaea37b3be3e157f6e6b.tar.xz
kernel-qcow2-linux-dfa523ae9f2542bee4cddaea37b3be3e157f6e6b.zip
xen-netback: correctly schedule rate-limited queues
Add a flag to indicate if a queue is rate-limited. Test the flag in NAPI poll handler and avoid rescheduling the queue if true, otherwise we risk locking up the host. The rescheduling will be done in the timer callback function. Reported-by: Jean-Louis Dupond <jean-louis@dupond.be> Signed-off-by: Wei Liu <wei.liu2@citrix.com> Tested-by: Jean-Louis Dupond <jean-louis@dupond.be> Reviewed-by: Paul Durrant <paul.durrant@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/xen-netback/interface.c')
-rw-r--r--drivers/net/xen-netback/interface.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/net/xen-netback/interface.c b/drivers/net/xen-netback/interface.c
index 8397f6c92451..e322a862ddfe 100644
--- a/drivers/net/xen-netback/interface.c
+++ b/drivers/net/xen-netback/interface.c
@@ -106,7 +106,11 @@ static int xenvif_poll(struct napi_struct *napi, int budget)
if (work_done < budget) {
napi_complete_done(napi, work_done);
- xenvif_napi_schedule_or_enable_events(queue);
+ /* If the queue is rate-limited, it shall be
+ * rescheduled in the timer callback.
+ */
+ if (likely(!queue->rate_limited))
+ xenvif_napi_schedule_or_enable_events(queue);
}
return work_done;