replaceOrCopyPacket() question
replaceOrCopyPacket() question
- Subject: replaceOrCopyPacket() question
- From: Michael Cashwell <email@hidden>
- Date: Mon, 27 Oct 2003 09:28:45 -0500
Greetings,
I've read the docs and done a cursory examination of the source but
thought I'd ask here in case someone "just knows" the answer.
I'm working on packet reception in an Ethernet driver and have
questions about replaceOrCopyPacket() and friends.
I originally allocate a set of packets large enough to hold an entire
received frames in one segment. This allows me to use mbufs almost
directly with the card's DMA hardware. As I understand it, when I get
back one of these buffers I need to determine its true logical length
and then call replaceOrCopyPacket() to handle what goes up the stack
and what is returned back to the DMA engine.
OK, so far.
But for efficiency I want to set the packet's m_pkthdr.len length [and
possibly the internal m_len member as well, I'm unsure here] before
calling that method. There's no way it can efficiently do its job if I
haven't supplied the logical length first.
Perhaps I'm suppose to leave the member fields alone and supply the
logical length only via the argument to replaceOrCopyPacket() and it
magically does what I need. That would be great, but the docs don't say
and I haven't taken the source apart enough to figure it out.
In any case, I'm worried about the packet I get back for reuse with the
DMA hardware not having the same attributes as what I originally
allocated. They need to have the same capacity and be single-segment
just like the original.
I could just punt and always allocate a new packet myself, but I'd like
to place nice and be efficient.
Any comments welcome.
Thanks,
Michael Cashwell
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.