NAPI poll routine happens in interrupt context?

From: Joshua Wise
Date: Wed Aug 17 2005 - 08:34:33 EST


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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/