Re: problem with NdisReturnPackets ( )
- From: "Stephan Wolf [MVP]" <stewo68@xxxxxxxxxxx>
- Date: 25 Apr 2005 23:08:55 -0700
Steve wrote:
> If you queue the packets then you must alloc and copy the
> payload.
This is not required. You can queue original packets until their
payload is no longer in use by the IM. You can also use the original
NDIS_PACKET descriptor if you use packet stacking.
Without packet stacking, a new NDIS_PACKET descriptor (allocated by the
IM) must be used. But its NDIS_BUFFER list can be the same as the one
used by the original NDIS_PACKET.
IIRC, PASSTHRU does exactly this, i.e. it does not copy the payload
*unless* it needs to *modify* the payload.
That is, the original payload must not, under no circumstances, be
modified. It is read-only to the IM. But you can have your own
NDIS_BUFFER list that points to your own payload, e.g. the MAC header.
Then use your own NDIS_BUFFER (or buffers) to point the original
payload. This way, parts of the original payload can be replaced
without having to copy the actual payload data.
> The passthru example just allocs and copies the
> packet descriptor and sets the desriptor to point to the
> payload in the original packet descriptor.
Yup.
> My quess (and
> I mean guess) is that the payload is being freed by the
> NIC (receive) while the copied packet is still in your
> queue.
How can the NIC free any NDIS_PACKET, NDIS_BUFFER, or payload before
the NDIS_PACKET is being returned to it? That would be a programming
fault and I seriously doubt it since the OP says he sees the problem in
more tha one configuration (ie.e with different miniport drivers).
Also, the NDIS Test tool (see my article at
http://www.microsoft.com/whdc/resources/mvp/SW-MVP.mspx) would for sure
detect such misbehaviour.
Stephan
.
- Follow-Ups:
- Re: problem with NdisReturnPackets ( )
- From: serge
- Re: problem with NdisReturnPackets ( )
- References:
- problem with NdisReturnPackets ( )
- From: serge
- problem with NdisReturnPackets ( )
- From: Steve
- problem with NdisReturnPackets ( )
- Prev by Date: Re: Bill Gates Keynote from WinHEC 2005 - April 25th, 2005
- Next by Date: Re: Simple Application
- Previous by thread: problem with NdisReturnPackets ( )
- Next by thread: Re: problem with NdisReturnPackets ( )
- Index(es):
Relevant Pages
|