Skip to content

Commit c5b78fc

Browse files
committed
1/ ENI mode VM/FNIC 2/ Add trusted_vni entry
Signed-off-by: Junhua Zhai <junhua.zhai@outlook.com>
1 parent f4695e9 commit c5b78fc

6 files changed

Lines changed: 246 additions & 0 deletions

File tree

experimental/saiexperimentaldashdirectionlookup.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ typedef enum _sai_direction_lookup_entry_action_t
4242
{
4343
SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_OUTBOUND_DIRECTION,
4444

45+
SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_INBOUND_DIRECTION,
46+
4547
} sai_direction_lookup_entry_action_t;
4648

4749
/**
@@ -88,6 +90,7 @@ typedef enum _sai_direction_lookup_entry_attr_t
8890
* @type sai_dash_eni_mac_override_type_t
8991
* @flags CREATE_AND_SET
9092
* @default SAI_DASH_ENI_MAC_OVERRIDE_TYPE_NONE
93+
* @validonly SAI_DIRECTION_LOOKUP_ENTRY_ATTR_ACTION == SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_OUTBOUND_DIRECTION or SAI_DIRECTION_LOOKUP_ENTRY_ATTR_ACTION == SAI_DIRECTION_LOOKUP_ENTRY_ACTION_SET_INBOUND_DIRECTION
9194
*/
9295
SAI_DIRECTION_LOOKUP_ENTRY_ATTR_DASH_ENI_MAC_OVERRIDE_TYPE,
9396

experimental/saiexperimentaldasheni.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,15 @@ typedef enum _sai_eni_attr_t
556556
*/
557557
SAI_ENI_ATTR_FLOW_TABLE_ID,
558558

