All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-net: fix offload ctrl endian
@ 2017-07-14 12:27 Jason Wang
  2017-07-14 14:26 ` Michael S. Tsirkin
  0 siblings, 1 reply; 3+ messages in thread
From: Jason Wang @ 2017-07-14 12:27 UTC (permalink / raw)
  To: mst, jasowang, qemu-devel; +Cc: qemu-stable, Dmitry Fleytman

Spec said offloads should be le64, so use virtio_ldq_p() to guarantee
valid endian.

Fixes: 644c98587d4c ("virtio-net: dynamic network offloads configuration")
Cc: qemu-stable@nongnu.org
Cc: Dmitry Fleytman <dfleytma@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
 hw/net/virtio-net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 657d099..eb8f5b6 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -757,6 +757,7 @@ static int virtio_net_handle_offloads(VirtIONet *n, uint8_t cmd,
 
     if (cmd == VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET) {
         uint64_t supported_offloads;
+        offloads = virtio_ldq_p(vdev, &offloads);
 
         if (!n->has_vnet_hdr) {
             return VIRTIO_NET_ERR;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-net: fix offload ctrl endian
  2017-07-14 12:27 [Qemu-devel] [PATCH] virtio-net: fix offload ctrl endian Jason Wang
@ 2017-07-14 14:26 ` Michael S. Tsirkin
  2017-07-17  9:28   ` Jason Wang
  0 siblings, 1 reply; 3+ messages in thread
From: Michael S. Tsirkin @ 2017-07-14 14:26 UTC (permalink / raw)
  To: Jason Wang; +Cc: qemu-devel, qemu-stable, Dmitry Fleytman

On Fri, Jul 14, 2017 at 08:27:06PM +0800, Jason Wang wrote:
> Spec said offloads should be le64, so use virtio_ldq_p() to guarantee
> valid endian.
> 
> Fixes: 644c98587d4c ("virtio-net: dynamic network offloads configuration")
> Cc: qemu-stable@nongnu.org
> Cc: Dmitry Fleytman <dfleytma@redhat.com>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
> ---
>  hw/net/virtio-net.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 657d099..eb8f5b6 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -757,6 +757,7 @@ static int virtio_net_handle_offloads(VirtIONet *n, uint8_t cmd,
>  
>      if (cmd == VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET) {
>          uint64_t supported_offloads;

An empty line wouldn't hurt here.

> +        offloads = virtio_ldq_p(vdev, &offloads);
>  
>          if (!n->has_vnet_hdr) {
>              return VIRTIO_NET_ERR;
> -- 
> 2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-net: fix offload ctrl endian
  2017-07-14 14:26 ` Michael S. Tsirkin
@ 2017-07-17  9:28   ` Jason Wang
  0 siblings, 0 replies; 3+ messages in thread
From: Jason Wang @ 2017-07-17  9:28 UTC (permalink / raw)
  To: Michael S. Tsirkin; +Cc: qemu-devel, qemu-stable, Dmitry Fleytman



On 2017年07月14日 22:26, Michael S. Tsirkin wrote:
> On Fri, Jul 14, 2017 at 08:27:06PM +0800, Jason Wang wrote:
>> Spec said offloads should be le64, so use virtio_ldq_p() to guarantee
>> valid endian.
>>
>> Fixes: 644c98587d4c ("virtio-net: dynamic network offloads configuration")
>> Cc: qemu-stable@nongnu.org
>> Cc: Dmitry Fleytman <dfleytma@redhat.com>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>> ---
>>   hw/net/virtio-net.c | 1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
>> index 657d099..eb8f5b6 100644
>> --- a/hw/net/virtio-net.c
>> +++ b/hw/net/virtio-net.c
>> @@ -757,6 +757,7 @@ static int virtio_net_handle_offloads(VirtIONet *n, uint8_t cmd,
>>   
>>       if (cmd == VIRTIO_NET_CTRL_GUEST_OFFLOADS_SET) {
>>           uint64_t supported_offloads;
> An empty line wouldn't hurt here.

I apply this patch by adding a new line here.

Thanks

>
>> +        offloads = virtio_ldq_p(vdev, &offloads);
>>   
>>           if (!n->has_vnet_hdr) {
>>               return VIRTIO_NET_ERR;
>> -- 
>> 2.7.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-17  9:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-14 12:27 [Qemu-devel] [PATCH] virtio-net: fix offload ctrl endian Jason Wang
2017-07-14 14:26 ` Michael S. Tsirkin
2017-07-17  9:28   ` Jason Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.