Skip to contentSkip to conversation

Network device driver Question

DISCUSSION John Newlin 1 participant 1 message Nov 26, 2003

lore
Share & tools
lore
#0 lore raw

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
[email protected]