Skip to content

Commit 6c02acf

Browse files
authored
[MACsec]: Set macsec to bypass by default (sonic-net#1719)
In adapting to the MACsec driver for Arista 7280Cr3, we found it is necessary to set SAI_MACSEC_ATTR_PHYSICAL_BYPASS_ENABLE to True, to successfully change the MACsec status from enable to disable (expecting that the traffic can pass through without encryption thereafter). The reason behind is that the default value of the attribute is False, if it is False, the driver understands it as the user is not allowing to bypass MACsec, yielding the result of disabling MACsec not as expected.
1 parent 9720f74 commit 6c02acf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

orchagent/macsecorch.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -789,6 +789,11 @@ bool MACsecOrch::initMACsecObject(sai_object_id_t switch_id)
789789
attr.id = SAI_MACSEC_ATTR_DIRECTION;
790790
attr.value.s32 = SAI_MACSEC_DIRECTION_EGRESS;
791791
attrs.push_back(attr);
792+
793+
attr.id = SAI_MACSEC_ATTR_PHYSICAL_BYPASS_ENABLE;
794+
attr.value.booldata = true;
795+
attrs.push_back(attr);
796+
792797
sai_status_t status = sai_macsec_api->create_macsec(
793798
&macsec_obj.first->second.m_egress_id,
794799
switch_id,
@@ -809,6 +814,11 @@ bool MACsecOrch::initMACsecObject(sai_object_id_t switch_id)
809814
attr.id = SAI_MACSEC_ATTR_DIRECTION;
810815
attr.value.s32 = SAI_MACSEC_DIRECTION_INGRESS;
811816
attrs.push_back(attr);
817+
818+
attr.id = SAI_MACSEC_ATTR_PHYSICAL_BYPASS_ENABLE;
819+
attr.value.booldata = true;
820+
attrs.push_back(attr);
821+
812822
status = sai_macsec_api->create_macsec(
813823
&macsec_obj.first->second.m_ingress_id,
814824
switch_id,

0 commit comments

Comments
 (0)