From 9f193baa71216d168885c62038238169e7e36159 Mon Sep 17 00:00:00 2001 From: Shuotian Cheng Date: Sat, 11 Feb 2017 11:38:27 -0800 Subject: [PATCH] orchagent: Setting SAI_MIRROR_SESSION_ATTR_TC as optional (#162) Signed-off-by: Shuotian Cheng --- orchagent/mirrororch.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/orchagent/mirrororch.cpp b/orchagent/mirrororch.cpp index 821c13781617..02650a5b8be7 100644 --- a/orchagent/mirrororch.cpp +++ b/orchagent/mirrororch.cpp @@ -286,9 +286,14 @@ bool MirrorOrch::activateSession(const string& name, MirrorEntry& session) assert(!session.status); - attr.id = SAI_MIRROR_SESSION_ATTR_TC; - attr.value.u8 = session.queue; - attrs.push_back(attr); + /* Some platforms don't support SAI_MIRROR_SESSION_ATTR_TC and only + * support global mirror session traffic class. */ + if (session.queue != 0) + { + attr.id = SAI_MIRROR_SESSION_ATTR_TC; + attr.value.u8 = session.queue; + attrs.push_back(attr); + } attr.id = SAI_MIRROR_SESSION_ATTR_MONITOR_PORT; attr.value.oid = session.neighborInfo.portId;