diff options
author | Anand Kumar <kumaranand@vmware.com> | 2018-05-15 16:38:00 -0700 |
---|---|---|
committer | Alin Gabriel Serdean <aserdean@ovn.org> | 2018-06-11 16:17:24 +0300 |
commit | 205b80ebad275377da256ea3f761810b535df2d0 (patch) | |
tree | 8c6e04608c942d607a7c8e902a70acd1572d0c17 /datapath-windows/ovsext/User.c | |
parent | cc266ef0c9795e8ffb688a1f67db3b3cd7797c3c (diff) | |
download | openvswitch-205b80ebad275377da256ea3f761810b535df2d0.tar.gz |
datapath-windows: Add support for handling DEI bit of VLAN header
The Drop eligible indicator(DEI) is 1 bit wide and it is part of
Tag control information (TCI) in VLAN header, which indicates that
the frame can be dropped during congestion.
Signed-off-by: Anand Kumar <kumaranand@vmware.com>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
Signed-off-by: Alin Gabriel Serdean <aserdean@ovn.org>
Diffstat (limited to 'datapath-windows/ovsext/User.c')
-rw-r--r-- | datapath-windows/ovsext/User.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/datapath-windows/ovsext/User.c b/datapath-windows/ovsext/User.c index 4693a8b55..509472f23 100644 --- a/datapath-windows/ovsext/User.c +++ b/datapath-windows/ovsext/User.c @@ -1000,11 +1000,12 @@ OvsCreateQueueNlPacket(PVOID userData, POVS_PACKET_HDR_INFO hdrInfo) { #define VLAN_TAG_SIZE 4 - UINT32 allocLen, dataLen, extraLen; + UINT32 allocLen, dataLen, extraLen = 0; POVS_PACKET_QUEUE_ELEM elem; UINT8 *src, *dst; NDIS_TCP_IP_CHECKSUM_NET_BUFFER_LIST_INFO csumInfo; - NDIS_NET_BUFFER_LIST_8021Q_INFO vlanInfo; + PNDIS_NET_BUFFER_LIST_8021Q_INFO vlanInfo = NULL; + PVOID vlanTag; OvsIPv4TunnelKey *tunnelKey = (OvsIPv4TunnelKey *)&key->tunKey; UINT32 pid; UINT32 nlMsgSize; @@ -1037,8 +1038,13 @@ OvsCreateQueueNlPacket(PVOID userData, return NULL; } - vlanInfo.Value = NET_BUFFER_LIST_INFO(nbl, Ieee8021QNetBufferListInfo); - extraLen = vlanInfo.TagHeader.VlanId ? VLAN_TAG_SIZE : 0; + vlanTag = NET_BUFFER_LIST_INFO(nbl, Ieee8021QNetBufferListInfo); + if (vlanTag) { + vlanInfo = (PNDIS_NET_BUFFER_LIST_8021Q_INFO)(PVOID *)&vlanTag; + if (vlanInfo->Value) { + extraLen = VLAN_TAG_SIZE; + } + } dataLen = NET_BUFFER_DATA_LENGTH(nb); @@ -1148,8 +1154,9 @@ OvsCreateQueueNlPacket(PVOID userData, ((UINT32 *)dst)[2] = ((UINT32 *)src)[2]; dst += 12; ((UINT16 *)dst)[0] = htons(0x8100); - ((UINT16 *)dst)[1] = htons(vlanInfo.TagHeader.VlanId | - (vlanInfo.TagHeader.UserPriority << 13)); + ((UINT16 *)dst)[1] = htons(vlanInfo->TagHeader.VlanId | + (vlanInfo->TagHeader.CanonicalFormatId << 12) | + (vlanInfo->TagHeader.UserPriority << 13)); elem->hdrInfo.l3Offset += VLAN_TAG_SIZE; elem->hdrInfo.l4Offset += VLAN_TAG_SIZE; ovsUserStats.vlanInsert++; |