What percent of NBLs are vanishing? What is the pattern – is it one at a time, with random intervals, or does it seem to be busrty? Is any other event correlated with the problem?
NetBufferListFrameType is not such a big deal if you’re a regular 802.3 miniport; NDIS knows how to read the frametype out of the Ethernet header (or SNAP header). It will use the value it finds to match against your protocol’s FrameTypeArray. In order for NDIS to deliver the packet to you, these requirements must be met:
- Your protocol must have opened the adapter, and the open must be in Running state.
- The FrameTypeArray is empty, or it contains an entry that matches the NB’s ethertype.
- The packet filter (OID_GEN_CURRENT_PACKET_FILTER) permits the destination address (unicast, multicast, etc.)
- The packet wasn’t dropped by some LWF.
In order to read the ethertype, NDIS needs to map the packet’s Ethernet header into system VA. Normally, miniports indicate packets that are pre-mapped, but if not, NDIS needs to allocate the VA. This can fail if the system is critically low on VA, and NDIS just drops the packet. In practice, this is not an issue, because most miniports pre-map their receive packets (actually, they are just sliced out of a single common buffer); and even then, VA is rarely so scarce that we can’t allocate a few bytes for the packet header. But for completeness, I’ll mention this too.
It’s not legal for one protocol to somehow mess up the NBL chain for your protocol. NDIS is implemented in such a way that this would be difficult to do: if two protocols would receive the same NBLs, then NDIS sets NDIS_RECEIVE_FLAGS_RESOURCES on the indications. Then the protocol really isn’t supposed to unlink NBLs from the chain, so it’s unlikely that any protocol is doing this.
(That’s not to say it’s impossible for one protocol to break the rules and hide an NBL from you… but it seems unlikely).
Check that your protocol isn’t getting paused – this easy to check with a quick breakpoint, so I’d check this first. You will not get packets while you’re paused.
The next thing I’d do is instrument the protocol and miniport to add NBL counters. Just before calling NdisMIndicateReceiveNetBufferLists, and immediately as soon as NDIS calls ProtocolReceiveNetBufferLists. If the counters match, then you might have a bug in your protocol driver.
-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@yahoo.com
Sent: Wednesday, March 30, 2011 7:13 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Not receiving (subscribed ethertype) NBL in protocol driver(evn aft miniport_indicate
All
I have a NDIS6x miniport and my protocol driver.
I see my miniport doing NdisMIndicateReceiveNBLs() to NDIS.
But I do not see that NBL in my protocol. I see that NBL is Wireshark (a protocol driver)? The NBL in question is random, i.e I cannot deterministaicaly break on that NBL in my miniport.
How do I debug this ?
For now I am looking at NDIS tracing ‘recv’ component to see if it helps.
I will know I did not receive the NBL after an internal timeout (ofcourse).
Any ways to debug this.
I disabled all protocols attached to my miniport except my protocol. under that condition I do not see the issue.
My hypothesis
NDIS indicated the NBL to one of the protocol.
Either
- That protocol somehow messed up the NBL chain or
- For some reason NDIS decided it doesn’t have to pass that ether_type NBL to me.
Above are bit drsastic at this stage, so wondering if there are any other reasons this could happen or ways to debug.
I specifically subsribe to the ether types I need (in NDIS_OPEN_PARAMETERS.FrameTypeArray etc). My miniport (in some conditions) doesn’t set the NET_BUFFER_LIST_INFO(,NetBufferListFrameType).
I do not knwo how NDIS decides to indicate what pkts to what protocols, I mean does NDIS always does a deep header check to figure out ether_type and pass it up efficiently to only interested protocol drivers. Becuase soem protocosl might not bother to set the OOB[ether_type]?
Basically my test is, traffic is going on and link pulls are happening, and my protocol seem to not get indicatd on some pkts randomaly at random intervals.
NTDEV is sponsored by OSR
For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars
To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer