All of lore.kernel.org
 help / color / mirror / Atom feed
From: Joshua Wise <Joshua.Wise@sicortex.com>
To: linux-kernel@vger.kernel.org
Cc: Aaron Brooks <aaron.brooks@sicortex.com>
Subject: NAPI poll routine happens in interrupt context?
Date: Wed, 17 Aug 2005 09:32:10 -0400	[thread overview]
Message-ID: <200508170932.10441.Joshua.Wise@sicortex.com> (raw)

Hello LKML,

I have recently been working on a network driver for an emulated ultra-simple 
network card, and I've run into a few snags with the NAPI. My current issue 
is that it seems to me that my poll routine is being called from an atomic 
context, so when poll calls rx, and rx calls netif_receive_skb, I end up with 
lots of __might_sleep warnings in the various network layers.

This is not so good. I need every cycle I can get, as this emulator is 
incredibly slow, so burning cycles by printing out the reported badness is 
not really acceptible. Conceivably the badness itself is also an issue.

Before posting here, I did search Google for "lkml napi poll interrupt", 
although I did not find anything relevant to my issue.

If interested, the code is available at http://joshuawise.com/lanlan.c . Some 
notes:

The virtual lan-lan is a very very simple device. It consists of an ioreg that 
maintains state of the device, as described by the ioreg bit defines. It also 
has an ioctlreg that can pass through ioctls to the Linux kernel tap device 
that it's sitting on top of. (This goes with the ifreq seen in the struct.) 
One must always write and read in word-aligned chunks to and from it, for 
simplicity's sake.

Feel free to suggest any modifications that this device might need to make it 
more fully functional. Hopefully we can bring this driver to such a state 
where it will be usable as a replacement skeleton driver for the NAPI.

Please cc: Aaron and myself, as neither of us are subscribed to lkml.

Thanks in advance,
joshua

             reply	other threads:[~2005-08-17 13:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-17 13:32 Joshua Wise [this message]
2005-08-17 14:19 ` NAPI poll routine happens in interrupt context? Joshua Wise
2005-08-17 16:43 ` Stephen Hemminger
2005-08-17 17:21   ` Joshua Wise
2005-08-17 18:18     ` Ralf Baechle
2005-08-17 18:34 ` David S. Miller

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=200508170932.10441.Joshua.Wise@sicortex.com \
    --to=joshua.wise@sicortex.com \
    --cc=aaron.brooks@sicortex.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 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.