vhost/test: fix build for vhost test
PATCH 1/1 vhost/test: fix build for vhost test
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.
--- drivers/vhost/test.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/vhost/test.c +9 -4
@@ -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 *n) }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 *inode, struct file *f) 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;
Signature · 1 line
2.17.1
Greg KH
maintainerQuoted 7 lines · Tiwei Bie
commit
264b563b8675771834419057cbe076c1a41fb666upstream.Since
vhost_exceeds_weight()was introduced, callers need to specify the packet weight and byte weight invhost_dev_init(). Note that, the packet weight isn't counted in this patch to keep the original behavior unchanged.
Quoted 9 lines
Fixes e82b9b0727ff ("vhost: introduce vhost_exceeds_weight()")Signed-off-by Tiwei Bie <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>Acked-by Jason Wang <[email protected]>--- drivers/vhost/test.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
Now queued up, thanks.
greg k-h
Quoted 7 lines · Tiwei Bie
commit
264b563b8675771834419057cbe076c1a41fb666upstream.Since
vhost_exceeds_weight()was introduced, callers need to specify the packet weight and byte weight invhost_dev_init(). Note that, the packet weight isn't counted in this patch to keep the original behavior unchanged.
Quoted 5 lines
Fixes e82b9b0727ff ("vhost: introduce vhost_exceeds_weight()")Signed-off-by Tiwei Bie <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>Acked-by Jason Wang <[email protected]>
I've queued it up for 4.14, 4.9, and 4.4. Thank you.
--
Thanks,
Sasha
Greg KH
maintainerQuoted 8 lines · Sasha Levin
Quoted 7 lines · Tiwei Bie
commit
264b563b8675771834419057cbe076c1a41fb666upstream.Since
vhost_exceeds_weight()was introduced, callers need to specify the packet weight and byte weight invhost_dev_init(). Note that, the packet weight isn't counted in this patch to keep the original behavior unchanged.
Quoted 7 lines
Quoted 5 lines
Fixes e82b9b0727ff ("vhost: introduce vhost_exceeds_weight()")Signed-off-by Tiwei Bie <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>Acked-by Jason Wang <[email protected]>I've queued it up for 4.14, 4.9, and 4.4. Thank you.
So did I, I think you will get conflicts when you try to merge :)
Sasha Levin
maintainerQuoted 15 lines · Greg KH
Quoted 14 lines · Sasha Levin
Quoted 12 lines · Tiwei Bie
commit
264b563b8675771834419057cbe076c1a41fb666upstream.Since
vhost_exceeds_weight()was introduced, callers need to specify the packet weight and byte weight invhost_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()")Signed-off-by Tiwei Bie <[email protected]>Signed-off-by Michael S. Tsirkin <[email protected]>Acked-by Jason Wang <[email protected]>
Quoted 3 lines
Quoted 1 line
I've queued it up for 4.14, 4.9, and 4.4. Thank you.
So did I, I think you will get conflicts when you try to merge :)
I did. Good thing we live in different timezones :)
--
Thanks,
Sasha