559+
/**
560+
* @brief Action parameter DASH ENI mode
561+
*
562+
* @type sai_dash_eni_mode_t
563+
* @flags CREATE_AND_SET
564+
* @default SAI_DASH_ENI_MODE_VM
565+
*/
566+
SAI_ENI_ATTR_DASH_ENI_MODE,
567+
559568
/**
560569
* @brief End of attributes
561570
*/
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
/**
2+
* Copyright (c) 2014 Microsoft Open Technologies, Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License"); you may
5+
* not use this file except in compliance with the License. You may obtain
6+
* a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR
9+
* CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
10+
* LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS
11+
* FOR A PARTICULAR PURPOSE, MERCHANTABILITY OR NON-INFRINGEMENT.
12+
*
13+
* See the Apache Version 2.0 License for specific language governing
14+
* permissions and limitations under the License.
15+
*
16+
* Microsoft would like to thank the following companies for their review and
17+
* assistance with these files: Intel Corporation, Mellanox Technologies Ltd,
18+
* Dell Products, L.P., Facebook, Inc., Marvell International Ltd.
19+
*
20+
* @file saiexperimentaldashtrustedvni.h
21+
*
22+
* @brief This module defines SAI extensions for DASH trusted VNI
23+
*
24+
* @warning This module is a SAI experimental module
25+
*/
26+
27+
#if !defined (__SAIEXPERIMENTALDASHTRUSTEDVNI_H_)
28+
#define __SAIEXPERIMENTALDASHTRUSTEDVNI_H_
29+
30+
#include <saitypesextensions.h>
31+
32+
/**
33+
* @defgroup SAIEXPERIMENTALDASHTRUSTEDVNI SAI - Experimental: DASH trusted VNI specific API definitions
34+
*
35+
* @{
36+
*/
37+
38+
/**
39+
* @brief Attribute data for #SAI_TRUSTED_VNI_ENTRY_ATTR_ACTION
40+
*/
41+
typedef enum _sai_trusted_vni_entry_action_t
42+
{
43+
SAI_TRUSTED_VNI_ENTRY_ACTION_PERMIT,
44+
45+
} sai_trusted_vni_entry_action_t;
46+
47+
/**
48+
* @brief Entry for trusted_vni_entry
49+
*/
50+
typedef struct _sai_trusted_vni_entry_t
51+
{
52+
/**
53+
* @brief Switch ID
54+
*
55+
* @objects SAI_OBJECT_TYPE_SWITCH
56+
*/
57+
sai_object_id_t switch_id;
58+
59+
/**
60+
* @brief Exact matched key eni_id
61+
*
62+
* @objects SAI_OBJECT_TYPE_ENI
63+
*/
64+
sai_object_id_t eni_id;
65+
66+
/**
67+
* @brief Range matched key vni_range
68+
*/
69+
sai_u32_range_t vni_range;
70+
71+
} sai_trusted_vni_entry_t;
72+
73+
/**
74+
* @brief Attribute ID for trusted VNI entry
75+
*/
76+
typedef enum _sai_trusted_vni_entry_attr_t
77+
{
78+
/**
79+
* @brief Start of attributes
80+
*/
81+
SAI_TRUSTED_VNI_ENTRY_ATTR_START,
82+
83+
/**
84+
* @brief Action
85+
*
86+
* @type sai_trusted_vni_entry_action_t
87+
* @flags CREATE_AND_SET
88+
* @default SAI_TRUSTED_VNI_ENTRY_ACTION_PERMIT
89+
*/
90+
SAI_TRUSTED_VNI_ENTRY_ATTR_ACTION = SAI_TRUSTED_VNI_ENTRY_ATTR_START,
91+
92+
/**
93+
* @brief End of attributes
94+
*/
95+
SAI_TRUSTED_VNI_ENTRY_ATTR_END,
96+
97+
/** Custom range base value */
98+
SAI_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000,
99+
100+
/** End of custom range base */
101+
SAI_TRUSTED_VNI_ENTRY_ATTR_CUSTOM_RANGE_END,
102+
103+
} sai_trusted_vni_entry_attr_t;
104+
105+
/**
106+
* @brief Create trusted VNI entry
107+
*
108+
* @param[in] trusted_vni_entry Entry
109+
* @param[in] attr_count Number of attributes
110+
* @param[in] attr_list Array of attributes
111+
*
112+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
113+
*/
114+
typedef sai_status_t (*sai_create_trusted_vni_entry_fn)(
115+
_In_ const sai_trusted_vni_entry_t *trusted_vni_entry,
116+
_In_ uint32_t attr_count,
117+
_In_ const sai_attribute_t *attr_list);
118+
119+
/**
120+
* @brief Remove trusted VNI entry
121+
*
122+
* @param[in] trusted_vni_entry Entry
123+
*
124+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
125+
*/
126+
typedef sai_status_t (*sai_remove_trusted_vni_entry_fn)(
127+
_In_ const sai_trusted_vni_entry_t *trusted_vni_entry);
128+
129+
/**
130+
* @brief Set attribute for trusted VNI entry
131+
*
132+
* @param[in] trusted_vni_entry Entry
133+
* @param[in] attr Attribute
134+
*
135+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
136+
*/
137+
typedef sai_status_t (*sai_set_trusted_vni_entry_attribute_fn)(
138+
_In_ const sai_trusted_vni_entry_t *trusted_vni_entry,
139+
_In_ const sai_attribute_t *attr);
140+
141+
/**
142+
* @brief Get attribute for trusted VNI entry
143+
*
144+
* @param[in] trusted_vni_entry Entry
145+
* @param[in] attr_count Number of attributes
146+
* @param[inout] attr_list Array of attributes
147+
*
148+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
149+
*/
150+
typedef sai_status_t (*sai_get_trusted_vni_entry_attribute_fn)(
151+
_In_ const sai_trusted_vni_entry_t *trusted_vni_entry,
152+
_In_ uint32_t attr_count,
153+
_Inout_ sai_attribute_t *attr_list);
154+
155+
/**
156+
* @brief Bulk create trusted VNI entry
157+
*
158+
* @param[in] object_count Number of objects to create
159+
* @param[in] trusted_vni_entry List of object to create
160+
* @param[in] attr_count List of attr_count. Caller passes the number
161+
* of attribute for each object to create.
162+
* @param[in] attr_list List of attributes for every object.
163+
* @param[in] mode Bulk operation error handling mode.
164+
* @param[out] object_statuses List of status for every object. Caller needs to
165+
* allocate the buffer
166+
*
167+
* @return #SAI_STATUS_SUCCESS on success when all objects are created or
168+
* #SAI_STATUS_FAILURE when any of the objects fails to create. When there is
169+
* failure, Caller is expected to go through the list of returned statuses to
170+
* find out which fails and which succeeds.
171+
*/
172+
typedef sai_status_t (*sai_bulk_create_trusted_vni_entry_fn)(
173+
_In_ uint32_t object_count,
174+
_In_ const sai_trusted_vni_entry_t *trusted_vni_entry,
175+
_In_ const uint32_t *attr_count,
176+
_In_ const sai_attribute_t **attr_list,
177+
_In_ sai_bulk_op_error_mode_t mode,
178+
_Out_ sai_status_t *object_statuses);
179+
180+
/**
181+
* @brief Bulk remove trusted VNI entry
182+
*
183+
* @param[in] object_count Number of objects to remove
184+
* @param[in] trusted_vni_entry List of objects to remove
185+
* @param[in] mode Bulk operation error handling mode.
186+
* @param[out] object_statuses List of status for every object. Caller needs to
187+
* allocate the buffer
188+
*
189+
* @return #SAI_STATUS_SUCCESS on success when all objects are removed or
190+
* #SAI_STATUS_FAILURE when any of the objects fails to remove. When there is
191+
* failure, Caller is expected to go through the list of returned statuses to
192+
* find out which fails and which succeeds.
193+
*/
194+
typedef sai_status_t (*sai_bulk_remove_trusted_vni_entry_fn)(
195+
_In_ uint32_t object_count,
196+
_In_ const sai_trusted_vni_entry_t *trusted_vni_entry,
197+
_In_ sai_bulk_op_error_mode_t mode,
198+
_Out_ sai_status_t *object_statuses);
199+
200+
typedef struct _sai_dash_trusted_vni_api_t
201+
{
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;
208+
209+
} sai_dash_trusted_vni_api_t;
210+
211+
/**
212+
* @}
213+
*/
214+
#endif /** __SAIEXPERIMENTALDASHTRUSTEDVNI_H_ */

