qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: peter.maydell@linaro.org, qemu-devel@nongnu.org
Cc: Jason Wang <jasowang@redhat.com>,
	qemu-stable@nongnu.org, Dmitry Fleytman <dfleytma@redhat.com>
Subject: [Qemu-devel] [PULL 14/14] virtio-net: fix offload ctrl endian
Date: Mon, 17 Jul 2017 20:21:45 +0800	[thread overview]
Message-ID: <1500294105-13713-15-git-send-email-jasowang@redhat.com> (raw)
In-Reply-To: <1500294105-13713-1-git-send-email-jasowang@redhat.com>

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 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 657d099..148071a 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -758,6 +758,8 @@ 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

  parent reply	other threads:[~2017-07-17 12:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 12:21 [Qemu-devel] [PULL 00/14] Net patches Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 01/14] net: Add vnet_hdr_len arguments in NetClientState Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 02/14] net/net.c: Add vnet_hdr support in SocketReadState Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 03/14] net/filter-mirror.c: Introduce parameter for filter_send() Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 04/14] net/filter-mirror.c: Make filter mirror support vnet support Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 05/14] net/filter-mirror.c: Add new option to enable vnet support for filter-redirector Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 06/14] net/colo.c: Make vnet_hdr_len as packet property Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 07/14] net/colo-compare.c: Introduce parameter for compare_chr_send() Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 08/14] net/colo-compare.c: Make colo-compare support vnet_hdr_len Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 09/14] net/colo.c: Add vnet packet parse feature in colo-proxy Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 10/14] net/colo-compare.c: Add vnet packet's tcp/udp/icmp compare Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 11/14] net/filter-rewriter.c: Make filter-rewriter support vnet_hdr_len Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 12/14] docs/colo-proxy.txt: Update colo-proxy usage of net driver with vnet_header Jason Wang
2017-07-17 12:21 ` [Qemu-devel] [PULL 13/14] virtion-net: Prefer is_power_of_2() Jason Wang
2017-07-17 12:21 ` Jason Wang [this message]
2017-07-18  9:34 ` [Qemu-devel] [PULL 00/14] Net patches Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1500294105-13713-15-git-send-email-jasowang@redhat.com \
    --to=jasowang@redhat.com \
    --cc=dfleytma@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-stable@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).