Skip to content

Commit 1569aad

Browse files
author
Martin Liao
committed
1. Fix bug in saisanitycheck that there is no check for range
SAI_ACL_ENTRY_ATTR(/_FIELD/_ACTION)_CUSTOM_RANGE_START to SAI_ACL_ENTRY_ATTR(/_FIELD/_ACTION)_CUSTOM_RANGE_END 2. Remove all SAI_*_CUSTOM_RANGE_START/END, using SAI_*_CUSTOM_RANGE_BASE instead. 3. Adjust metadata generator to compitable with above changes. Signed-off-by: Martin Liao <marliao@mtl-vdi-646.wap.labs.mlnx>
1 parent 114ede5 commit 1569aad

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+430
-547
lines changed

doc/custom-headers/saiaclcustom.h

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
/**
2+
* Copyright (c) 2018 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 saiaclcustom.h
21+
*
22+
* @brief This module defines ACL custom of the Switch Abstraction Interface (SAI)
23+
*/
24+
25+
#ifndef __SAIACLCUSTOM_H_
26+
#define __SAIACLCUSTOM_H_
27+
28+
#include <saiacl.h>
29+
30+
/**
31+
* @brief Custom ACL Action Type
32+
*
33+
* @flags free
34+
*/
35+
typedef enum _sai_acl_action_type_custom_t {
36+
/** Start of custom action type. */
37+
SAI_ACL_ACTION_TYPE_CUSTOM_RANGE_START = SAI_ACL_ACTION_TYPE_CUSTOM_RANGE_BASE,
38+
/**
39+
* @brief ACTION TYPE 1
40+
*/
41+
SAI_ACL_ACTION_TYPE_1 = SAI_ACL_ACTION_TYPE_CUSTOM_RANGE_START,
42+
43+
/** End of custom action type. */
44+
SAI_ACL_ACTION_TYPE_CUSTOM_RANGE_END
45+
} sai_acl_action_type_custom_t;
46+
47+
/**
48+
* @brief SAI ACL table attribute custom
49+
*
50+
* @flags free
51+
*/
52+
typedef enum _sai_acl_table_attr_custom_t {
53+
/**
54+
* @brief Start of ACL table custom attributes
55+
*/
56+
SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_START = SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_BASE,
57+
/**
58+
* @brief Custom 1
59+
*
60+
* @type bool
61+
* @flags CREATE_ONLY
62+
* @default false
63+
*/
64+
SAI_ACL_TABLE_ATTR_1,
65+
66+
SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_END,
67+
68+
/**
69+
* @brief Start of ACL table custom field attributes
70+
*/
71+
SAI_ACL_TABLE_ATTR_FIELD_CUSTOM_RANGE_START = SAI_ACL_TABLE_ATTR_FIELD_CUSTOM_RANGE_BASE,
72+
/**
73+
* @brief Custom 1
74+
*
75+
* @type bool
76+
* @flags CREATE_ONLY
77+
* @default false
78+
*/
79+
SAI_ACL_TABLE_ATTR_FIELD_1 = SAI_ACL_TABLE_ATTR_FIELD_CUSTOM_RANGE_START,
80+
/**
81+
* @brief Custom 2
82+
*
83+
* @type bool
84+
* @flags CREATE_ONLY
85+
* @default false
86+
*/
87+
SAI_ACL_TABLE_ATTR_FIELD_2,
88+
89+
/** End of custom range base */
90+
SAI_ACL_TABLE_ATTR_FIELD_CUSTOM_RANGE_END
91+
} sai_acl_table_attr_custom_t;
92+
93+
/**
94+
* @brief SAI ACL entry attribute custom,
95+
*
96+
* @flags free
97+
*/
98+
typedef enum _sai_acl_entry_attr_custom_t {
99+
/**
100+
* @brief Start of ACL entry custom field attributes
101+
*/
102+
SAI_ACL_ENTRY_ATTR_FIELD_CUSTOM_RANGE_START = SAI_ACL_ENTRY_ATTR_FIELD_CUSTOM_RANGE_BASE,
103+
/**
104+
* @brief Custom 1
105+
*
106+
* @type bool
107+
* @flags CREATE_ONLY
108+
* @default false
109+
*/
110+
SAI_ACL_ENTRY_ATTR_FIELD_1 = SAI_ACL_ENTRY_ATTR_FIELD_CUSTOM_RANGE_START,
111+
/**
112+
* @brief Custom 2
113+
*
114+
* @type bool
115+
* @flags CREATE_ONLY
116+
* @default false
117+
*/
118+
SAI_ACL_ENTRY_ATTR_FIELD_2,
119+
120+
/** End of custom range base */
121+
SAI_ACL_ENTRY_ATTR_FIELD_CUSTOM_RANGE_END,
122+
123+
/**
124+
* @brief Start of ACL entry custom action attributes
125+
*/
126+
SAI_ACL_ENTRY_ATTR_ACTION_CUSTOM_RANGE_START = SAI_ACL_ENTRY_ATTR_ACTION_CUSTOM_RANGE_BASE,
127+
/**
128+
* @brief Custom 1
129+
*
130+
* @type bool
131+
* @flags CREATE_ONLY
132+
* @default false
133+
*/
134+
SAI_ACL_ENTRY_ATTR_ACTION_1 = SAI_ACL_ENTRY_ATTR_ACTION_CUSTOM_RANGE_START,
135+
136+
/** End of ACL entry custom action attributes */
137+
SAI_ACL_ENTRY_ATTR_ACTION_CUSTOM_RANGE_END
138+
} sai_acl_entry_attr_custom_t;
139+
140+
#endif /* __SAIACLCUSTOM_H_ */

doc/custom-headers/saiportcustom.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
*/
3636
typedef enum _sai_port_attr_custom_t
3737
{
38+
SAI_PORT_ATTR_CUSTOM_RANGE_START = SAI_PORT_ATTR_CUSTOM_RANGE_BASE,
3839
/**
3940
* @brief Custom 1
4041
*
@@ -43,6 +44,8 @@ typedef enum _sai_port_attr_custom_t
4344
*/
4445
SAI_PORT_ATTR_CUSTOM1 = SAI_PORT_ATTR_CUSTOM_RANGE_START,
4546

47+
SAI_PORT_ATTR_CUSTOM_RANGE_END
48+
4649
/* Add new csutom port attributes above this line */
4750

4851
} sai_port_attr_custom_t;

inc/saiacl.h

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ typedef enum _sai_acl_action_type_t
304304
/** Bind a TAM object */
305305
SAI_ACL_ACTION_TYPE_TAM_OBJECT = 0x0000003d,
306306

307+
/** Custom range base of ACL action type */
308+
SAI_ACL_ACTION_TYPE_CUSTOM_RANGE_BASE = 0x10000000
309+
307310
} sai_acl_action_type_t;
308311

309312
/**
@@ -408,14 +411,9 @@ typedef enum _sai_acl_table_group_attr_t
408411
SAI_ACL_TABLE_GROUP_ATTR_END,
409412

410413
/**
411-
* @brief Custom range base value start
414+
* @brief Custom range base value
412415
*/
413-
SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000,
414-
415-
/**
416-
* @brief End of Custom range base
417-
*/
418-
SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_END
416+
SAI_ACL_TABLE_GROUP_ATTR_CUSTOM_RANGE_BASE = 0x10000000
419417

420418
} sai_acl_table_group_attr_t;
421419

@@ -467,14 +465,9 @@ typedef enum _sai_acl_table_chain_group_attr_t
467465
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_END,
468466

469467
/**
470-
* @brief Custom range base value start
471-
*/
472-
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_CUSTOM_RANGE_START = 0x10000000,
473-
474-
/**
475-
* @brief End of Custom range base
468+
* @brief Custom range base value
476469
*/
477-
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_CUSTOM_RANGE_END
470+
SAI_ACL_TABLE_CHAIN_GROUP_ATTR_CUSTOM_RANGE_BASE = 0x10000000
478471

479472
} sai_acl_table_chain_group_attr_t;
480473

@@ -553,14 +546,9 @@ typedef enum _sai_acl_table_group_member_attr_t
553546
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_END,
554547

555548
/**
556-
* @brief Custom range base value start
557-
*/
558-
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_START = 0x10000000,
559-
560-
/**
561-
* @brief End of Custom range base
549+
* @brief Custom range base value
562550
*/
563-
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_END
551+
SAI_ACL_TABLE_GROUP_MEMBER_ATTR_CUSTOM_RANGE_BASE = 0x10000000
564552

565553
} sai_acl_table_group_member_attr_t;
566554

@@ -1699,14 +1687,14 @@ typedef enum _sai_acl_table_attr_t
16991687
SAI_ACL_TABLE_ATTR_END,
17001688

17011689
/**
1702-
* @brief Custom range base value start
1690+
* @brief Custom range base value
17031691
*/
1704-
SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_START = 0x10000000,
1692+
SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_BASE = 0x10000000,
17051693

17061694
/**
1707-
* @brief End of Custom range base
1695+
* @brief Custom field attribute range base value
17081696
*/
1709-
SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_END
1697+
SAI_ACL_TABLE_ATTR_FIELD_CUSTOM_RANGE_BASE = SAI_ACL_TABLE_ATTR_CUSTOM_RANGE_BASE + 0x00001000
17101698

17111699
} sai_acl_table_attr_t;
17121700

@@ -3387,11 +3375,20 @@ typedef enum _sai_acl_entry_attr_t
33873375
*/
33883376
SAI_ACL_ENTRY_ATTR_END,
33893377

3390-
/** Custom range base value */
3391-
SAI_ACL_ENTRY_ATTR_CUSTOM_RANGE_START = 0x10000000,
3378+
/**
3379+
* @brief Custom range base value
3380+
*/
3381+
SAI_ACL_ENTRY_ATTR_CUSTOM_RANGE_BASE = 0x10000000,
3382+
3383+
/**
3384+
* @brief Base value of custom ACL_ENTRY_ATTR_FIELD
3385+
*/
3386+
SAI_ACL_ENTRY_ATTR_FIELD_CUSTOM_RANGE_BASE = SAI_ACL_ENTRY_ATTR_CUSTOM_RANGE_BASE + 0x00001000,
33923387

