Re: CONFIG_PACKET_MMAP revisited

From: P
Date: Thu Nov 06 2003 - 10:33:09 EST


Gianni Tedesco wrote:
On Thu, 2003-11-06 at 15:13, Oliver Dain wrote:

It seems to me that it can't loop in user mode forever. There is no way to get data into user mode (the ring buffer) witout going through the kernel. My understanding is that the NIC doesn't transfer directly to the user mode ring buffer, but rather to a different DMA buffer. The kernel must copy it from the DMA buffer to the ring buffer. Thus once the user mode app has processed all the data in the ring buffer the kenel _must_ get involved to get more data to user space. Currently the data gets there because the NIC produces an interrupt for each packet (or for every few packets) and when the kernel handles these the data is copied to user space. Then, as you point out, the cost of the RETI can't be avoided.


yes, in interrupt context. My point is that that *task* will never go in
to kernel mode, it will always be running in user mode.

In my experience (PIII 1.2GHz, i815, e100, NAPI), user mode
would read at most 7 packets at a time, even when artificial
busy loops insterted. The max packet rate acheived was
around 120Kpps, but that was limited at the driver level.
Most of the CPU was consumed while doing this (measured with
cyclesoak, especially required since NAPI was used).

Pádraig.

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