Skip to content

Commit 5d97b05

Browse files
authored
Update MACsec SA PN counter to support SAI API 1.8 (sonic-net#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 <[email protected]>
1 parent 64e33b3 commit 5d97b05

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

orchagent/macsecorch.cpp

+3-9
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,9 @@ constexpr bool DEFAULT_ENABLE_ENCRYPT = true;
3131
constexpr bool DEFAULT_SCI_IN_SECTAG = false;
3232
constexpr sai_macsec_cipher_suite_t DEFAULT_CIPHER_SUITE = SAI_MACSEC_CIPHER_SUITE_GCM_AES_128;
3333

34-
static const std::vector<std::string> macsec_egress_sa_attrs =
34+
static const std::vector<std::string> macsec_sa_attrs =
3535
{
36-
"SAI_MACSEC_SA_ATTR_XPN",
37-
};
38-
39-
static const std::vector<std::string> macsec_ingress_sa_attrs =
40-
{
41-
"SAI_MACSEC_SA_ATTR_MINIMUM_XPN",
36+
"SAI_MACSEC_SA_ATTR_CURRENT_XPN",
4237
};
4338

4439
template <typename T, typename... Args>
@@ -1743,16 +1738,15 @@ task_process_status MACsecOrch::createMACsecSA(
17431738
sc->m_sa_ids.erase(an);
17441739
});
17451740

1741+
installCounter(CounterType::MACSEC_SA_ATTR, port_sci_an, sc->m_sa_ids[an], macsec_sa_attrs);
17461742
std::vector<FieldValueTuple> fvVector;
17471743
fvVector.emplace_back("state", "ok");
17481744
if (direction == SAI_MACSEC_DIRECTION_EGRESS)
17491745
{
1750-
installCounter(CounterType::MACSEC_SA_ATTR, port_sci_an, sc->m_sa_ids[an], macsec_egress_sa_attrs);
17511746
m_state_macsec_egress_sa.set(swss::join('|', port_name, sci, an), fvVector);
17521747
}
17531748
else
17541749
{
1755-
installCounter(CounterType::MACSEC_SA_ATTR, port_sci_an, sc->m_sa_ids[an], macsec_ingress_sa_attrs);
17561750
m_state_macsec_ingress_sa.set(swss::join('|', port_name, sci, an), fvVector);
17571751
}
17581752

0 commit comments

Comments
 (0)