How to handle 802.1p tag on virtual Miniport driver ?

I am trying to pass 2c_priority test of HLK on virtual adapter . I have a filter driver too to bind on each adapter to send packets .

During the test i can see the error logs as :

This script tests miniport functionality to send 802.1p priority packets by following
variations:

  1. Send mechanism with DIRECTED packets
  2. SendPacket mechanism with DIRECTED packets
  3. SendPacket mechanism with BROADCAST packets
  4. SendPacket mechanism with MULTICAST packets (802.3)

*********************************************************

SetPacketFilter is setting the packet filter to DIRECTED

StartPriority

  • OpenId = 0x01010001
  • PriorityServer OpenId = 0x02010001
  • DestinationAddress = 00-23-tv-18-58-90
  • PacketCount = 100
  • PacketSize = 64
  • Delay = 4
  • Mode = 2

erver transmission statistics:

Total Packets Sent = 100
Packets Sent with Non-Zero priority Set = 100

Client reception statistics:

Total Packets Received = 100
Packets Received with Non-Zero priority Set = 0
Packets Received with Correct Priority = 0

FAIL! No packets were received with correct Priority!!

Packets Received with Wrong Priority = 100

Packets received with Non-Zero prirority set is lower than the acceptable minimum of 95

Note: Packets with high priority DIDN’T arrive early!!
FAILED: [21596] Unable to get priority test results on Test adapter

********************************************************************

I am just adding MACRO NDIS_MAC_OPTION_8021P_PRIORITY for OID_GEN_MAC_OPTION OID request . But i am not handling any 802.1p tag on netbufferlist .

So my questions are :

1 . can i support 802.1p on virtual miniport driver ? if not should i implement it on filter driver ?

  1. HLK NDitest send 802.1p packets . So if i handle this 802.1p on sendnetbufferlist function in miniport/filter , will it pass the test ? or should i implement on both send and receive function ?

  2. Any sample document ?

Thanks . Any suggestions ?

Either your hardware or your driver has to stuff and strip the 802.11Q vlan/priority headers, or else you need some way to pass the same data from the Tx to the Rx side if your packets will never find their way onto other LAN segments (virtual or physical) The OS will pass the metadata as part of the NBL, but the OS will not stuff/strip the actual header. On physical hardware, even the cheapest NIC devices do this in hardware.

One way of stuffing the 802.11Q header in software means you should allocate and the packet headers into a new memory fragment. You can also retract the starting point in the NB, shuffle the MAC header back 4 bytes, and write the 802.11Q header. If there is not already sufficient preallocated buffer space in the first MDL chunk, this means the OS has to allocate a little buffer chunk, allocate an MDL to point to it, and link the MDL at the beginning of the NB MDL chain, which can result in a fragment split in the middle of the MAC header, which is bad. There is an option for a NIC to specify how much extra space to preallocate in packets from transports, so they can always retract the packet start without an allocation, although I’m not positive this actually works (It didn’t seem on a recent NIC I worked on).

Since yours is a virtual NIC, and assume you also must be calculating the checksums (WHQL tests require checksum offload), which means you must already be copying the header and splicing it into the MDL chain, you should just allocate an extra 4 bytes when you copy the header, and stuff the 802.11Q header. On the receive side, just copy the MAC header 4 bytes later, and adjust the starting offset in the buffer. On the Tx side you get the correct VLAN/Priority fields from the NBL, and on the Rx side you need to take the values in the 801.11Q header and put them in the NBL.

Jan

On 2/17/17, 8:15 AM, “xxxxx@lists.osr.com on behalf of xxxxx@gmail.com” wrote:

I am trying to pass 2c_priority test of HLK on virtual adapter . I have a filter driver too to bind on each adapter to send packets .

During the test i can see the error logs as :

This script tests miniport functionality to send 802.1p priority packets by following
variations:
1. Send mechanism with DIRECTED packets
2. SendPacket mechanism with DIRECTED packets
3. SendPacket mechanism with BROADCAST packets
4. SendPacket mechanism with MULTICAST packets (802.3)



SetPacketFilter is setting the packet filter to DIRECTED

StartPriority
- OpenId = 0x01010001
- PriorityServer OpenId = 0x02010001
- DestinationAddress = 00-23-tv-18-58-90
- PacketCount = 100
- PacketSize = 64
- Delay = 4
- Mode = 2

erver transmission statistics:

Total Packets Sent = 100
Packets Sent with Non-Zero priority Set = 100

Client reception statistics:

Total Packets Received = 100
Packets Received with Non-Zero priority Set = 0
Packets Received with Correct Priority = 0

FAIL! No packets were received with correct Priority!!

Packets Received with Wrong Priority = 100

Packets received with Non-Zero prirority set is lower than the acceptable minimum of 95

Note: Packets with high priority DIDN’T arrive early!!
FAILED: [21596] Unable to get priority test results on Test adapter

***********

I am just adding MACRO NDIS_MAC_OPTION_8021P_PRIORITY for OID_GEN_MAC_OPTION OID request . But i am not handling any 802.1p tag on netbufferlist .

So my questions are :

1 . can i support 802.1p on virtual miniport driver ? if not should i implement it on filter driver ?

2. HLK NDitest send 802.1p packets . So if i handle this 802.1p on sendnetbufferlist function in miniport/filter , will it pass the test ? or should i implement on both send and receive function ?

3. Any sample document ?

Thanks . Any suggestions ?


NTDEV is sponsored by OSR

Visit the list online at: http:

MONTHLY seminars on crash dump analysis, WDF, Windows internals and software drivers!
Details at http:

To unsubscribe, visit the List Server section of OSR Online at http:</http:></http:></http:>

Should i set this 802.1 stripping inside filter driver receive function ? or virtual miniport receive function ?
Thanks for your valuable suggestions .