Can't get correct packet during Receive NetBuffer list function

I am testing driver for HLK certification and during this test , i am trying to implement the 802.1p tagging .

I am trying to capture 802.1 p information over filter driver sendnetBufferList . When HLK run the test , i can able to see the 802.1 p values in supported device .

I am printing these values by ,

NDIS_NET_BUFFER_LIST_8021Q_INFO NdisPacket8021qInfo;
NdisPacket8021qInfo.Value = NET_BUFFER_LIST_INFO(NetBufferList, Ieee8021QNetBufferListInfo);

printing === > NdisPacket8021qInfo.TagHeader.UserPriority

I can see in debug logs when HLK run the 2c_priority test :

NdisPacket8021qInfo.TagHeader.UserPriority = 1
NdisPacket8021qInfo.TagHeader.UserPriority = 5
NdisPacket8021qInfo.TagHeader.UserPriority = 5
NdisPacket8021qInfo.TagHeader.UserPriority = 4
NdisPacket8021qInfo.TagHeader.UserPriority = 5
NdisPacket8021qInfo.TagHeader.UserPriority = 6


etc… up to 100 packets

But i am not adding this values to Ethernet frame manually in code .

So Next , during the HLK test , i tried to print the same values in receive Netbuffe List side . But i didn’t get any priority packets . I also tried to get TPID . I didn’t .

NdisPacket8021qInfo.TagHeader.UserPriority = 0

So my doubts are :

1 . Should HLK Send this packets with priority values directly to Ethernet frame with TPID ? Or should i insert these values inside the Ethernet header manually in code ?

2 . If it is manually , How can i modify the NetBufferList . That means , how can i add more memory to the NET_BUFFER with Allocate Space for Ethernet , VLAN tag header and Netbuffer context ? Any samples link available ?

> Or should i insert these values inside the Ethernet header manually
in code ?

This depends on capability of your underlying physical driver. If it supports “out-of-band” 8021q info, you can pass it down in the NET_BUFFER_LIST_INFO. If that driver is “dumb”, you’ll need to append the tag manually to the L2 header. (If I remember correctly, NDIS6 now requires support for out-of-band info, so try this first, you may be lucky). Again, I don’t remember what is your physical medium. If it is not plain ethernet, the physical miniport can convert the .1q info into something else (not the VLAN tag), but then on receive path it must translate it back to original priority & VLAN values, which you receive in NET_BUFFER_LIST_INFO and pass up to ndistest.

– pa

Thanks for suggestion @Pavel A .

I am setting physical medium as NdisPhysicalMediumUnspecified .

ndisMiniportAdapterGeneralAttributes.MediaType = NdisMedium802_3;
ndisMiniportAdapterGeneralAttributes.PhysicalMediumType = NdisPhysicalMediumUnspecified;

But i analyzed NET_BUFFER_LIST_INFO in receive side of filter driver . I didn’t get any values . I think that is why the test failed . mu virtual driver is dummy . So i am handling on filter driver send and receive side .

I didn’t understand the “out-of-band” 8021q info . Can you explain little bit .

also how to check whether it supports “out-of-band” 8021q info ?

Hi Vinay,

By “out of band” I mean that the priority bits are not contained in the network packet data of an NB (NBL) but passed in NET_BUFFER_LIST_INFO.

As documented here:
https://msdn.microsoft.com/en-us/library/windows/hardware/ff569597

See also the comments for handling this in the netvmini sample:

https://github.com/Microsoft/Windows-driver-samples/blob/master/network/ndis/netvmini/6x/mphal.c

near line 848.

Regards,
– pa

This is what exactly i am doing :

HLK will add the priority tags when it send packets . So i don’t want add any stuffs inside NET_BUFFER_LIST . Isn’t ?

Now i can see priority values whenever query

NET_BUFFER_LIST_INFO(Netbufferlist , Ieee8021QNetBufferListInf??o) in Send path .

But when In receiving side, i just check same info whether this priority present or not in the packet using NET_BUFFER_LIST_INFO value . But i am getting zero values . Why it happens ? Because i am getting values when send NET_BUFFER_LIST and not getting any values when receive . Any suggestions ?

I didn’t add priority header manually inside ethernet frame . I just check only NET_BUFFER_LIST_INFO values is present or not . This is correct approach ? Any suggestions ?