Skip to content

Commit 9f193ba

Browse files
author
Shuotian Cheng
authored
orchagent: Setting SAI_MIRROR_SESSION_ATTR_TC as optional (#162)
Signed-off-by: Shuotian Cheng <[email protected]>
1 parent 3abdbdf commit 9f193ba

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

orchagent/mirrororch.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,14 @@ bool MirrorOrch::activateSession(const string& name, MirrorEntry& session)
286286

287287
assert(!session.status);
288288

289-
attr.id = SAI_MIRROR_SESSION_ATTR_TC;
290-
attr.value.u8 = session.queue;
291-
attrs.push_back(attr);
289+
/* Some platforms don't support SAI_MIRROR_SESSION_ATTR_TC and only
290+
* support global mirror session traffic class. */
291+
if (session.queue != 0)
292+
{
293+
attr.id = SAI_MIRROR_SESSION_ATTR_TC;
294+
attr.value.u8 = session.queue;
295+
attrs.push_back(attr);
296+
}
292297

293298
attr.id = SAI_MIRROR_SESSION_ATTR_MONITOR_PORT;
294299
attr.value.oid = session.neighborInfo.portId;

0 commit comments

Comments
 (0)