@@ -555,6 +555,23 @@ void PortsOrch::doVlanMemberTask(Consumer &consumer)
555
555
556
556
if (op == SET_COMMAND)
557
557
{
558
+ string tagging_mode = " untagged" ;
559
+
560
+ for (auto i : kfvFieldsValues (t))
561
+ {
562
+ if (fvField (i) == " tagging_mode" )
563
+ tagging_mode = fvValue (i);
564
+ }
565
+
566
+ if (tagging_mode != " untagged" &&
567
+ tagging_mode != " tagged" &&
568
+ tagging_mode != " priority_tagged" )
569
+ {
570
+ SWSS_LOG_ERROR (" Wrong tagging_mode '%s' for key: %s" , tagging_mode.c_str (), kfvKey (t).c_str ());
571
+ it = consumer.m_toSync .erase (it);
572
+ continue ;
573
+ }
574
+
558
575
/* Duplicate entry */
559
576
if (vlan.m_members .find (port_alias) != vlan.m_members .end ())
560
577
{
@@ -565,7 +582,7 @@ void PortsOrch::doVlanMemberTask(Consumer &consumer)
565
582
/* Assert the port doesn't belong to any VLAN */
566
583
assert (!port.m_vlan_id && !port.m_vlan_member_id );
567
584
568
- if (addVlanMember (vlan, port))
585
+ if (addVlanMember (vlan, port, tagging_mode ))
569
586
it = consumer.m_toSync .erase (it);
570
587
else
571
588
it++;
@@ -952,7 +969,7 @@ bool PortsOrch::removeVlan(Port vlan)
952
969
return true ;
953
970
}
954
971
955
- bool PortsOrch::addVlanMember (Port vlan, Port port)
972
+ bool PortsOrch::addVlanMember (Port vlan, Port port, string& tagging_mode )
956
973
{
957
974
SWSS_LOG_ENTER ();
958
975
@@ -967,6 +984,16 @@ bool PortsOrch::addVlanMember(Port vlan, Port port)
967
984
attr.value .oid = port.m_port_id ;
968
985
attrs.push_back (attr);
969
986
987
+ attr.id = SAI_VLAN_MEMBER_ATTR_TAGGING_MODE;
988
+ if (tagging_mode == " untagged" )
989
+ attr.value .s32 = SAI_VLAN_PORT_UNTAGGED;
990
+ else if (tagging_mode == " tagged" )
991
+ attr.value .s32 = SAI_VLAN_PORT_TAGGED;
992
+ else if (tagging_mode == " priority_tagged" )
993
+ attr.value .s32 = SAI_VLAN_PORT_PRIORITY_TAGGED;
994
+ else assert (false );
995
+ attrs.push_back (attr);
996
+
970
997
sai_object_id_t vlan_member_id;
971
998
sai_status_t status = sai_vlan_api->create_vlan_member (&vlan_member_id, attrs.size (), attrs.data ());
972
999
0 commit comments