From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: "Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org,
"Daniel Henrique Barboza" <danielhb413@gmail.com>,
"BALATON Zoltan" <balaton@eik.bme.hu>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Alistair Francis" <alistair@alistair23.me>,
"David Gibson" <david@gibson.dropbear.id.au>,
"Jason Wang" <jasowang@redhat.com>,
"Cédric Le Goater" <clg@kaod.org>, "Greg Kurz" <groug@kaod.org>,
qemu-arm@nongnu.org, qemu-ppc@nongnu.org
Subject: Re: [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu()
Date: Tue, 13 Dec 2022 16:41:56 +0100 [thread overview]
Message-ID: <Y5idRFBkHSXIdnCM@toto> (raw)
In-Reply-To: <CAFEAcA9-XbeREaoOL=MKxmBmK1V9n9r1cNTjyXZKo3ujdJu8xQ@mail.gmail.com>
On Tue, Dec 13, 2022 at 03:22:54PM +0000, Peter Maydell wrote:
> On Tue, 13 Dec 2022 at 14:23, Edgar E. Iglesias
> <edgar.iglesias@gmail.com> wrote:
> >
> > On Tue, Dec 13, 2022 at 02:18:42PM +0000, Peter Maydell wrote:
> > > On Tue, 13 Dec 2022 at 14:14, Edgar E. Iglesias
> > > <edgar.iglesias@gmail.com> wrote:
> > > >
> > > > On Tue, Dec 13, 2022 at 01:53:15PM +0000, Peter Maydell wrote:
> > > > > On Tue, 13 Dec 2022 at 12:52, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
> > > > > >
> > > > > > This partly revert commit d48751ed4f ("xilinx-ethlite:
> > > > > > Simplify byteswapping to/from brams") which states the
> > > > > > packet data is stored in big-endian.
>
> > > > > This is a change of behaviour for this device in the
> > > > > qemu-system-microblazeel petalogix-s3adsp1800 board, because
> > > > > previously on that system the bytes of the rx buffer would
> > > > > appear in the registers in little-endian order and now they
> > > > > will appear in big-endian order.
> > > > >
> > > > > Edgar, do you know what the real hardware does here ?
> > >
> > > > Yeah, I think these tx/rx buffers (the default case with tswap32)
> > > > should be modelled as plain RAM's (they are just RAM's on real HW).
> > > > Because we're modeling as MMIO regs, I think we get into endianness
> > > > trouble when the ethernet output logic treats the content as a blob
> > > > (thus the need for byteswaps). Does that make sense?
> > >
> > > As a concrete question: if I do a 32-bit load from the buffer
> > > register into a CPU register, do I get a different value
> > > on the BE microblaze hardware vs LE microblaze ?
> >
> > Yes, I beleive so.
> >
> > If the CPU stores the value and reads it back, you get the same. But
> > the representation on the RAM's is different between LE/BE.
> > But if the Ethernet logic writes Ethernet packet data into the buffer,
> > LE and BE MicroBlazes will read differient values from the buffers.
> > These buffer "registers" are just RAM's I beleive.
>
> Thanks. That suggests that the current code for this device
> is correct, and we would be breaking it on the LE platform
> if we applied this patch.
>
> I don't suppose you have a guest image for the boards which
> uses ethernet ?
Yes, I do, both little and big endian with ethlite working. Do you have a suggestion where to upload?
Best regards,
Edgar
next prev parent reply other threads:[~2022-12-13 15:41 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 12:52 [RFC PATCH-for-8.0 0/3] hw/ppc: Remove tswap() calls Philippe Mathieu-Daudé
2022-12-13 12:52 ` [RFC PATCH-for-8.0 1/3] hw/ppc: Replace tswap32() by const_le32() Philippe Mathieu-Daudé
2022-12-13 16:00 ` Richard Henderson
2022-12-13 16:10 ` Philippe Mathieu-Daudé
2022-12-13 16:14 ` Richard Henderson
2022-12-13 16:21 ` Peter Maydell
2022-12-13 16:27 ` Richard Henderson
2022-12-13 16:53 ` Cédric Le Goater
2022-12-13 17:23 ` Peter Maydell
2022-12-13 17:51 ` Edgar E. Iglesias
2022-12-13 18:09 ` BALATON Zoltan
2022-12-13 21:37 ` Peter Maydell
2022-12-13 18:13 ` Cédric Le Goater
2023-05-17 10:51 ` Thomas Huth
2022-12-13 12:52 ` [RFC PATCH-for-8.0 2/3] hw/ppc/spapr: Replace tswap64(HPTE) by cpu_to_be64(HPTE) Philippe Mathieu-Daudé
2022-12-13 13:51 ` Peter Maydell
2022-12-16 19:10 ` Daniel Henrique Barboza
2022-12-16 21:39 ` Peter Maydell
2022-12-19 6:31 ` David Gibson
2022-12-19 10:39 ` Peter Maydell
2022-12-21 1:16 ` David Gibson
2022-12-21 12:33 ` Peter Maydell
2022-12-21 16:03 ` Cédric Le Goater
2022-12-21 22:15 ` Peter Maydell
2022-12-22 1:56 ` David Gibson
2022-12-13 12:52 ` [RFC PATCH-for-8.0 3/3] hw/net/xilinx_ethlite: Replace tswap32() by be32_to_cpu() Philippe Mathieu-Daudé
2022-12-13 13:53 ` Peter Maydell
2022-12-13 13:54 ` Edgar E. Iglesias
2022-12-13 14:18 ` Peter Maydell
2022-12-13 14:23 ` Edgar E. Iglesias
2022-12-13 15:22 ` Peter Maydell
2022-12-13 15:41 ` Edgar E. Iglesias [this message]
2024-04-22 12:46 ` Philippe Mathieu-Daudé
2022-12-13 16:56 ` [RFC PATCH-for-8.0 0/3] hw/ppc: Remove tswap() calls Cédric Le Goater
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=Y5idRFBkHSXIdnCM@toto \
--to=edgar.iglesias@gmail.com \
--cc=alex.bennee@linaro.org \
--cc=alistair@alistair23.me \
--cc=balaton@eik.bme.hu \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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 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.