Skip to content

Commit a0ae84d

Browse files
authored
Add DASH appliance object APIs (opencomputeproject#2073)
Add DASH appliance object APIs (opencomputeproject#2073) Bring in SAI API changes from sonic-net/DASH#616
1 parent e4b4268 commit a0ae84d

File tree

4 files changed

+144
-0
lines changed

4 files changed

+144
-0
lines changed
Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
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 saiexperimentaldashappliance.h
21+
*
22+
* @brief This module defines SAI extensions for DASH appliance
23+
*
24+
* @warning This module is a SAI experimental module
25+
*/
26+
27+
#if !defined (__SAIEXPERIMENTALDASHAPPLIANCE_H_)
28+
#define __SAIEXPERIMENTALDASHAPPLIANCE_H_
29+
30+
#include <saitypesextensions.h>
31+
32+
/**
33+
* @defgroup SAIEXPERIMENTALDASHAPPLIANCE SAI - Experimental: DASH appliance specific API definitions
34+
*
35+
* @{
36+
*/
37+
38+
/**
39+
* @brief Attribute ID for DASH appliance
40+
*/
41+
typedef enum _sai_dash_appliance_attr_t
42+
{
43+
/**
44+
* @brief Start of attributes
45+
*/
46+
SAI_DASH_APPLIANCE_ATTR_START,
47+
48+
/**
49+
* @brief Action parameter local region id
50+
*
51+
* @type sai_uint8_t
52+
* @flags CREATE_AND_SET
53+
* @default 0
54+
*/
55+
SAI_DASH_APPLIANCE_ATTR_LOCAL_REGION_ID = SAI_DASH_APPLIANCE_ATTR_START,
56+
57+
/**
58+
* @brief End of attributes
59+
*/
60+
SAI_DASH_APPLIANCE_ATTR_END,
61+
62+
/** Custom range base value */
63+
SAI_DASH_APPLIANCE_ATTR_CUSTOM_RANGE_START = 0x10000000,
64+
65+
/** End of custom range base */
66+
SAI_DASH_APPLIANCE_ATTR_CUSTOM_RANGE_END,
67+
68+
} sai_dash_appliance_attr_t;
69+
70+
/**
71+
* @brief Create DASH appliance
72+
*
73+
* @param[out] dash_appliance_id Entry id
74+
* @param[in] switch_id Switch id
75+
* @param[in] attr_count Number of attributes
76+
* @param[in] attr_list Array of attributes
77+
*
78+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
79+
*/
80+
typedef sai_status_t (*sai_create_dash_appliance_fn)(
81+
_Out_ sai_object_id_t *dash_appliance_id,
82+
_In_ sai_object_id_t switch_id,
83+
_In_ uint32_t attr_count,
84+
_In_ const sai_attribute_t *attr_list);
85+
86+
/**
87+
* @brief Remove DASH appliance
88+
*
89+
* @param[in] dash_appliance_id Entry id
90+
*
91+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
92+
*/
93+
typedef sai_status_t (*sai_remove_dash_appliance_fn)(
94+
_In_ sai_object_id_t dash_appliance_id);
95+
96+
/**
97+
* @brief Set attribute for DASH appliance
98+
*
99+
* @param[in] dash_appliance_id Entry id
100+
* @param[in] attr Attribute
101+
*
102+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
103+
*/
104+
typedef sai_status_t (*sai_set_dash_appliance_attribute_fn)(
105+
_In_ sai_object_id_t dash_appliance_id,
106+
_In_ const sai_attribute_t *attr);
107+
108+
/**
109+
* @brief Get attribute for DASH appliance
110+
*
111+
* @param[in] dash_appliance_id Entry id
112+
* @param[in] attr_count Number of attributes
113+
* @param[inout] attr_list Array of attributes
114+
*
115+
* @return #SAI_STATUS_SUCCESS on success Failure status code on error
116+
*/
117+
typedef sai_status_t (*sai_get_dash_appliance_attribute_fn)(
118+
_In_ sai_object_id_t dash_appliance_id,
119+
_In_ uint32_t attr_count,
120+
_Inout_ sai_attribute_t *attr_list);
121+
122+
typedef struct _sai_dash_appliance_api_t
123+
{
124+
sai_create_dash_appliance_fn create_dash_appliance;
125+
sai_remove_dash_appliance_fn remove_dash_appliance;
126+
sai_set_dash_appliance_attribute_fn set_dash_appliance_attribute;
127+
sai_get_dash_appliance_attribute_fn get_dash_appliance_attribute;
128+
sai_bulk_object_create_fn create_dash_appliances;
129+
sai_bulk_object_remove_fn remove_dash_appliances;
130+
131+
} sai_dash_appliance_api_t;
132+
133+
/**
134+
* @}
135+
*/
136+
#endif /** __SAIEXPERIMENTALDASHAPPLIANCE_H_ */

experimental/saiextensions.h

Lines changed: 4 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 "saiexperimentaldashappliance.h"
3738
#include "saiexperimentaldashflow.h"
3839
#include "saiexperimentaldashtunnel.h"
3940
#include "saiexperimentaldashha.h"
@@ -85,6 +86,9 @@ typedef enum _sai_api_extensions_t
8586
SAI_API_DASH_TUNNEL,
8687

8788
SAI_API_DASH_FLOW,
89+
90+
SAI_API_DASH_APPLIANCE,
91+
8892
/* Add new experimental APIs above this line */
8993

9094
SAI_API_EXTENSIONS_RANGE_END

experimental/saitypesextensions.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ typedef enum _sai_object_type_extensions_t
8585
SAI_OBJECT_TYPE_FLOW_ENTRY_BULK_GET_SESSION_FILTER,
8686

8787
SAI_OBJECT_TYPE_FLOW_ENTRY_BULK_GET_SESSION,
88+
89+
SAI_OBJECT_TYPE_DASH_APPLIANCE,
90+
8891
/* Add new experimental object types above this line */
8992

9093
SAI_OBJECT_TYPE_EXTENSIONS_RANGE_END

inc/saiobject.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include <saisrv6.h>
3838

3939
/* new experimental object type includes */
40+
#include <saiexperimentaldashappliance.h>
4041
#include <saiexperimentaldashflow.h>
4142
#include <saiexperimentaldashmeter.h>
4243
#include <saiexperimentaldashvip.h>

0 commit comments

Comments
 (0)