From: Erik Waling <erik.waling@konftel.se>
To: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
Cc: Erik Waling <Erik.Waling@konftel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] macb: RLE and BNA handling
Date: Wed, 14 Jan 2009 11:27:47 +0100 [thread overview]
Message-ID: <1231928868.10152.31.camel@konftel> (raw)
In-Reply-To: <20090114111505.48d34949@hskinnemoen-d830>
See comments below...
On Wed, 2009-01-14 at 11:15 +0100, Haavard Skinnemoen wrote:
> Erik Waling wrote:
> > This patch (against 2.6.28) solves two issues we have been experiencing
> > when connecting the EMAC module on our AT91SAM9260 board to an ethernet
> > repeater hub. When transfering large amounts of data we sometimes
> > experienced that the Retry Limit Exceeded (RLE) bit got set in TSR
> > during transmission attempts. When this happened the driver would stall
> > in a state that prevented any more data from being sent.
>
> Right. This part of your patch looks good...
>
> > The other issue experienced was in the RX part of the driver. Sometimes
> > the driver runs out of unused slots in the RX ring buffer. All slots
> > will be filled with data but the driver is not able to extract a
> > complete frame from the fragments in the buffer. When this happens the
> > Buffer Not Available (BNA) bit is set in RSR.
>
> This part also looks like a real problem, however...
>
> > @@ -527,18 +529,31 @@ static int macb_poll(struct napi_struct
> > dev_dbg(&bp->pdev->dev, "poll: status = %08lx, budget = %d\n",
> > (unsigned long)status, budget);
> >
> > - if (!(status & MACB_BIT(REC))) {
> > + if (status & MACB_BIT(REC)) {
> > + work_done = macb_rx(bp, budget);
> > + if (work_done < budget)
> > + netif_rx_complete(dev, napi);
> > + } else if (status & MACB_BIT(BNA)) {
> > + /* No slots available in RX ring. Mark all slots
> > + * as unused.
> > + */
> > + int i;
> > +
> > + dev_warn(&bp->pdev->dev,
> > + "No free RX buffers. Marking all as unused.\n");
> > +
> > + for (i = 0; i < RX_RING_SIZE; i++)
> > + bp->rx_ring[i].addr &= ~MACB_BIT(RX_USED);
> > +
> > + wmb();
> > + netif_rx_complete(dev, napi);
>
> I'm not sure if nuking all the buffers that were received successfully
> is the right thing to do here...?
>
This was the only solution I could think of since all slots are marked
as used and we are not able to assemble a complete frame. Do you think
there is a better solution?
> > + } else if (!(status & MACB_BIT(REC))) {
>
> This should probably be just "else", since you checked the REC bit
> above.
You are right. That is probably more correct.
> Haavard
Erik
next prev parent reply other threads:[~2009-01-14 10:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-13 16:21 [PATCH] macb: RLE and BNA handling Erik Waling
2009-01-14 7:47 ` Erik Waling
2009-01-14 10:15 ` Haavard Skinnemoen
2009-01-14 10:27 ` Erik Waling [this message]
2009-01-14 12:03 ` Haavard Skinnemoen
2009-01-15 13:37 ` Erik Waling
2009-03-26 9:38 ` Erik Waling
2009-03-30 12:04 ` Haavard Skinnemoen
2009-03-31 14:50 ` Erik Waling
2009-04-01 9:31 ` Haavard Skinnemoen
2009-04-01 13:05 ` Erik Waling
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=1231928868.10152.31.camel@konftel \
--to=erik.waling@konftel.se \
--cc=Erik.Waling@konftel.com \
--cc=haavard.skinnemoen@atmel.com \
--cc=linux-kernel@vger.kernel.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