Messages in this thread | | | From | kuznet@ms2 ... | Subject | Re: CONFIG_PACKET_MMAP help | Date | Fri, 20 Apr 2001 20:03:28 +0400 (MSK DST) |
| |
Hello!
> 1. for tp_frame_size, I dont want to truncate any data on ethernet, I > need 1514 bytes, is this the best way to do it and not waste space?
To select small snapsize (obtained from later experiments), to set PACKET_COPY_THRESH to read larger packets via recvmsg().
> 2. what is tp_block_nr for? I dont understand it, I just set it to 1 > and make tp_block_size big enough for all the frames I need, so its > just one contiguous space, all I need is about a megabyte I think.
Kernel has problems with allocating large chunks of memory. If you see problems with allocating large chuns, split them to less ones.
> while(1) { > if (tp->status == 0) poll() for pollin on the socket /* is there a > race here? */
No. poll returns, when new frame appears.
> 4. what does the copy threshold setsockopt tuning accomplish? doesnt it always > have to copy anyway, to the mmaped area?
see anser to question 1. It has a sense when size of chunk is small enough. Small packets are copied to ring, large ones (which are truncated) are queued to socket to be received via recvmsg().
Alexey - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |