From be716732be28963fd3858d84452389d5f84a43fe Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 11 Sep 2019 10:21:52 +0100 Subject: [PATCH] 4.4-stable patches added patches: vhost-test-fix-build-for-vhost-test.patch --- queue-4.4/series | 1 + .../vhost-test-fix-build-for-vhost-test.patch | 62 +++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 queue-4.4/vhost-test-fix-build-for-vhost-test.patch diff --git a/queue-4.4/series b/queue-4.4/series index f9676ef02c7..227cc80eba3 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -1,3 +1,4 @@ alsa-hda-fix-potential-endless-loop-at-applying-quirks.patch alsa-hda-realtek-fix-overridden-device-specific-initialization.patch xfrm-clean-up-xfrm-protocol-checks.patch +vhost-test-fix-build-for-vhost-test.patch diff --git a/queue-4.4/vhost-test-fix-build-for-vhost-test.patch b/queue-4.4/vhost-test-fix-build-for-vhost-test.patch new file mode 100644 index 00000000000..4569bc43404 --- /dev/null +++ b/queue-4.4/vhost-test-fix-build-for-vhost-test.patch @@ -0,0 +1,62 @@ +From 264b563b8675771834419057cbe076c1a41fb666 Mon Sep 17 00:00:00 2001 +From: Tiwei Bie +Date: Wed, 28 Aug 2019 13:37:00 +0800 +Subject: vhost/test: fix build for vhost test + +From: Tiwei Bie + +commit 264b563b8675771834419057cbe076c1a41fb666 upstream. + +Since vhost_exceeds_weight() was introduced, callers need to specify +the packet weight and byte weight in vhost_dev_init(). Note that, the +packet weight isn't counted in this patch to keep the original behavior +unchanged. + +Fixes: e82b9b0727ff ("vhost: introduce vhost_exceeds_weight()") +Cc: stable@vger.kernel.org +Signed-off-by: Tiwei Bie +Signed-off-by: Michael S. Tsirkin +Acked-by: Jason Wang +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/vhost/test.c | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +--- a/drivers/vhost/test.c ++++ b/drivers/vhost/test.c +@@ -23,6 +23,12 @@ + * Using this limit prevents one virtqueue from starving others. */ + #define VHOST_TEST_WEIGHT 0x80000 + ++/* Max number of packets transferred before requeueing the job. ++ * Using this limit prevents one virtqueue from starving others with ++ * pkts. ++ */ ++#define VHOST_TEST_PKT_WEIGHT 256 ++ + enum { + VHOST_TEST_VQ = 0, + VHOST_TEST_VQ_MAX = 1, +@@ -81,10 +87,8 @@ static void handle_vq(struct vhost_test + } + vhost_add_used_and_signal(&n->dev, vq, head, 0); + total_len += len; +- if (unlikely(total_len >= VHOST_TEST_WEIGHT)) { +- vhost_poll_queue(&vq->poll); ++ if (unlikely(vhost_exceeds_weight(vq, 0, total_len))) + break; +- } + } + + mutex_unlock(&vq->mutex); +@@ -116,7 +120,8 @@ static int vhost_test_open(struct inode + dev = &n->dev; + vqs[VHOST_TEST_VQ] = &n->vqs[VHOST_TEST_VQ]; + n->vqs[VHOST_TEST_VQ].handle_kick = handle_vq_kick; +- vhost_dev_init(dev, vqs, VHOST_TEST_VQ_MAX); ++ vhost_dev_init(dev, vqs, VHOST_TEST_VQ_MAX, ++ VHOST_TEST_PKT_WEIGHT, VHOST_TEST_WEIGHT); + + f->private_data = n; + -- 2.47.3