]> www.infradead.org Git - users/jedix/linux-maple.git/commit
xen-netback: wake up xenvif_dealloc_kthread when it should stop
authorDongli Zhang <dongli.zhang@oracle.com>
Mon, 21 Jan 2019 01:56:55 +0000 (09:56 +0800)
committerBrian Maly <brian.maly@oracle.com>
Wed, 30 Jan 2019 04:03:12 +0000 (23:03 -0500)
commit4de57e4161aa6cb0ed289856ed2b47c8f57a5c1e
tree10bd4d00cf0de179508369fd1ac1fe93572cb95e
parent71886fff42bcb86132f0a9d267be555004523fc7
xen-netback: wake up xenvif_dealloc_kthread when it should stop

The feature 'staging grant' changed the behaviour of
xenvif_zerocopy_callback() that queue->dealloc_prod may not increase during
the do-while loop because of 'staging grant'. As a result,
xenvif_skb_zerocopy_complete() would not wake up xenvif_dealloc_kthread
because (prod == queue->dealloc_prod).

This makes trouble when the xenvif_dealloc_kthread is requested to stop by
xenvif_disconnect(). When xenvif_dealloc_kthread is stopped while
inflight_packets is not 0, xenvif_dealloc_kthread would not exit until
inflight_packets becomes 0.

However, because of 'staging grant', xenvif_skb_zerocopy_complete() would
not wake up xenvif_dealloc_kthread() although inflight_packets is
decremented and already becomes 0. As a result, xenvif_dealloc_kthread will
never wakes up.

xenvif_skb_zerocopy_complete() should wake up xenvif_dealloc_kthread when
the latter is in the progress to stop.

Orabug: 29217927

Fixes: fdbb2e3659b3 ("xen-netback: use gref mappings for Tx requests")
Reported-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
Signed-off-by: Dongli Zhang <dongli.zhang@oracle.com>
Reviewed-by: Joao Martins <joao.m.martins@oracle.com>
Reviewed-by: Joe Jin <joe.jin@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
drivers/net/xen-netback/interface.c