From: Ramon Fried <rfried.dev@gmail.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
qemu-trivial@nongnu.org,
Alistair Francis <alistair@alistair23.me>,
qemu-devel@nongnu.org,
"open list:Xilinx Zynq" <qemu-arm@nongnu.org>,
"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Subject: Re: [Qemu-devel] [PATCH] net: cadence_gem: clear RX control descriptor
Date: Tue, 16 Jul 2019 14:01:33 +0300 [thread overview]
Message-ID: <CAGi-RUJPD+q8sCbRfffM2bxc7deLNY4Ewg0AOdkMKfJGQs95Aw@mail.gmail.com> (raw)
In-Reply-To: <555fb9b5-361f-fc3f-ff35-38b993a29edd@redhat.com>
On Tue, Jul 16, 2019 at 11:42 AM Jason Wang <jasowang@redhat.com> wrote:
>
>
> On 2019/6/15 下午1:17, Ramon Fried wrote:
> > The RX ring descriptors control field is used for setting
> > SOF and EOF (start of frame and end of frame).
> > The SOF and EOF weren't cleared from the previous descriptors,
> > causing inconsistencies in ring buffer.
> > Fix that by clearing the control field of every descriptors we're
> > processing.
> >
> > Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
> > ---
> > hw/net/cadence_gem.c | 7 +++++++
> > 1 file changed, 7 insertions(+)
> >
> > diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
> > index ecee22525c..d83a82bdb0 100644
> > --- a/hw/net/cadence_gem.c
> > +++ b/hw/net/cadence_gem.c
> > @@ -406,6 +406,11 @@ static inline void rx_desc_set_sof(uint32_t *desc)
> > desc[1] |= DESC_1_RX_SOF;
> > }
> >
> > +static inline void rx_desc_clear(uint32_t *desc)
>
>
> Nit: is this better to name this as "rx_desc_clear_control()" ?
I agree, sent v2.
>
> Thanks
>
>
> > +{
> > + desc[1] = 0;
> > +}
> > +
> > static inline void rx_desc_set_eof(uint32_t *desc)
> > {
> > desc[1] |= DESC_1_RX_EOF;
> > @@ -994,6 +999,8 @@ static ssize_t gem_receive(NetClientState *nc, const uint8_t *buf, size_t size)
> > bytes_to_copy -= MIN(bytes_to_copy, rxbufsize);
> >
> > /* Update the descriptor. */
> > + rx_desc_clear(s->rx_desc[q]);
> > +
> > if (first_desc) {
> > rx_desc_set_sof(s->rx_desc[q]);
> > first_desc = false;
>
>
>
prev parent reply other threads:[~2019-07-16 11:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-15 5:17 [Qemu-devel] [PATCH] net: cadence_gem: clear RX control descriptor Ramon Fried
2019-07-16 7:11 ` Ramon Fried
2019-07-16 7:19 ` Philippe Mathieu-Daudé
2019-07-16 11:01 ` Ramon Fried
2019-07-16 8:42 ` Jason Wang
2019-07-16 11:01 ` Ramon Fried [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=CAGi-RUJPD+q8sCbRfffM2bxc7deLNY4Ewg0AOdkMKfJGQs95Aw@mail.gmail.com \
--to=rfried.dev@gmail.com \
--cc=alistair@alistair23.me \
--cc=edgar.iglesias@gmail.com \
--cc=jasowang@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@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).