Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Dec 2006 22:53:01 -0800
From:      John-Mark Gurney <gurney_j@resnet.uoregon.edu>
To:        tanniru.sankar@wipro.com
Cc:        freebsd-net@freebsd.org
Subject:   Re: ' bus_dmamap_load_mbuf_sg ( ) ' function usage problem
Message-ID:  <20061229065300.GD817@funkthat.com>
In-Reply-To: <8B9F8433B684734581EB519F1A3E5AF43D88A5@blr-m3-msg.wipro.com>
References:  <8B9F8433B684734581EB519F1A3E5AF43D88A5@blr-m3-msg.wipro.com>

next in thread | previous in thread | raw e-mail | index | archive | help
tanniru.sankar@wipro.com wrote this message on Fri, Dec 29, 2006 at 12:13 +0530:
>        Is it possible to allocate contigous memory of MJUM9BYTES ( 9K )
> and  dmamap_load in one segment ? 

You can use bus_dmamem_alloc, which will use contigmalloc to allocate
the necessary memory...  You can then attach your own mbuf to the
memory...  Allocating contigous memory is an expensive operation...

If the card doesn't support sg, you'll probably get better performance
by not doing jumbo frames...

> -----Original Message-----
> From: John-Mark Gurney [mailto:gurney_j@resnet.uoregon.edu] 
> Sent: Tuesday, December 19, 2006 2:19 AM
> To: Tanniru Sankar (WT01 - Computing Systems & Storage)
> Cc: freebsd-net@freebsd.org
> Subject: Re: ' bus_dmamap_load_mbuf_sg ( ) ' function usage problem
> 
> tanniru.sankar@wipro.com wrote this message on Mon, Dec 18, 2006 at
> 20:05 +0530:
> >    I am facing a problem on FreeBSD 7.0 during mapping using '
> > bus_dmamap_load_mbuf_sg ( ) ' function .
> >    Details are below.
> >  
> >    It is AMD 64 bit machine. I have allocated jumbo buffer memory 
> > using ' m_getcl ' function.
> >  
> >        mp = m_getjcl(M_DONTWAIT, MT_DATA, M_PKTHDR,  MJUM9BYTES);
> >  
> >     As it got success here, I am trying to map the buffer as below.
> >         
> >        err = bus_dmamap_load_mbuf_sg(dma_tag_rx, map, mp, &seg, &cnt, 
> > BUS_DMA_NOWAIT);
> >         
> >       Here it is getting error for the mbuf size equal to  MJUM9BYTES.
> > The type of error is ' EFBIG  '.
> >    
> >     I have create  rx jumbo dma tag with attributes as following.
> 
> [...]
> 
> >         MJUM9BYTES,       /* Maximum Size              */
> > 
> >         1 ,                           /* Number of Segments        */
> > 
> >         MJUM9BYTES,       /* Maximum Segment Size      */
> 
> This is probably the problem...  Most likely the buffer is
> non-contiguous in memory, and needs 3 segments to satisfy the mapping...
> Try increasing the number of segments and see what happens...

-- 
  John-Mark Gurney				Voice: +1 415 225 5579

     "All that I will do, has been done, All that I have, has not."



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