Skip to content

Commit 26acb46

Browse files
committed
Move SAI_MACSEC_ATTR_SCI_IN_INGRESS_MACSEC_ACL from get to refresh
Signed-off-by: Ze Gan <ganze718@gmail.com>
1 parent 4f5a52c commit 26acb46

File tree

3 files changed

+22
-39
lines changed

3 files changed

+22
-39
lines changed

vslib/inc/SwitchStateBase.h

+3-5
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ namespace saivs
138138
virtual sai_status_t refresh_system_port_list(
139139
_In_ const sai_attr_metadata_t *meta);
140140

141+
virtual sai_status_t refresh_macsec_sci_in_ingress_macsec_acl(
142+
_In_ sai_object_id_t object_id);
143+
141144
public:
142145

143146
virtual sai_status_t warm_boot_initialize_objects();
@@ -542,11 +545,6 @@ namespace saivs
542545
_In_ sai_object_type_t object_type,
543546
_Out_ std::vector<MACsecAttr> &macsec_attrs);
544547

545-
sai_status_t getMACsecAttr(
546-
_In_ const std::string &serializedObjectId,
547-
_In_ uint32_t attr_count,
548-
_Out_ sai_attribute_t *attr_list);
549-
550548
sai_status_t getMACsecSAAttr(
551549
_In_ const std::string &serializedObjectId,
552550
_In_ uint32_t attr_count,

vslib/src/SwitchStateBase.cpp

+19-8
Original file line numberDiff line numberDiff line change
@@ -701,14 +701,6 @@ sai_status_t SwitchStateBase::get(
701701
attr_list);
702702
}
703703

704-
if (objectType == SAI_OBJECT_TYPE_MACSEC)
705-
{
706-
return getMACsecAttr(
707-
serializedObjectId,
708-
attr_count,
709-
attr_list);
710-
}
711-
712704
return get_internal(objectType, serializedObjectId, attr_count, attr_list);
713705
}
714706

@@ -1806,6 +1798,20 @@ sai_status_t SwitchStateBase::refresh_port_list(
18061798
return SAI_STATUS_SUCCESS;
18071799
}
18081800

1801+
sai_status_t SwitchStateBase::refresh_macsec_sci_in_ingress_macsec_acl(
1802+
_In_ sai_object_id_t object_id)
1803+
{
1804+
SWSS_LOG_ENTER();
1805+
1806+
sai_attribute_t attr;
1807+
attr.id = SAI_MACSEC_ATTR_SCI_IN_INGRESS_MACSEC_ACL;
1808+
attr.value.booldata = true;
1809+
1810+
CHECK_STATUS(set(SAI_OBJECT_TYPE_MACSEC, object_id, &attr));
1811+
1812+
return SAI_STATUS_SUCCESS;
1813+
}
1814+
18091815
// XXX extra work may be needed on GET api if N on list will be > then actual
18101816

18111817
/*
@@ -1939,6 +1945,11 @@ sai_status_t SwitchStateBase::refresh_read_only(
19391945
return SAI_STATUS_SUCCESS;
19401946
}
19411947

1948+
if (meta->objecttype == SAI_OBJECT_TYPE_MACSEC && meta->attrid == SAI_MACSEC_ATTR_SCI_IN_INGRESS_MACSEC_ACL)
1949+
{
1950+
return refresh_macsec_sci_in_ingress_macsec_acl(object_id);
1951+
}
1952+
19421953
auto mmeta = m_meta.lock();
19431954

19441955
if (mmeta)

vslib/src/SwitchStateBaseMACsec.cpp

-26
Original file line numberDiff line numberDiff line change
@@ -748,32 +748,6 @@ sai_status_t SwitchStateBase::loadMACsecAttrsFromACLEntry(
748748
return SAI_STATUS_NOT_IMPLEMENTED;
749749
}
750750

751-
sai_status_t SwitchStateBase::getMACsecAttr(
752-
_In_ const std::string &serializedObjectId,
753-
_In_ uint32_t attrCount,
754-
_Out_ sai_attribute_t *attrList)
755-
{
756-
SWSS_LOG_ENTER();
757-
758-
for (uint32_t i = 0; i < attrCount; i++)
759-
{
760-
if (attrList[i].id == SAI_MACSEC_ATTR_SCI_IN_INGRESS_MACSEC_ACL)
761-
{
762-
attrList[i].value.booldata = true;
763-
}
764-
else
765-
{
766-
auto meta = sai_metadata_get_attr_metadata(SAI_OBJECT_TYPE_MACSEC, attrList[i].id);
767-
768-
SWSS_LOG_WARN("Cannot get attribute %s", meta->attridname);
769-
770-
return SAI_STATUS_NOT_IMPLEMENTED;
771-
}
772-
}
773-
774-
return SAI_STATUS_SUCCESS;
775-
}
776-
777751
sai_status_t SwitchStateBase::getMACsecSAAttr(
778752
_In_ const std::string &serializedObjectId,
779753
_In_ uint32_t attrCount,

0 commit comments

Comments
 (0)