qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: Dmitry Fleytman <dmitry@daynix.com>,
	David Gibson <dgibson@redhat.com>,
	qemu-s390x@nongnu.org, qemu-ppc@nongnu.org, f4bug@amsat.org
Subject: Re: [Qemu-devel] [PATCH v2 for-2.11] hw/net/vmxnet3: Fix code to work on big endian hosts, too
Date: Fri, 17 Nov 2017 17:50:21 +0800	[thread overview]
Message-ID: <b8ccca3c-bc60-4db2-81e2-ba3a516d6b2a@redhat.com> (raw)
In-Reply-To: <1510658424-16527-1-git-send-email-thuth@redhat.com>



On 2017年11月14日 19:20, Thomas Huth wrote:
> Since commit ab06ec43577177a442e8 we test the vmxnet3 device in the
> pxe-tester, too (when running "make check SPEED=slow"). This now
> revealed that the code is not working there if the host is a big
> endian machine (for example ppc64 or s390x) - "make check SPEED=slow"
> is now failing on such hosts.
>
> The vmxnet3 code lacks endianess conversions in a couple of places.
> Interestingly, the bitfields in the structs in vmxnet3.h already tried to
> take care of the*bit*  endianess of the C compilers - but the code missed
> to change the*byte*  endianess when reading or writing the corresponding
> structs. So the bitfields are now wrapped into unions which allow to change
> the byte endianess during runtime with the non-bitfield member of the union.
> With these changes, "make check SPEED=slow" now properly works on big endian
> hosts, too.
>
> Reported-by: David Gibson<dgibson@redhat.com>
> Signed-off-by: Thomas Huth<thuth@redhat.com>
> ---
>   v2:
>   - Introduced vmxnet3_ring_read_curr_txdesc() & vmxnet3_pci_dma_write_rxcd()
>     helper functions to wrap the byte-swapping code that is required in
>     multiple places (as suggested by Philippe)

Applied with typo fixed.

Thanks

      parent reply	other threads:[~2017-11-17  9:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-14 11:20 [Qemu-devel] [PATCH v2 for-2.11] hw/net/vmxnet3: Fix code to work on big endian hosts, too Thomas Huth
2017-11-14 11:41 ` Philippe Mathieu-Daudé
2017-11-14 11:59 ` no-reply
2017-11-14 23:33 ` David Gibson
2017-11-15  6:59   ` Thomas Huth
2017-11-15 23:18     ` David Gibson
2017-11-17  9:50 ` Jason Wang [this message]

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=b8ccca3c-bc60-4db2-81e2-ba3a516d6b2a@redhat.com \
    --to=jasowang@redhat.com \
    --cc=dgibson@redhat.com \
    --cc=dmitry@daynix.com \
    --cc=f4bug@amsat.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    --cc=thuth@redhat.com \
    /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).