Robert Olsson a écrit :
David S. Miller writes:

 > For the host bound case, copybreak is always a way due to how
 > socket buffer accounting works.  If you use a 1500 byte SKB for
 > 64 bytes of data, this throws off all of the socket buffer
 > accounting because you're consuming more of the socket limit
 > per byte of data than necessary.


 After some sleep... I think copybreak is a bit misplaced.

 Why not remove copybreak from the drivers and do eventual copybreak after we
 have looked up the packet. This way we can get copybreak for all drivers and
 we can do this only for packets with has destination to localhost and ignore
 the forwarding packets.

This will lead to an extra alloc in case of copybreak but it could possible to avoid this with some function giving copybreak feedback to driver i.e via
 netif_receive_skb_cpybrk() which tells driver if skb is consumed or not.

One problem is that some drivers have optimized copybreak : Because the NIC can recycle the buffer, I believe some costly operations can be avoided.

If you let the copybreak being done deeper in the stack, then the interrupt handler must refill the rx rings without optimizations (ie entering skb_alloc()/skb_free()).

But the idea is interesting, because if the NIC driver already done the copybreak stuff because eventual hardware optimization, then the stack probably wont redo the job since the skb should have the exact size.

Eric
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to