PERFORCE change 157132 for review

Andrew Thompson thompsa at FreeBSD.org
Wed Feb 4 08:33:11 PST 2009


On Wed, Feb 04, 2009 at 02:59:35PM +0100, Hans Petter Selasky wrote:
> On Wednesday 04 February 2009, Weongyo Jeong wrote:
> > ????????bzero(desc, sizeof(struct uath_tx_desc));
> > ????????desc->msglen = htobe32(sizeof(struct uath_tx_desc));
> > -???????desc->msgid ?= data_idx + 1;????/* don't care about endianness */
> > +???????desc->msgid ?= (sc->sc_msgid++) + 1;????/* don't care about
> > endianness */ desc->type ? = htobe32(WDCMSG_FLUSH);
> > ????????desc->txqid ?= htobe32(0);
> > ????????desc->connid = htobe32(0);
> 
> Why not allocate an mbuf to hold the "descriptor" data. Then you use the 
> m_next field of the header mbuf to link with the "data" mbuf ? Then you only 
> need one [mbuf] queue for TX ? You can look at if_ural2.c and if_rum2.c 
> in /sys/dev/usb2/wlan .

Because uath_data+uath_tx_desc is preallocated so you do not have to
malloc in the TX path. Grabbing a mbuf could fail due to low memory.


Andrew


More information about the p4-projects mailing list