From 5d97b0571eaf3157cbf9fd74748ab7b51c18706d Mon Sep 17 00:00:00 2001 From: Ze Gan Date: Thu, 15 Jul 2021 14:16:39 +0800 Subject: [PATCH] Update MACsec SA PN counter to support SAI API 1.8 (#1818) What I did Rename XPN attributes from SAI_MACSEC_SA_ATTR_MINIMUM_XPN and SAI_MACSEC_SA_ATTR_XPN to SAI_MACSEC_SA_ATTR_CURRENT_XPN Why I did it Due to opencomputeproject/SAI#1169 that refactors the attributes about XPN, a new attributes SAI_MACSEC_SA_ATTR_CURRENT_XPN for both ingress and egress was introduced for reading the Packet number. So move the original attributes to the new one. Signed-off-by: Ze Gan --- orchagent/macsecorch.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/orchagent/macsecorch.cpp b/orchagent/macsecorch.cpp index ead1bfa81c5f..2247deba8411 100644 --- a/orchagent/macsecorch.cpp +++ b/orchagent/macsecorch.cpp @@ -31,14 +31,9 @@ constexpr bool DEFAULT_ENABLE_ENCRYPT = true; constexpr bool DEFAULT_SCI_IN_SECTAG = false; constexpr sai_macsec_cipher_suite_t DEFAULT_CIPHER_SUITE = SAI_MACSEC_CIPHER_SUITE_GCM_AES_128; -static const std::vector macsec_egress_sa_attrs = +static const std::vector macsec_sa_attrs = { - "SAI_MACSEC_SA_ATTR_XPN", -}; - -static const std::vector macsec_ingress_sa_attrs = - { - "SAI_MACSEC_SA_ATTR_MINIMUM_XPN", + "SAI_MACSEC_SA_ATTR_CURRENT_XPN", }; template @@ -1743,16 +1738,15 @@ task_process_status MACsecOrch::createMACsecSA( sc->m_sa_ids.erase(an); }); + installCounter(CounterType::MACSEC_SA_ATTR, port_sci_an, sc->m_sa_ids[an], macsec_sa_attrs); std::vector fvVector; fvVector.emplace_back("state", "ok"); if (direction == SAI_MACSEC_DIRECTION_EGRESS) { - installCounter(CounterType::MACSEC_SA_ATTR, port_sci_an, sc->m_sa_ids[an], macsec_egress_sa_attrs); m_state_macsec_egress_sa.set(swss::join('|', port_name, sci, an), fvVector); } else { - installCounter(CounterType::MACSEC_SA_ATTR, port_sci_an, sc->m_sa_ids[an], macsec_ingress_sa_attrs); m_state_macsec_ingress_sa.set(swss::join('|', port_name, sci, an), fvVector); }