Displaying 8 results from an estimated 8 matches for "vhost_adjust_vring_endian".
2016 Feb 10
2
[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code
...ndex 9eda69e40678..df01c939cd00 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -917,6 +917,9 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
>
> vhost_net_disable_vq(n, vq);
> vq->private_data = sock;
> +
> + vhost_adjust_vring_endian(vq);
> +
> r = vhost_init_used(vq);
> if (r)
> goto err_used;
This is in fact a bug in existing code: if vhost_init_used
fails, it preferably should not have side-effects.
It's best to update it last thing.
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
&...
2016 Feb 10
2
[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code
...ndex 9eda69e40678..df01c939cd00 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -917,6 +917,9 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
>
> vhost_net_disable_vq(n, vq);
> vq->private_data = sock;
> +
> + vhost_adjust_vring_endian(vq);
> +
> r = vhost_init_used(vq);
> if (r)
> goto err_used;
This is in fact a bug in existing code: if vhost_init_used
fails, it preferably should not have side-effects.
It's best to update it last thing.
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
&...
2016 Feb 10
0
[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code
...gt; > --- a/drivers/vhost/net.c
> > +++ b/drivers/vhost/net.c
> > @@ -917,6 +917,9 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
> >
> > vhost_net_disable_vq(n, vq);
> > vq->private_data = sock;
> > +
> > + vhost_adjust_vring_endian(vq);
> > +
> > r = vhost_init_used(vq);
> > if (r)
> > goto err_used;
>
>
> This is in fact a bug in existing code: if vhost_init_used
> fails, it preferably should not have side-effects.
> It's best to update it last thing.
>
I'm af...
2016 Jan 13
0
[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code
...vers/vhost/net.c b/drivers/vhost/net.c
index 9eda69e40678..df01c939cd00 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -917,6 +917,9 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
vhost_net_disable_vq(n, vq);
vq->private_data = sock;
+
+ vhost_adjust_vring_endian(vq);
+
r = vhost_init_used(vq);
if (r)
goto err_used;
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
index 29cfc57d496e..5a8363bfcb74 100644
--- a/drivers/vhost/scsi.c
+++ b/drivers/vhost/scsi.c
@@ -1274,6 +1274,9 @@ vhost_scsi_set_endpoint(struct vhost_scsi *vs,
vq = &v...
2016 Jan 13
7
[PATCH 0/2] vhost: cross-endian code cleanup
This series is a respin of the following patch:
http://patchwork.ozlabs.org/patch/565921/
Patch 1 is preliminary work: it gives better names to the helpers that are
involved in cross-endian support.
Patch 2 is actually a v2 of the original patch. All devices now call a
helper in the generic code, which DTRT according to vq->private_data, as
suggested by Michael.
---
Greg Kurz (2):
2016 Jan 13
7
[PATCH 0/2] vhost: cross-endian code cleanup
This series is a respin of the following patch:
http://patchwork.ozlabs.org/patch/565921/
Patch 1 is preliminary work: it gives better names to the helpers that are
involved in cross-endian support.
Patch 2 is actually a v2 of the original patch. All devices now call a
helper in the generic code, which DTRT according to vq->private_data, as
suggested by Michael.
---
Greg Kurz (2):
2016 Feb 10
1
[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code
...08:43 +0100
Greg Kurz <gkurz at linux.vnet.ibm.com> wrote:
> But you are right, there is a bug: we should rollback if vhost_init_used()
> fails. Something like below:
>
> err_used:
> vq->private_data = oldsock;
> vhost_net_enable_vq(n, vq);
> + vhost_adjust_vring_endian(vq);
Shouldn't we switch back before we reenable? Or have I lost myself in
this maze here again?
> if (ubufs)
> vhost_net_ubuf_put_wait_and_free(ubufs);
> err_ubufs:
2016 Feb 10
1
[PATCH 2/2] vhost: disentangle vring endianness stuff from the core code
...08:43 +0100
Greg Kurz <gkurz at linux.vnet.ibm.com> wrote:
> But you are right, there is a bug: we should rollback if vhost_init_used()
> fails. Something like below:
>
> err_used:
> vq->private_data = oldsock;
> vhost_net_enable_vq(n, vq);
> + vhost_adjust_vring_endian(vq);
Shouldn't we switch back before we reenable? Or have I lost myself in
this maze here again?
> if (ubufs)
> vhost_net_ubuf_put_wait_and_free(ubufs);
> err_ubufs: