Skip to content

Commit 832815e

Browse files
authored
[orchagent]: Add MACsec Orchagent (#1474)
Add MACsec orchagent for MACsec feature. The MACsecOrch is introduced in the Orchagent to handle configuration requests. It monitors MACsec related tables in APP DB and convert those messages to SAI commands to manage the MACsec object. The main functions are defined in class MACsecOrch as follow ``` task_process_status taskUpdateMACsecPort(const std::string & port_name, const TaskArgs & port_attr); task_process_status taskDisableMACsecPort(const std::string & port_name, const TaskArgs & port_attr); task_process_status taskUpdateEgressSC(const std::string & port_sci, const TaskArgs & sc_attr); task_process_status taskDeleteEgressSC(const std::string & port_sci, const TaskArgs & sc_attr); task_process_status taskUpdateIngressSC(const std::string & port_sci, const TaskArgs & sc_attr); task_process_status taskDeleteIngressSC(const std::string & port_sci, const TaskArgs & sc_attr); task_process_status taskUpdateEgressSA(const std::string & port_sci_an, const TaskArgs & sa_attr); task_process_status taskDeleteEgressSA(const std::string & port_sci_an, const TaskArgs & sa_attr); task_process_status taskUpdateIngressSA(const std::string & port_sci_an, const TaskArgs & sa_attr); task_process_status taskDeleteIngressSA(const std::string & port_sci_an, const TaskArgs & sa_attr); ``` The HLD of MACsec orchagent is at [MACsec HLD](https://github.com/Azure/SONiC/blob/master/doc/macsec/MACsec_hld.md#344-macsec-orch) Signed-off-by: Ze Gan <[email protected]>
1 parent dd4e409 commit 832815e

10 files changed

+3183
-8
lines changed

orchagent/Makefile.am

+2-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ orchagent_SOURCES = \
6161
chassisorch.cpp \
6262
debugcounterorch.cpp \
6363
natorch.cpp \
64-
muxorch.cpp
64+
muxorch.cpp \
65+
macsecorch.cpp
6566

6667
orchagent_SOURCES += flex_counter/flex_counter_manager.cpp flex_counter/flex_counter_stat_manager.cpp
6768
orchagent_SOURCES += debug_counter/debug_counter.cpp debug_counter/drop_counter.cpp

orchagent/flex_counter/flex_counter_manager.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#include "logger.h"
88
#include "sai_serialize.h"
99

10+
#include <macsecorch.h>
11+
1012
using std::shared_ptr;
1113
using std::string;
1214
using std::unordered_map;
@@ -32,10 +34,11 @@ const unordered_map<bool, string> FlexCounterManager::status_lookup =
3234

3335
const unordered_map<CounterType, string> FlexCounterManager::counter_id_field_lookup =
3436
{
35-
{ CounterType::PORT_DEBUG, PORT_DEBUG_COUNTER_ID_LIST },
36-
{ CounterType::SWITCH_DEBUG, SWITCH_DEBUG_COUNTER_ID_LIST },
37-
{ CounterType::PORT, PORT_COUNTER_ID_LIST },
38-
{ CounterType::QUEUE, QUEUE_COUNTER_ID_LIST }
37+
{ CounterType::PORT_DEBUG, PORT_DEBUG_COUNTER_ID_LIST },
38+
{ CounterType::SWITCH_DEBUG, SWITCH_DEBUG_COUNTER_ID_LIST },
39+
{ CounterType::PORT, PORT_COUNTER_ID_LIST },
40+
{ CounterType::QUEUE, QUEUE_COUNTER_ID_LIST },
41+
{ CounterType::MACSEC_SA_ATTR, MACSEC_SA_ATTR_ID_LIST },
3942
};
4043

4144
FlexCounterManager::FlexCounterManager(

orchagent/flex_counter/flex_counter_manager.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ enum class CounterType
2222
PORT,
2323
QUEUE,
2424
PORT_DEBUG,
25-
SWITCH_DEBUG
25+
SWITCH_DEBUG,
26+
MACSEC_SA_ATTR,
2627
};
2728

2829
// FlexCounterManager allows users to manage a group of flex counters.

0 commit comments

Comments
 (0)