Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update MACsec SA PN counter to support SAI API 1.8 #1818

Merged
merged 1 commit into from
Jul 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions orchagent/macsecorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> macsec_egress_sa_attrs =
static const std::vector<std::string> macsec_sa_attrs =
{
"SAI_MACSEC_SA_ATTR_XPN",
};

static const std::vector<std::string> macsec_ingress_sa_attrs =
{
"SAI_MACSEC_SA_ATTR_MINIMUM_XPN",
"SAI_MACSEC_SA_ATTR_CURRENT_XPN",
};

template <typename T, typename... Args>
Expand Down Expand Up @@ -1722,16 +1717,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<FieldValueTuple> 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);
}

Expand Down