3393-
/** End of custom range base */
3394-
SAI_ACL_ENTRY_ATTR_CUSTOM_RANGE_END
3388+
/**
3389+
* @brief Base value of custom ACL_ENTRY_ATTR_ACTION
3390+
*/
3391+
SAI_ACL_ENTRY_ATTR_ACTION_CUSTOM_RANGE_BASE = SAI_ACL_ENTRY_ATTR_CUSTOM_RANGE_BASE + 0x00002000
33953392

33963393
} sai_acl_entry_attr_t;
33973394

@@ -3473,10 +3470,7 @@ typedef enum _sai_acl_counter_attr_t
34733470
SAI_ACL_COUNTER_ATTR_END,
34743471

34753472
/** Custom range base value */
3476-
SAI_ACL_COUNTER_ATTR_CUSTOM_RANGE_START = 0x10000000,
3477-
3478-
/** End of custom range base */
3479-
SAI_ACL_COUNTER_ATTR_CUSTOM_RANGE_END
3473+
SAI_ACL_COUNTER_ATTR_CUSTOM_RANGE_BASE = 0x10000000
34803474

34813475
} sai_acl_counter_attr_t;
34823476

@@ -3541,10 +3535,7 @@ typedef enum _sai_acl_range_attr_t
35413535
SAI_ACL_RANGE_ATTR_END,
35423536

35433537
/** Custom range base value */
3544-
SAI_ACL_RANGE_ATTR_CUSTOM_RANGE_START = 0x10000000,
3545-
3546-
/** End of custom range base */
3547-
SAI_ACL_RANGE_ATTR_CUSTOM_RANGE_END
3538+
SAI_ACL_RANGE_ATTR_CUSTOM_RANGE_BASE = 0x10000000
35483539

35493540
} sai_acl_range_attr_t;
35503541

inc/saiars.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,7 @@ typedef enum _sai_ars_attr_t
166166
SAI_ARS_ATTR_END,
167167

168168
/** Custom range base value */
169-
SAI_ARS_ATTR_CUSTOM_RANGE_START = 0x10000000,
170-
171-
/** End of custom range base */
172-
SAI_ARS_ATTR_CUSTOM_RANGE_END
169+
SAI_ARS_ATTR_CUSTOM_RANGE_BASE = 0x10000000,
173170

174171
} sai_ars_attr_t;
175172

inc/saiarsprofile.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -467,10 +467,7 @@ typedef enum _sai_ars_profile_attr_t
467467
SAI_ARS_PROFILE_ATTR_END,
468468

469469
/** Custom range base value */
470-
SAI_ARS_PROFILE_ATTR_CUSTOM_RANGE_START = 0x10000000,
471-
472-
/** End of custom range base */
473-
SAI_ARS_PROFILE_ATTR_CUSTOM_RANGE_END
470+
SAI_ARS_PROFILE_ATTR_CUSTOM_RANGE_BASE = 0x10000000
474471

475472
} sai_ars_profile_attr_t;
476473

inc/saibfd.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -549,10 +549,7 @@ typedef enum _sai_bfd_session_attr_t
549549
SAI_BFD_SESSION_ATTR_END,
550550

551551
/** Custom range base value */
552-
SAI_BFD_SESSION_ATTR_CUSTOM_RANGE_START = 0x10000000,
553-
554-
/** End of custom range base */
555-
SAI_BFD_SESSION_ATTR_CUSTOM_RANGE_END
552+
SAI_BFD_SESSION_ATTR_CUSTOM_RANGE_BASE = 0x10000000
556553

557554
} sai_bfd_session_attr_t;
558555

inc/saibridge.h

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,10 @@ typedef enum _sai_bridge_port_attr_t
359359
*/
360360
SAI_BRIDGE_PORT_ATTR_END,
361361

362-
/** Custom range base value */
363-
SAI_BRIDGE_PORT_ATTR_CUSTOM_RANGE_START = 0x10000000,
364-
365-
/** End of custom range base */
366-
SAI_BRIDGE_PORT_ATTR_CUSTOM_RANGE_END
362+
/**
363+
* @brief Custom range base value
364+
*/
365+
SAI_BRIDGE_PORT_ATTR_CUSTOM_RANGE_BASE = 0x10000000
367366

368367
} sai_bridge_port_attr_t;
369368

@@ -685,11 +684,10 @@ typedef enum _sai_bridge_attr_t
685684
*/
686685
SAI_BRIDGE_ATTR_END,
687686

688-
/** Custom range base value */
689-
SAI_BRIDGE_ATTR_CUSTOM_RANGE_START = 0x10000000,
690-
691-
/** End of custom range base */
692-
SAI_BRIDGE_ATTR_CUSTOM_RANGE_END
687+
/**
688+
* @brief Custom range base value
689+
*/
690+
SAI_BRIDGE_ATTR_CUSTOM_RANGE_BASE = 0x10000000
693691

694692
} sai_bridge_attr_t;
695693

0 commit comments

Comments
 (0)