All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilya Repko <i.repko@syntacore.com>
To: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, <fea.wang@sifive.com>
Cc: Alistair Francis <alistair@alistair23.me>,
	Peter Maydell <peter.maydell@linaro.org>,
	Jason Wang <jasowang@redhat.com>,
	"open list:Xilinx Zynq" <qemu-arm@nongnu.org>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: Re: [PATCH] Revert "hw/net: Fix the transmission return size"
Date: Fri, 7 Nov 2025 12:03:23 +0300	[thread overview]
Message-ID: <da835a64878e9eae03c7fb8f79577fa2d5b762df.camel@syntacore.com> (raw)
In-Reply-To: <aQz0CiFKPCNbO76m@zapote>

Hi,

We encountered this issue with U-Boot driver. It implements a single RX
buffer, which gets resubmitted to s2mm once the network stack is done
handling a packet, so for a while the DMA engine has no buffers to
store incoming packets into, and that's why we're seeing AXI DMA data
push failures, which lead to packets duplicating and NetQueue growing
indefinitely.

Haven't really tested with Linux. What was the problem with the kernel
driver?

Ilya

On Thu, 2025-11-06 at 20:16 +0100, Edgar E. Iglesias wrote:
> On Thu, Nov 06, 2025 at 12:48:37PM +0300, Ilya Repko wrote:
> > This reverts commit 3a6d374b754b4b345195ff6846eeaffedc96a7c5.
> > 
> > During axienet_eth_rx_notify(), s->rxpos is modified to indicate
> > how much
> > data was pushed to AXI DMA. eth_rx() would then return this value.
> > If at 0, network subsystem would consider packet reception as
> > failed
> > and put the packet in a queue for later.
> > 
> > Before we attempt to push packet data to AXI DMA, the packet is
> > stored
> > in s->rxmem buffer. If an attempt to push data fails, we will
> > reattempt
> > to deliver it from s->rxmem buffer once s2mm stream gets a new
> > descriptor.
> > s->rxmem would not be overwritten by a subsequent eth_rx() call,
> > because
> > eth_can_rx() protects it in case it has any data at all. Leaving
> > the packet
> > in a NetQueue though effectively duplicates it.
> > 
> > Therefore, eth_rx() must indicate successful packet reception in
> > case
> > data push to AXI DMA fails.
> 
> Hi,
> 
> Adding Fea since we're reverting his patch, he may have some
> insights.
> 
> What you describe sounds reasonable but I think we've seen issues
> with
> both your version (the original one) and Fea's version.
> 
> What machine are you running? Are you running Linux guests?
> 
> Cheers,
> Edgar
> 
> 
> 
> 
> > 
> > Signed-off-by: Ilya Repko <i.repko@syntacore.com>
> > ---
> >  hw/net/xilinx_axienet.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/hw/net/xilinx_axienet.c b/hw/net/xilinx_axienet.c
> > index 31e7708082..101b3f260a 100644
> > --- a/hw/net/xilinx_axienet.c
> > +++ b/hw/net/xilinx_axienet.c
> > @@ -867,7 +867,7 @@ static ssize_t eth_rx(NetClientState *nc, const
> > uint8_t *buf, size_t size)
> >      axienet_eth_rx_notify(s);
> >  
> >      enet_update_irq(s);
> > -    return s->rxpos;
> > +    return size;
> >  }
> >  
> >  static size_t
> > -- 
> > 2.51.1
> > 


  reply	other threads:[~2025-11-07  9:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-06  9:48 [PATCH] Revert "hw/net: Fix the transmission return size" Ilya Repko
2025-11-06 19:16 ` Edgar E. Iglesias
2025-11-07  9:03   ` Ilya Repko [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-11-05 19:55 Ilya Repko

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=da835a64878e9eae03c7fb8f79577fa2d5b762df.camel@syntacore.com \
    --to=i.repko@syntacore.com \
    --cc=alistair@alistair23.me \
    --cc=edgar.iglesias@gmail.com \
    --cc=fea.wang@sifive.com \
    --cc=jasowang@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@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.