From: James Chapman <jchapman@katalix.com>
To: Travis Stratman <tstratman@emacinc.com>
Cc: netdev@vger.kernel.org
Subject: Re: data received but not detected
Date: Sun, 22 Jun 2008 10:16:14 +0100 [thread overview]
Message-ID: <485E185E.1090807@katalix.com> (raw)
In-Reply-To: <1213915992.9245.71.camel@localhost.localdomain>
Travis Stratman wrote:
> I was able to do some more extensive testing today with the macb (atmel
> Eternet MAC controller) driver and noticed that the
> netif_rx_schedule_prep function is returning false at times in the
> interrupt handler. In the code below, the printk shows up during heavy
> traffic, though it only happens a handful of times. (The else block is
> code that I have added to the driver while debugging).
>
> if (status & MACB_RX_INT_FLAGS) {
> if (netif_rx_schedule_prep(dev)) {
> /*
> * There's no point taking any more interrupts
> * until we have processed the buffers
> */
> macb_writel(bp, IDR, MACB_RX_INT_FLAGS);
> dev_dbg(&bp->pdev->dev, "scheduling RX softirq\n");
> __netif_rx_schedule(dev);
> } else {
> printk(KERN_ERR "%s: Driver bug: interrupt while in polling mode\n", dev->name);
> /* disable interrupts */
> macb_writel(bp, IDR, MACB_RX_INT_FLAGS);
> }
> }
>
>>From what I can tell of this function, it should only return false if
> polling is already enabled for the interface (though I haven't looked
> much deeper than the inline for netif_rx_schedule_prep()).
>
> I went through the poll function, and actually rewrote the whole thing
> according to the guidelines in the NAPI documentation, and I can't see
> anyway for it to get out of poll with interrupts enabled without first
> removing itself from the polling list.
>
> Can someone who knows more about this give me some more insight into
> what might be happening here? I can post the poll function or a patch to
> macb.c if it would be helpful.
I looked at macb.c and can see that it uses napi only for rx work,
leaving tx interrupts enabled at all times. The interrupt handler reads
the device interrupt status when a tx interrupt happens and may find rx
bits also set. As a result, your netif_rx_schedule_prep() will sometimes
return false because napi might be already scheduled. The code you have
above (i.e. the "driver bug" case) is wrong.
The napi code in the in-tree version looks suspect because it seems to
enable rx interrupts unconditionally regardless of whether napi rx
processing is complete.
It might help to post a patch here showing all of your changes.
--
James Chapman
Katalix Systems Ltd
http://www.katalix.com
Catalysts for your Embedded Linux software development
next prev parent reply other threads:[~2008-06-22 9:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-17 22:08 data received but not detected Travis Stratman
2008-06-17 22:27 ` Stephen Hemminger
2008-06-17 22:40 ` Travis Stratman
2008-06-17 22:31 ` Ben Greear
2008-06-17 22:58 ` Travis Stratman
2008-06-17 23:45 ` Ben Greear
2008-06-19 22:53 ` Travis Stratman
2008-06-19 23:08 ` Ben Greear
2008-06-22 9:16 ` James Chapman [this message]
2008-07-07 21:56 ` Travis Stratman
2008-07-08 9:37 ` James Chapman
2008-07-15 20:46 ` Travis Stratman
2008-06-18 6:28 ` Evgeniy Polyakov
2008-06-19 23:10 ` Travis Stratman
[not found] ` <20080620060219.GA22784@2ka.mipt.ru>
2008-06-20 17:10 ` Travis Stratman
2008-06-20 17:25 ` Evgeniy Polyakov
2008-06-20 17:41 ` Travis Stratman
2008-06-20 17:54 ` Evgeniy Polyakov
2008-06-20 18:17 ` Travis Stratman
2008-06-20 18:23 ` Evgeniy Polyakov
2008-06-20 21:06 ` Travis Stratman
2008-06-21 7:12 ` Evgeniy Polyakov
2008-07-07 21:10 ` Travis Stratman
2008-07-07 21:25 ` Evgeniy Polyakov
2008-07-15 20:43 ` Travis Stratman
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=485E185E.1090807@katalix.com \
--to=jchapman@katalix.com \
--cc=netdev@vger.kernel.org \
--cc=tstratman@emacinc.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).