* Robert Lipe <[EMAIL PROTECTED]> [010122 12:50] wrote:
> Alfred Perlstein wrote:
> 
> > > So if I sandbagged the allocs to be *larger* the KMA would behave more
> > > consistently with what I'd expect becuase it would then reclaim?  I
> > > didn't see that one coming. :-)
> > 
> > but... this is a terrible workaround, I'm not sure it would work
> > and you shouldn't do it. :)
> 
> Good.  I didn't actully *want* to do that.  I still have to respect
> myself in the morning. :-)
> 
> > > Is there an s/g memory interface in FreeBSD?  This was my first choice,
> > 
> > See the busdma stuff, 
> 
> Yes, this looks to be much closer to the interface I really wanted
> anyway.  I see no man pages for them.  Is there any doc anywhere?  "Read
> the source and look at existing examples" will do if it must but any
> pointers to better doc are appreciated.

I know of no docs, I don't write drivers. (lucky me)

> > there's a problem because there's no busdma
> > for mbufs (well actually there is but it fails on really small
> > unaligned blocks which basically breaks it for mbufs).  
> 
> Can you tell me more about this hazard?  I can't control the alignment
> that's asked for by the driver, but I can certainly fudge the size and
> alignment of the request by the time it gets to this interface.  Just
> tell me the rules. :-)

I don't know, Bill Paul explained that the normal busdma stuff is
pretty broken for chunks too small.  Basically, disks work, network
cards won't because mbufs are too small.

> > ack, I'd review patches if you wanted to write/port busdma for mbufs..
> 
> Thanx for the offer, but I'm hoping to avoid that right now.
> 
> It's very much a goal of mine (esp. now that we're in the final days
> of the NDA requirement) to stamp out something that works on shipping
> FreeBSD well enough for this crowd to see what remains to be done and
> see where we are.  Then we can figure out how to improve interfaces or
> otherwise enhance the base OS if we want to.  So given a choice between,
> say, incurring an extra copy in a data path and porting busdma for mbufs
> I'll take the former for now. 

With mbufs you're stuck.  I have some code that needs to send > PAGE_SIZE
chunks of data down the network stack, my current "hack" is that I
prebuild the mbuf packets and split them on page boundries, then just
call m_copym on the chain, but I doubt that'll help you.

-- 
-Alfred Perlstein - [[EMAIL PROTECTED]|[EMAIL PROTECTED]]
"I have the heart of a child; I keep it in a jar on my desk."


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to