Subject: Re: CVS commit: src/sys/dev/ic
To: None <email@example.com>
From: Izumi Tsutsui <firstname.lastname@example.org>
Date: 11/15/2006 00:24:18
> > I wonder which is more efficient way to copy received buffer,
> > allocating a new mbuf, or moving data toward 2 bytes in the
> > same mbuf, which is used in vge(4).
> Maybe allocate a new mbuf, copy a "typical" amount of data (i.e.
> Ethernet header + IPv4 header + TCP/IP header + typical TCP options)
> into new mbuf (offset 2 bytes from beginning of mbuf), adjust the
> received packet past the data copied into the new mbuf, prepend the
> new mbuf onto the received packet.
Should some upper layer provide such function?
> Allocating mbufs is fairly cheap because of pool_cache. A lot cheaper
> than copying an entire packet (especially an overlapping copy like vge
Well, but for now most of our drivers which pad ETHER_ALIGN on RX
manually allocate a new mbuf (with a cluster if needed) and copy
entire each packet by memcpy(9), don't they? ;-p
The vge(4)'s method looks a bit faster than that.
(though maybe I should have more precise benchmarks)