Skip to content

Commit f4acf14

Browse files
committed
Add global trusted_vni entry
Signed-off-by: Junhua Zhai <[email protected]>
1 parent c0c337d commit f4acf14

File tree

4 files changed

+174
-7
lines changed

4 files changed

+174
-7
lines changed

experimental/saiexperimentaldasheni.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ typedef enum _sai_eni_attr_t
560560
* @brief Action parameter DASH ENI mode
561561
*
562562
* @type sai_dash_eni_mode_t
563-
* @flags CREATE_AND_SET
563+
* @flags CREATE_ONLY
564564
* @default SAI_DASH_ENI_MODE_VM
565565
*/
566566
SAI_ENI_ATTR_DASH_ENI_MODE,

experimental/saiexperimentaldashtrustedvni.h

Lines changed: 168 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ typedef enum _sai_trusted_vni_entry_action_t
4444

4545
} sai_trusted_vni_entry_action_t;
4646

47+
/**
48+
* @brief Attribute data for #SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_ACTION
49+
*/
50+
typedef enum _sai_global_trusted_vni_entry_action_t
51+
{
52+
SAI_GLOBAL_TRUSTED_VNI_ENTRY_ACTION_PERMIT,
53+
54+
} sai_global_trusted_vni_entry_action_t;
55+
4756
/**
4857
* @brief Entry for trusted_vni_entry
4958
*/
@@ -102,6 +111,57 @@ typedef enum _sai_trusted_vni_entry_attr_t
102111

103112
} sai_trusted_vni_entry_attr_t;
104113

