Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix everflow for SAI 1.0 (#282)
Browse files Browse the repository at this point in the history
* [mirrororch]: Set the VLAN header only when the packet is mirrored to a VLAN

* Fix aclfield.mask (#1)
qiluo-msft authored Aug 9, 2017
1 parent 38f2bf3 commit 47cd2ab
Showing 2 changed files with 21 additions and 17 deletions.
4 changes: 2 additions & 2 deletions orchagent/aclorch.cpp
Original file line number Diff line number Diff line change
@@ -186,8 +186,8 @@ bool AclRule::validateAddMatch(string attr_name, string attr_value)
}
else if(attr_name == MATCH_DSCP)
{
value.aclfield.data.u8 = to_uint<uint8_t>(attr_value, 0, 63);
value.aclfield.mask.u8 = 0xFF;
value.aclfield.data.u8 = to_uint<uint8_t>(attr_value, 0, 0x3F);
value.aclfield.mask.u8 = 0x3F;
}
else if(attr_name == MATCH_IP_PROTOCOL)
{
34 changes: 19 additions & 15 deletions orchagent/mirrororch.cpp
Original file line number Diff line number Diff line change
@@ -396,25 +396,29 @@ bool MirrorOrch::activateSession(const string& name, MirrorEntry& session)
attr.value.s32 = SAI_MIRROR_SESSION_TYPE_ENHANCED_REMOTE;
attrs.push_back(attr);

attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID;
attr.value.booldata = true;
attrs.push_back(attr);
/* Add the VLAN header when the packet is sent out from a VLAN */
if (session.neighborInfo.vlanId)
{
attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_HEADER_VALID;
attr.value.booldata = true;
attrs.push_back(attr);

attr.id =SAI_MIRROR_SESSION_ATTR_VLAN_TPID;
attr.value.u16 = ETH_P_8021Q;
attrs.push_back(attr);
attr.id =SAI_MIRROR_SESSION_ATTR_VLAN_TPID;
attr.value.u16 = ETH_P_8021Q;
attrs.push_back(attr);

attr.id =SAI_MIRROR_SESSION_ATTR_VLAN_ID;
attr.value.u16 = session.neighborInfo.vlanId;
attrs.push_back(attr);
attr.id =SAI_MIRROR_SESSION_ATTR_VLAN_ID;
attr.value.u16 = session.neighborInfo.vlanId;
attrs.push_back(attr);

attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_PRI;
attr.value.u8 = MIRROR_SESSION_DEFAULT_VLAN_PRI;
attrs.push_back(attr);
attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_PRI;
attr.value.u8 = MIRROR_SESSION_DEFAULT_VLAN_PRI;
attrs.push_back(attr);

attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_CFI;
attr.value.u8 = MIRROR_SESSION_DEFAULT_VLAN_CFI;
attrs.push_back(attr);
attr.id = SAI_MIRROR_SESSION_ATTR_VLAN_CFI;
attr.value.u8 = MIRROR_SESSION_DEFAULT_VLAN_CFI;
attrs.push_back(attr);
}

attr.id = SAI_MIRROR_SESSION_ATTR_ERSPAN_ENCAPSULATION_TYPE;
attr.value.s32 = SAI_ERSPAN_ENCAPSULATION_TYPE_MIRROR_L3_GRE_TUNNEL;

0 comments on commit 47cd2ab

Please sign in to comment.