@@ -69,10 +69,77 @@ sai_status_t SwitchBCM81724::initialize_default_objects(
69
69
70
70
CHECK_STATUS (set_switch_default_attributes ());
71
71
CHECK_STATUS (create_default_trap_group ());
72
+ CHECK_STATUS (set_acl_entry_min_prio ());
72
73
73
74
return SAI_STATUS_SUCCESS;
74
75
}
75
76
77
+ sai_status_t SwitchBCM81724::set (
78
+ _In_ sai_object_type_t objectType,
79
+ _In_ sai_object_id_t objectId,
80
+ _In_ const sai_attribute_t * attr)
81
+ {
82
+ SWSS_LOG_ENTER ();
83
+
84
+ return SwitchStateBase::set (objectType, objectId, attr);
85
+ }
86
+
87
+ sai_status_t SwitchBCM81724::create (
88
+ _In_ sai_object_type_t object_type,
89
+ _In_ const std::string &serializedObjectId,
90
+ _In_ sai_object_id_t switch_id,
91
+ _In_ uint32_t attr_count,
92
+ _In_ const sai_attribute_t *attr_list)
93
+ {
94
+ SWSS_LOG_ENTER ();
95
+
96
+ // Bypass MACsec creating because the existing implementation of MACsec cannot be directly used by Gearbox
97
+ if (is_macsec_type (object_type))
98
+ {
99
+ SWSS_LOG_INFO (" Bypass creating %s" , sai_serialize_object_type (object_type));
100
+
101
+ return create_internal (object_type, serializedObjectId, switch_id, attr_count, attr_list);
102
+ }
103
+
104
+ return SwitchStateBase::create (object_type, serializedObjectId, switch_id, attr_count, attr_list);
105
+ }
106
+
107
+ sai_status_t SwitchBCM81724::remove (
108
+ _In_ sai_object_type_t object_type,
109
+ _In_ const std::string &serializedObjectId)
110
+ {
111
+ SWSS_LOG_ENTER ();
112
+
113
+ // Bypass MACsec removing because the existing implementation of MACsec cannot be directly used by Gearbox
114
+ if (is_macsec_type (object_type))
115
+ {
116
+ SWSS_LOG_INFO (" Bypass removing %s" , sai_serialize_object_type (object_type));
117
+
118
+ return remove_internal (object_type, serializedObjectId);
119
+ }
120
+
121
+ return SwitchStateBase::remove (object_type, serializedObjectId);
122
+ }
123
+
124
+ sai_status_t SwitchBCM81724::set (
125
+ _In_ sai_object_type_t objectType,
126
+ _In_ const std::string &serializedObjectId,
127
+ _In_ const sai_attribute_t * attr)
128
+ {
129
+ SWSS_LOG_ENTER ();
130
+
131
+ // Bypass MACsec setting because the existing implementation of MACsec cannot be directly used by Gearbox
132
+ if (is_macsec_type (objectType) ||
133
+ (objectType == SAI_OBJECT_TYPE_ACL_ENTRY && attr && attr->id == SAI_ACL_ENTRY_ATTR_ACTION_MACSEC_FLOW))
134
+ {
135
+ SWSS_LOG_INFO (" Bypass setting %s" , sai_serialize_object_type (objectType));
136
+
137
+ return set_internal (objectType, serializedObjectId, attr);;
138
+ }
139
+
140
+ return SwitchStateBase::set (objectType, serializedObjectId, attr);
141
+ }
142
+
76
143
sai_status_t SwitchBCM81724::refresh_port_list (
77
144
_In_ const sai_attr_metadata_t *meta)
78
145
{
@@ -183,6 +250,10 @@ sai_status_t SwitchBCM81724::refresh_read_only(
183
250
case SAI_SWITCH_ATTR_DEFAULT_TRAP_GROUP:
184
251
case SAI_SWITCH_ATTR_FIRMWARE_MAJOR_VERSION:
185
252
return SAI_STATUS_SUCCESS;
253
+
254
+ case SAI_SWITCH_ATTR_ACL_ENTRY_MINIMUM_PRIORITY:
255
+ case SAI_SWITCH_ATTR_ACL_ENTRY_MAXIMUM_PRIORITY:
256
+ return SAI_STATUS_SUCCESS;
186
257
}
187
258
}
188
259
@@ -211,6 +282,16 @@ sai_status_t SwitchBCM81724::refresh_read_only(
211
282
return SAI_STATUS_SUCCESS; // XXX not sure for gearbox
212
283
}
213
284
285
+ if (meta->objecttype == SAI_OBJECT_TYPE_MACSEC && meta->attrid == SAI_MACSEC_ATTR_SCI_IN_INGRESS_MACSEC_ACL)
286
+ {
287
+ return refresh_macsec_sci_in_ingress_macsec_acl (object_id);
288
+ }
289
+
290
+ if (meta->objecttype == SAI_OBJECT_TYPE_MACSEC_SA)
291
+ {
292
+ return refresh_macsec_sa_stat (object_id);
293
+ }
294
+
214
295
auto mmeta = m_meta.lock ();
215
296
216
297
if (mmeta)
@@ -254,3 +335,23 @@ sai_status_t SwitchBCM81724::warm_boot_initialize_objects()
254
335
255
336
return SAI_STATUS_NOT_IMPLEMENTED;
256
337
}
338
+
339
+ bool SwitchBCM81724::is_macsec_type (_In_ sai_object_type_t object_type)
340
+ {
341
+ SWSS_LOG_ENTER ();
342
+
343
+ switch (object_type)
344
+ {
345
+ case SAI_OBJECT_TYPE_MACSEC_PORT:
346
+
347
+ case SAI_OBJECT_TYPE_MACSEC_SC:
348
+
349
+ case SAI_OBJECT_TYPE_MACSEC_SA:
350
+
351
+ return true ;
352
+
353
+ default : break ;
354
+ }
355
+
356
+ return false ;
357
+ }
0 commit comments