From owner-p4-projects@FreeBSD.ORG Wed Feb 4 16:33:09 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A2CC81065678; Wed, 4 Feb 2009 16:33:09 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5877A1065674 for ; Wed, 4 Feb 2009 16:33:09 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from pele.citylink.co.nz (pele.citylink.co.nz [202.8.44.226]) by mx1.freebsd.org (Postfix) with ESMTP id 173498FC1B for ; Wed, 4 Feb 2009 16:33:08 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from localhost (localhost [127.0.0.1]) by pele.citylink.co.nz (Postfix) with ESMTP id 9B423FFAC; Thu, 5 Feb 2009 05:00:11 +1300 (NZDT) X-Virus-Scanned: Debian amavisd-new at citylink.co.nz Received: from pele.citylink.co.nz ([127.0.0.1]) by localhost (pele.citylink.co.nz [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id P0qUJdX3-x2O; Thu, 5 Feb 2009 05:00:06 +1300 (NZDT) Received: from citylink.fud.org.nz (unknown [202.8.44.45]) by pele.citylink.co.nz (Postfix) with ESMTP; Thu, 5 Feb 2009 05:00:06 +1300 (NZDT) Received: by citylink.fud.org.nz (Postfix, from userid 1001) id ACEC61142B; Thu, 5 Feb 2009 05:00:05 +1300 (NZDT) Date: Wed, 4 Feb 2009 08:00:05 -0800 From: Andrew Thompson To: Hans Petter Selasky Message-ID: <20090204160005.GB77595@citylink.fud.org.nz> References: <200902041242.n14CgXj2014958@repoman.freebsd.org> <200902041459.35445.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200902041459.35445.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: Perforce Change Reviews , Weongyo Jeong Subject: Re: PERFORCE change 157132 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Feb 2009 16:33:11 -0000 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