Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Feb 2013 08:36:55 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Aman Sawrup <aman.sawrup@bluecoat.com>
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Insufficient memory reserved for xfer->dma_page_ptr?
Message-ID:  <201302200836.56015.hselasky@c2i.net>
In-Reply-To: <5123FC0B.70009@bluecoat.com>
References:  <1360360082956-5785167.post@n5.nabble.com> <201302090001.57258.hselasky@c2i.net> <5123FC0B.70009@bluecoat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 19 February 2013 23:26:19 Aman Sawrup wrote:
> I believe the amount of memory reserved needs to be much higher.  For 
> example, if sizeof(struct usb_page) is 16 bytes, then for n_frbuffers of 
> 128 and parm->bufsize of 131072, we need the following amount of memory 
> reserved:
> 
> parm->bufsize / USB_PAGE_SIZE * n_frbuffers * sizeof(struct usb_page)
> = 131072 / 4096 * 128 * 16
> = 65536

Hi,

The parm->bufsize is shared for all frbuffers, so the formula should be 
correct. In your computation you assume that parm->bufsize gives the maximum 
for each frbuffer. That is not the case.

That means, when you configure bufsize, you must not exceed that size as a 
total when setting up frames. This include all transfer types. I think there 
are asserts for that so you should get a panic fairly quickly.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302200836.56015.hselasky>