114+
/**
115+
* @brief Entry for global_trusted_vni_entry
116+
*/
117+
typedef struct _sai_global_trusted_vni_entry_t
118+
{
119+
/**
120+
* @brief Switch ID
121+
*
122+
* @objects SAI_OBJECT_TYPE_SWITCH
123+
*/
124+
sai_object_id_t switch_id;
125+
126+
/**
127+
* @brief Range matched key vni_range
128+
*/
129+
sai_u32_range_t vni_range;
130+
131+
} sai_global_trusted_vni_entry_t;
132+
133+
/**
134+
* @brief Attribute ID for global trusted VNI entry
135+
*/
136+
typedef enum _sai_global_trusted_vni_entry_attr_t
137+
{
138+
/**
139+
* @brief Start of attributes
140+
*/
141+
SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_START,
142+
143+
/**
144+
* @brief Action
145+
*
146+
* @type sai_global_trusted_vni_entry_action_t
147+
* @flags CREATE_AND_SET
148+
* @default SAI_GLOBAL_TRUSTED_VNI_ENTRY_ACTION_PERMIT
149+
*/
150+
SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_ACTION = SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_START,
151+
152+
/**
153+
* @brief End of attributes
154+
*/
155+
SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_END,
156+
157+
/** Custom range base value */
158+
SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000,
159+
160+
/** End of custom range base */
161+
SAI_GLOBAL_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_END,
162+
163+
} sai_global_trusted_vni_entry_attr_t;
164+
105165
/**
106166
* @brief Create trusted VNI entry
107167
*
@@ -197,14 +257,116 @@ typedef sai_status_t (*sai_bulk_remove_trusted_vni_entry_fn)(
197257
_In_ sai_bulk_op_error_mode_t mode,
198258
_Out_ sai_status_t *object_statuses);
199259

260+
/**
261+
* @brief Create global trusted VNI entry
262+
*
263+
* @param[in] global_trusted_vni_entry Entry
264+
* @param[in] attr_count Number of attributes
265+
* @param[in] attr_list Array of attributes
266+
*
267+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
268+
*/
269+
typedef sai_status_t (*sai_create_global_trusted_vni_entry_fn)(
270+
_In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry,
271+
_In_ uint32_t attr_count,
272+
_In_ const sai_attribute_t *attr_list);
273+
274+
/**
275+
* @brief Remove global trusted VNI entry
276+
*
277+
* @param[in] global_trusted_vni_entry Entry
278+
*
279+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
280+
*/
281+
typedef sai_status_t (*sai_remove_global_trusted_vni_entry_fn)(
282+
_In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry);
283+
284+
/**
285+
* @brief Set attribute for global trusted VNI entry
286+
*
287+
* @param[in] global_trusted_vni_entry Entry
288+
* @param[in] attr Attribute
289+
*
290+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
291+
*/
292+
typedef sai_status_t (*sai_set_global_trusted_vni_entry_attribute_fn)(
293+
_In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry,
294+
_In_ const sai_attribute_t *attr);
295+
296+
/**
297+
* @brief Get attribute for global trusted VNI entry
298+
*
299+
* @param[in] global_trusted_vni_entry Entry
300+
* @param[in] attr_count Number of attributes
301+
* @param[inout] attr_list Array of attributes
302+
*
303+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
304+
*/
305+
typedef sai_status_t (*sai_get_global_trusted_vni_entry_attribute_fn)(
306+
_In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry,
307+
_In_ uint32_t attr_count,
308+
_Inout_ sai_attribute_t *attr_list);
309+
310+
/**
311+
* @brief Bulk create global trusted VNI entry
312+
*
313+
* @param[in] object_count Number of objects to create
314+
* @param[in] global_trusted_vni_entry List of object to create
315+
* @param[in] attr_count List of attr_count. Caller passes the number
316+
* of attribute for each object to create.
317+
* @param[in] attr_list List of attributes for every object.
318+
* @param[in] mode Bulk operation error handling mode.
319+
* @param[out] object_statuses List of status for every object. Caller needs to
320+
* allocate the buffer
321+
*
322+
* @return #SAI_STATUS_SUCCESS on success when all objects are created or
323+
* #SAI_STATUS_FAILURE when any of the objects fails to create. When there is
324+
* failure, Caller is expected to go through the list of returned statuses to
325+
* find out which fails and which succeeds.
326+
*/
327+
typedef sai_status_t (*sai_bulk_create_global_trusted_vni_entry_fn)(
328+
_In_ uint32_t object_count,
329+
_In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry,
330+
_In_ const uint32_t *attr_count,
331+
_In_ const sai_attribute_t **attr_list,
332+
_In_ sai_bulk_op_error_mode_t mode,
333+
_Out_ sai_status_t *object_statuses);
334+
335+
/**
336+
* @brief Bulk remove global trusted VNI entry
337+
*
338+
* @param[in] object_count Number of objects to remove
339+
* @param[in] global_trusted_vni_entry List of objects to remove
340+
* @param[in] mode Bulk operation error handling mode.
341+
* @param[out] object_statuses List of status for every object. Caller needs to
342+
* allocate the buffer
343+
*
344+
* @return #SAI_STATUS_SUCCESS on success when all objects are removed or
345+
* #SAI_STATUS_FAILURE when any of the objects fails to remove. When there is
346+
* failure, Caller is expected to go through the list of returned statuses to
347+
* find out which fails and which succeeds.
348+
*/
349+
typedef sai_status_t (*sai_bulk_remove_global_trusted_vni_entry_fn)(
350+
_In_ uint32_t object_count,
351+
_In_ const sai_global_trusted_vni_entry_t *global_trusted_vni_entry,
352+
_In_ sai_bulk_op_error_mode_t mode,
353+
_Out_ sai_status_t *object_statuses);
354+
200355
typedef struct _sai_dash_trusted_vni_api_t
201356
{
202-
sai_create_trusted_vni_entry_fn create_trusted_vni_entry;
203-
sai_remove_trusted_vni_entry_fn remove_trusted_vni_entry;
204-
sai_set_trusted_vni_entry_attribute_fn set_trusted_vni_entry_attribute;
205-
sai_get_trusted_vni_entry_attribute_fn get_trusted_vni_entry_attribute;
206-
sai_bulk_create_trusted_vni_entry_fn create_trusted_vni_entries;
207-
sai_bulk_remove_trusted_vni_entry_fn remove_trusted_vni_entries;
357+
sai_create_trusted_vni_entry_fn create_trusted_vni_entry;
358+
sai_remove_trusted_vni_entry_fn remove_trusted_vni_entry;
359+
sai_set_trusted_vni_entry_attribute_fn set_trusted_vni_entry_attribute;
360+
sai_get_trusted_vni_entry_attribute_fn get_trusted_vni_entry_attribute;
361+
sai_bulk_create_trusted_vni_entry_fn create_trusted_vni_entries;
362+
sai_bulk_remove_trusted_vni_entry_fn remove_trusted_vni_entries;
363+
364+
sai_create_global_trusted_vni_entry_fn create_global_trusted_vni_entry;
365+
sai_remove_global_trusted_vni_entry_fn remove_global_trusted_vni_entry;
366+
sai_set_global_trusted_vni_entry_attribute_fn set_global_trusted_vni_entry_attribute;
367+
sai_get_global_trusted_vni_entry_attribute_fn get_global_trusted_vni_entry_attribute;
368+
sai_bulk_create_global_trusted_vni_entry_fn create_global_trusted_vni_entries;
369+
sai_bulk_remove_global_trusted_vni_entry_fn remove_global_trusted_vni_entries;
208370

209371
} sai_dash_trusted_vni_api_t;
210372

experimental/saitypesextensions.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ typedef enum _sai_object_type_extensions_t
9898

9999
SAI_OBJECT_TYPE_TRUSTED_VNI_ENTRY,
100100

101+
SAI_OBJECT_TYPE_GLOBAL_TRUSTED_VNI_ENTRY,
102+
101103
/* Add new experimental object types above this line */
102104

103105
SAI_OBJECT_TYPE_EXTENSIONS_RANGE_END

inc/saiobject.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ typedef union _sai_object_key_entry_t
137137
/** @validonly object_type == SAI_OBJECT_TYPE_TRUSTED_VNI_ENTRY */
138138
sai_trusted_vni_entry_t trusted_vni_entry;
139139

140+
/** @validonly object_type == SAI_OBJECT_TYPE_GLOBAL_TRUSTED_VNI_ENTRY */
141+
sai_global_trusted_vni_entry_t global_trusted_vni_entry;
142+
140143
/* Add new experimental entries above this line */
141144

142145
} sai_object_key_entry_t;

0 commit comments

Comments
 (0)