Network device driver Question

From: John Newlin
Date: Wed Nov 26 2003 - 11:58:24 EST


I'm working on a driver for a new device. This NIC is on-chip, and memory mapped.
It can DMA to/from any memory location.

I am trying to optimize the driver such that it there is no need to copy to/from sk_buff
in the send_packet and on packet receive.

The problem I have is with a CPU that has a writeback cache. When the send_packet
is called, the data in the sk_buff may be cached. In the driver I can allocate a page as
uncached and copy to that page, however I am trying to avoid unneeded copies.

For receive there is a similar problem. When I allocate the sk_buff I need to invalidate
the caches. That way after a new packet arrives a read from that memory location will
not hit in the cache and return incorrect data.

Is there some sanctioned way that will work on any architecture to cause a writeback
of the dcached based on a range of virtual addresses, and similiarly cause an invalidate?

Thanks,

-John Newlin
jnewlin@xxxxxxxxx


-
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/