Re: Padding ethernet packet (net buffer list) with NdisRetreatNetBufferDataStart !? by Alireza
Alireza
Tue Mar 13 23:48:52 CDT 2007
Retreat gives you space -before- the start of the packet and not after which
is what you need if you want to -pad- the packet (potentially to meet the
requirements for the minimum size of Ethernet packets). Assuming this is
what you want to do and your hardware does not take care of it for you, I
suggest you copy short packets to pre-allocated shared memory (you can use
single linked list and push/pop operation for better performance).
Performance-wise you lose a little bit to pop a buffer and copy the data but
you gain some back due to the fact that you already have the physical
address of the pre-allocated shared memory and you don't need to make NDIS
calls to get that.
Back to your question, NDIS does -not- initialize the memory made available
by retreat operation so it is not zeroed out.
-ali
--
This posting is provided "AS IS" with no warranties, and confers no rights.
"ria" <shwetaahuja.dce@gmail.com> wrote in message
news:1173770061.364683.44280@n33g2000cwc.googlegroups.com...
> Hi,
>
> I m padding ethernet packet (= net buffer list) to make it 64B long.
> If I use NdisRetreatNetBufferDataStart then the data space allocated
> in net buffer list will be filled up with zeros?
>
> Please reconfirm..
> Thanks a ton in advance!
> Shweta
>