experimental/saiextensions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "saiportextensions.h"
3535

3636
/* new experimental object type includes */
37+
#include "saiexperimentaldashtrustedvni.h"
3738
#include "saiexperimentaldashappliance.h"
3839
#include "saiexperimentaldashflow.h"
3940
#include "saiexperimentaldashtunnel.h"
@@ -89,6 +90,8 @@ typedef enum _sai_api_extensions_t
8990

9091
SAI_API_DASH_APPLIANCE,
9192

93+
SAI_API_DASH_TRUSTED_VNI,
94+
9295
/* Add new experimental APIs above this line */
9396

9497
SAI_API_EXTENSIONS_RANGE_END

experimental/saitypesextensions.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ typedef enum _sai_object_type_extensions_t
9292

9393
SAI_OBJECT_TYPE_DASH_TUNNEL_NEXT_HOP,
9494

95+
SAI_OBJECT_TYPE_TRUSTED_VNI_ENTRY,
96+
9597
/* Add new experimental object types above this line */
9698

9799
SAI_OBJECT_TYPE_EXTENSIONS_RANGE_END
@@ -335,5 +337,16 @@ typedef enum _sai_dash_flow_sync_state_t
335337

336338
} sai_dash_flow_sync_state_t;
337339

340+
/**
341+
* @brief Defines a list of enums for dash_eni_mode
342+
*/
343+
typedef enum _sai_dash_eni_mode_t
344+
{
345+
SAI_DASH_ENI_MODE_VM,
346+
347+
SAI_DASH_ENI_MODE_FNIC,
348+
349+
} sai_dash_eni_mode_t;
350+
338351
#endif /* __SAITYPESEXTENSIONS_H_ */
339352

inc/saiobject.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include <saiprefixcompression.h>
3939

4040
/* new experimental object type includes */
41+
#include <saiexperimentaldashtrustedvni.h>
4142
#include <saiexperimentaldashtunnel.h>
4243
#include <saiexperimentaldashha.h>
4344
#include <saiexperimentaldashappliance.h>
@@ -129,6 +130,9 @@ typedef union _sai_object_key_entry_t
129130
/** @validonly object_type == SAI_OBJECT_TYPE_FLOW_ENTRY */
130131
sai_flow_entry_t flow_entry;
131132

133+
/** @validonly object_type == SAI_OBJECT_TYPE_TRUSTED_VNI_ENTRY */
134+
sai_trusted_vni_entry_t trusted_vni_entry;
135+
132136
/* Add new experimental entries above this line */
133137

134138
} sai_object_key_entry_t;

0 commit comments

Comments
 (0)