Skip to content

Commit 8793562

Browse files
marian-pritsaklguohan
authored andcommitted
Update SAI pointer to latest master (sonic-net#408)
* Update SAI pointer to latest master Signed-off-by: Marian Pritsak <marianp@mellanox.com> * Use SAI_EXTENSIONS_TYPE_MAX Signed-off-by: Marian Pritsak <marianp@mellanox.com>
1 parent b1b739b commit 8793562

24 files changed

+102
-166
lines changed

SAI

Submodule SAI updated 330 files

lib/inc/sai_redis_internal.h

+55-55
Original file line numberDiff line numberDiff line change
@@ -3,64 +3,64 @@
33

44
// object id
55

6-
#define REDIS_CREATE(OBJECT_TYPE,object_type) \
7-
sai_status_t redis_create_ ## object_type( \
8-
_Out_ sai_object_id_t *object_type ##_id, \
9-
_In_ sai_object_id_t switch_id, \
10-
_In_ uint32_t attr_count, \
11-
_In_ const sai_attribute_t *attr_list) \
12-
{ \
13-
MUTEX(); \
14-
SWSS_LOG_ENTER(); \
15-
return meta_sai_create_oid( \
16-
SAI_OBJECT_TYPE_ ## OBJECT_TYPE, \
17-
object_type ## _id, \
18-
switch_id, \
19-
attr_count, \
20-
attr_list, \
21-
&redis_generic_create); \
6+
#define REDIS_CREATE(OBJECT_TYPE,object_type) \
7+
sai_status_t redis_create_ ## object_type( \
8+
_Out_ sai_object_id_t *object_type ##_id, \
9+
_In_ sai_object_id_t switch_id, \
10+
_In_ uint32_t attr_count, \
11+
_In_ const sai_attribute_t *attr_list) \
12+
{ \
13+
MUTEX(); \
14+
SWSS_LOG_ENTER(); \
15+
return meta_sai_create_oid( \
16+
(sai_object_type_t)SAI_OBJECT_TYPE_ ## OBJECT_TYPE, \
17+
object_type ## _id, \
18+
switch_id, \
19+
attr_count, \
20+
attr_list, \
21+
&redis_generic_create); \
2222
}
2323

24-
#define REDIS_REMOVE(OBJECT_TYPE,object_type) \
25-
sai_status_t redis_remove_ ## object_type( \
26-
_In_ sai_object_id_t object_type ## _id) \
27-
{ \
28-
MUTEX(); \
29-
SWSS_LOG_ENTER(); \
30-
return meta_sai_remove_oid( \
31-
SAI_OBJECT_TYPE_ ## OBJECT_TYPE, \
32-
object_type ## _id, \
33-
&redis_generic_remove); \
24+
#define REDIS_REMOVE(OBJECT_TYPE,object_type) \
25+
sai_status_t redis_remove_ ## object_type( \
26+
_In_ sai_object_id_t object_type ## _id) \
27+
{ \
28+
MUTEX(); \
29+
SWSS_LOG_ENTER(); \
30+
return meta_sai_remove_oid( \
31+
(sai_object_type_t)SAI_OBJECT_TYPE_ ## OBJECT_TYPE, \
32+
object_type ## _id, \
33+
&redis_generic_remove); \
3434
}
3535

36-
#define REDIS_SET(OBJECT_TYPE,object_type) \
37-
sai_status_t redis_set_ ##object_type ## _attribute(\
38-
_In_ sai_object_id_t object_type ## _id, \
39-
_In_ const sai_attribute_t *attr) \
40-
{ \
41-
MUTEX(); \
42-
SWSS_LOG_ENTER(); \
43-
return meta_sai_set_oid( \
44-
SAI_OBJECT_TYPE_ ## OBJECT_TYPE, \
45-
object_type ## _id, \
46-
attr, \
47-
&redis_generic_set); \
36+
#define REDIS_SET(OBJECT_TYPE,object_type) \
37+
sai_status_t redis_set_ ##object_type ## _attribute( \
38+
_In_ sai_object_id_t object_type ## _id, \
39+
_In_ const sai_attribute_t *attr) \
40+
{ \
41+
MUTEX(); \
42+
SWSS_LOG_ENTER(); \
43+
return meta_sai_set_oid( \
44+
(sai_object_type_t)SAI_OBJECT_TYPE_ ## OBJECT_TYPE, \
45+
object_type ## _id, \
46+
attr, \
47+
&redis_generic_set); \
4848
}
4949

50-
#define REDIS_GET(OBJECT_TYPE,object_type) \
51-
sai_status_t redis_get_ ##object_type ## _attribute(\
52-
_In_ sai_object_id_t object_type ## _id, \
53-
_In_ uint32_t attr_count, \
54-
_Inout_ sai_attribute_t *attr_list) \
55-
{ \
56-
MUTEX(); \
57-
SWSS_LOG_ENTER(); \
58-
return meta_sai_get_oid( \
59-
SAI_OBJECT_TYPE_ ## OBJECT_TYPE, \
60-
object_type ## _id, \
61-
attr_count, \
62-
attr_list, \
63-
&redis_generic_get); \
50+
#define REDIS_GET(OBJECT_TYPE,object_type) \
51+
sai_status_t redis_get_ ##object_type ## _attribute( \
52+
_In_ sai_object_id_t object_type ## _id, \
53+
_In_ uint32_t attr_count, \
54+
_Inout_ sai_attribute_t *attr_list) \
55+
{ \
56+
MUTEX(); \
57+
SWSS_LOG_ENTER(); \
58+
return meta_sai_get_oid( \
59+
(sai_object_type_t)SAI_OBJECT_TYPE_ ## OBJECT_TYPE, \
60+
object_type ## _id, \
61+
attr_count, \
62+
attr_list, \
63+
&redis_generic_get); \
6464
}
6565

6666
#define REDIS_GENERIC_QUAD(OT,ot) \
@@ -145,7 +145,7 @@
145145
sai_status_t redis_get_ ## object_type ## _stats( \
146146
_In_ sai_object_id_t object_type ## _id, \
147147
_In_ uint32_t number_of_counters, \
148-
_In_ const sai_ ## object_type ## _stat_t *counter_ids, \
148+
_In_ const sai_stat_id_t *counter_ids, \
149149
_Out_ uint64_t *counters) \
150150
{ \
151151
MUTEX(); \
@@ -164,7 +164,7 @@
164164
sai_status_t redis_get_ ## object_type ## _stats_ext( \
165165
_In_ sai_object_id_t object_type ## _id, \
166166
_In_ uint32_t number_of_counters, \
167-
_In_ const sai_ ## object_type ## _stat_t *counter_ids, \
167+
_In_ const sai_stat_id_t *counter_ids, \
168168
_In_ sai_stats_mode_t mode, \
169169
_Out_ uint64_t *counters) \
170170
{ \
@@ -184,7 +184,7 @@
184184
sai_status_t redis_clear_ ## object_type ## _stats( \
185185
_In_ sai_object_id_t object_type ## _id, \
186186
_In_ uint32_t number_of_counters, \
187-
_In_ const sai_ ## object_type ## _stat_t *counter_ids) \
187+
_In_ const sai_stat_id_t *counter_ids) \
188188
{ \
189189
MUTEX(); \
190190
SWSS_LOG_ENTER(); \

lib/src/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta
1+
AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta -I$(top_srcdir)/SAI/experimental
22

33
if DEBUG
44
DBGFLAGS = -ggdb -D_DEBUG_

lib/src/sai_redis_generic_create.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ sai_object_type_t sai_object_type_query(
8888

8989
sai_object_type_t ot = (sai_object_type_t)((object_id >> 48) & 0xFF);
9090

91-
if (ot == SAI_OBJECT_TYPE_NULL || ot >= SAI_OBJECT_TYPE_MAX)
91+
if (ot == SAI_OBJECT_TYPE_NULL || ot >= SAI_OBJECT_TYPE_EXTENSIONS_MAX)
9292
{
9393
SWSS_LOG_ERROR("invalid object id 0x%lx", object_id);
9494

@@ -156,7 +156,7 @@ sai_object_id_t redis_create_virtual_object_id(
156156
SWSS_LOG_ENTER();
157157

158158
if ((object_type <= SAI_OBJECT_TYPE_NULL) ||
159-
(object_type >= SAI_OBJECT_TYPE_MAX))
159+
(object_type >= SAI_OBJECT_TYPE_EXTENSIONS_MAX))
160160
{
161161
SWSS_LOG_THROW("invalid objct type: %d", object_type);
162162
}

lib/src/sai_redis_uburst.cpp

+2-14
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,12 @@
22
#include "sai_redis_internal.h"
33

44
REDIS_GENERIC_QUAD(TAM_MICROBURST,tam_microburst);
5+
REDIS_GENERIC_STATS(TAM_MICROBURST,tam_microburst);
56
REDIS_GENERIC_QUAD(TAM_HISTOGRAM,tam_histogram);
67

7-
sai_status_t redis_get_tam_histogram_stats(
8-
_In_ sai_object_id_t tam_histogram_id,
9-
_Inout_ uint32_t *number_of_counters,
10-
_Out_ uint64_t *counters)
11-
{
12-
MUTEX();
13-
14-
SWSS_LOG_ENTER();
15-
16-
return SAI_STATUS_NOT_IMPLEMENTED;
17-
}
18-
198
const sai_uburst_api_t redis_uburst_api = {
209

2110
REDIS_GENERIC_QUAD_API(tam_microburst)
11+
REDIS_GENERIC_STATS_API(tam_microburst)
2212
REDIS_GENERIC_QUAD_API(tam_histogram)
23-
24-
redis_get_tam_histogram_stats
2513
};

meta/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# since we have SAI sumbodule we will use submodule headers
2-
AM_CPPFLAGS = -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta
2+
AM_CPPFLAGS = -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta -I$(top_srcdir)/SAI/experimental
33

44
if DEBUG
55
DBGFLAGS = -ggdb -D_DEBUG_

meta/sai_meta.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -5533,7 +5533,7 @@ sai_status_t meta_sai_validate_oid(
55335533
SWSS_LOG_ENTER();
55345534

55355535
if (object_type <= SAI_OBJECT_TYPE_NULL ||
5536-
object_type >= SAI_OBJECT_TYPE_MAX)
5536+
object_type >= SAI_OBJECT_TYPE_EXTENSIONS_MAX)
55375537
{
55385538
SWSS_LOG_ERROR("invalid object type specified: %d, FIXME", object_type);
55395539
return SAI_STATUS_INVALID_PARAMETER;

meta/sai_serialize.h

-12
Original file line numberDiff line numberDiff line change
@@ -267,18 +267,6 @@ void sai_deserialize_free_queue_deadlock_ntf(
267267
_In_ uint32_t count,
268268
_In_ sai_queue_deadlock_notification_data_t* deadlock_data);
269269

270-
void sai_deserialize_port_stat(
271-
_In_ const std::string& s,
272-
_Out_ sai_port_stat_t& stat);
273-
274-
void sai_deserialize_queue_stat(
275-
_In_ const std::string& s,
276-
_Out_ sai_queue_stat_t& stat);
277-
278-
void sai_deserialize_ingress_priority_group_stat(
279-
_In_ const std::string& s,
280-
_Out_ sai_ingress_priority_group_stat_t& stat);
281-
282270
void sai_deserialize_ingress_priority_group_attr(
283271
_In_ const std::string& s,
284272
_Out_ sai_ingress_priority_group_attr_t& attr);

meta/saiserialize.cpp

+2-29
Original file line numberDiff line numberDiff line change
@@ -1603,7 +1603,7 @@ std::string sai_serialize_object_meta_key(
16031603

16041604
std::string key;
16051605

1606-
if (meta_key.objecttype == SAI_OBJECT_TYPE_NULL || meta_key.objecttype >= SAI_OBJECT_TYPE_MAX)
1606+
if (meta_key.objecttype == SAI_OBJECT_TYPE_NULL || meta_key.objecttype >= SAI_OBJECT_TYPE_EXTENSIONS_MAX)
16071607
{
16081608
SWSS_LOG_THROW("invalid object type value %s", sai_serialize_object_type(meta_key.objecttype).c_str());
16091609
}
@@ -2631,7 +2631,7 @@ void sai_deserialize_object_meta_key(
26312631

26322632
sai_deserialize_object_type(str_object_type, meta_key.objecttype);
26332633

2634-
if (meta_key.objecttype == SAI_OBJECT_TYPE_NULL || meta_key.objecttype >= SAI_OBJECT_TYPE_MAX)
2634+
if (meta_key.objecttype == SAI_OBJECT_TYPE_NULL || meta_key.objecttype >= SAI_OBJECT_TYPE_EXTENSIONS_MAX)
26352635
{
26362636
SWSS_LOG_THROW("invalid object type value %s", sai_serialize_object_type(meta_key.objecttype).c_str());
26372637
}
@@ -2943,33 +2943,6 @@ void sai_deserialize_free_queue_deadlock_ntf(
29432943
delete[] queue_deadlock;
29442944
}
29452945

2946-
void sai_deserialize_port_stat(
2947-
_In_ const std::string& s,
2948-
_Out_ sai_port_stat_t& stat)
2949-
{
2950-
SWSS_LOG_ENTER();
2951-
2952-
sai_deserialize_enum(s, &sai_metadata_enum_sai_port_stat_t, (int32_t&)stat);
2953-
}
2954-
2955-
void sai_deserialize_queue_stat(
2956-
_In_ const std::string& s,
2957-
_Out_ sai_queue_stat_t& stat)
2958-
{
2959-
SWSS_LOG_ENTER();
2960-
2961-
sai_deserialize_enum(s, &sai_metadata_enum_sai_queue_stat_t, (int32_t&)stat);
2962-
}
2963-
2964-
void sai_deserialize_ingress_priority_group_stat(
2965-
_In_ const std::string& s,
2966-
_Out_ sai_ingress_priority_group_stat_t& stat)
2967-
{
2968-
SWSS_LOG_ENTER();
2969-
2970-
sai_deserialize_enum(s, &sai_metadata_enum_sai_ingress_priority_group_stat_t, (int32_t&)stat);
2971-
}
2972-
29732946
void sai_deserialize_ingress_priority_group_attr(
29742947
_In_ const std::string& s,
29752948
_Out_ sai_ingress_priority_group_attr_t& attr)

meta/tests.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ sai_object_type_t sai_object_type_query(
4040
sai_object_type_t objecttype = (sai_object_type_t)((oid >> 48) & 0xFF);
4141

4242
if ((objecttype <= SAI_OBJECT_TYPE_NULL) ||
43-
(objecttype >= SAI_OBJECT_TYPE_MAX))
43+
(objecttype >= SAI_OBJECT_TYPE_EXTENSIONS_MAX))
4444
{
4545
SWSS_LOG_THROW("invalid oid 0x%lx", oid);
4646
}
@@ -98,7 +98,7 @@ sai_object_id_t create_dummy_object_id(
9898
SWSS_LOG_ENTER();
9999

100100
if ((object_type <= SAI_OBJECT_TYPE_NULL) ||
101-
(object_type >= SAI_OBJECT_TYPE_MAX))
101+
(object_type >= SAI_OBJECT_TYPE_EXTENSIONS_MAX))
102102
{
103103
SWSS_LOG_THROW("invalid objct type: %d", object_type);
104104
}

saidiscovery/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AM_CPPFLAGS = -I$(top_srcdir)/vslib/inc -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta
1+
AM_CPPFLAGS = -I$(top_srcdir)/vslib/inc -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta -I$(top_srcdir)/SAI/experimental
22

33
bin_PROGRAMS = saidiscovery
44

saidump/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AM_CPPFLAGS = -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta
1+
AM_CPPFLAGS = -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta -I$(top_srcdir)/SAI/experimental
22

33
bin_PROGRAMS = saidump
44

saiplayer/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AM_CPPFLAGS = -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta
1+
AM_CPPFLAGS = -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta -I$(top_srcdir)/SAI/experimental
22

33
bin_PROGRAMS = saiplayer
44

saisdkdump/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AM_CPPFLAGS = -I$(top_srcdir)/vslib/inc -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta
1+
AM_CPPFLAGS = -I$(top_srcdir)/vslib/inc -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta -I$(top_srcdir)/SAI/experimental
22

33
bin_PROGRAMS = saisdkdump
44

syncd/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AM_CPPFLAGS = -I$(top_srcdir)/vslib/inc -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta
1+
AM_CPPFLAGS = -I$(top_srcdir)/vslib/inc -I$(top_srcdir)/lib/inc -I$(top_srcdir)/SAI/inc -I$(top_srcdir)/SAI/meta -I$(top_srcdir)/SAI/experimental
22

33
bin_PROGRAMS = syncd syncd_request_shutdown tests
44

syncd/syncd.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -1816,7 +1816,7 @@ std::vector<T> extractCounterIdsGeneric(
18161816
{
18171817
std::string field = fvField(v);
18181818
T counterId;
1819-
deserializeIdFn(field, counterId);
1819+
deserializeIdFn(field.c_str(), &counterId);
18201820

18211821
counterIdList.push_back(counterId);
18221822
}
@@ -1842,7 +1842,7 @@ sai_status_t getStatsGeneric(
18421842
return getStatsFn(
18431843
object_id,
18441844
(uint32_t)counter_ids.size(),
1845-
counter_ids.data(),
1845+
(const sai_stat_id_t*)counter_ids.data(),
18461846
counters.data());
18471847
}
18481848

@@ -2626,7 +2626,7 @@ sai_status_t processEvent(
26262626
* TODO: use metadata utils is object type valid.
26272627
*/
26282628

2629-
if (object_type == SAI_OBJECT_TYPE_NULL || object_type >= SAI_OBJECT_TYPE_MAX)
2629+
if (object_type == SAI_OBJECT_TYPE_NULL || object_type >= SAI_OBJECT_TYPE_EXTENSIONS_MAX)
26302630
{
26312631
SWSS_LOG_THROW("undefined object type %s", sai_serialize_object_type(object_type).c_str());
26322632
}
@@ -2906,7 +2906,7 @@ void processFlexCounterEvent(
29062906
for (const auto &str : idStrings)
29072907
{
29082908
sai_port_stat_t stat;
2909-
sai_deserialize_port_stat(str, stat);
2909+
sai_deserialize_port_stat(str.c_str(), &stat);
29102910
portCounterIds.push_back(stat);
29112911
}
29122912
FlexCounter::setPortCounterList(vid, rid, groupName, portCounterIds);
@@ -2917,7 +2917,7 @@ void processFlexCounterEvent(
29172917
for (const auto &str : idStrings)
29182918
{
29192919
sai_queue_stat_t stat;
2920-
sai_deserialize_queue_stat(str, stat);
2920+
sai_deserialize_queue_stat(str.c_str(), &stat);
29212921
queueCounterIds.push_back(stat);
29222922
}
29232923
FlexCounter::setQueueCounterList(vid, rid, groupName, queueCounterIds);
@@ -2940,7 +2940,7 @@ void processFlexCounterEvent(
29402940
for (const auto &str : idStrings)
29412941
{
29422942
sai_ingress_priority_group_stat_t stat;
2943-
sai_deserialize_ingress_priority_group_stat(str, stat);
2943+
sai_deserialize_ingress_priority_group_stat(str.c_str(), &stat);
29442944
pgCounterIds.push_back(stat);
29452945
}
29462946
FlexCounter::setPriorityGroupCounterList(vid, rid, groupName, pgCounterIds);

syncd/syncd_applyview.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -6589,7 +6589,7 @@ void logViewObjectCount(
65896589

65906590
bool asic_changes = false;
65916591

6592-
for (int i = SAI_OBJECT_TYPE_NULL + 1; i < SAI_OBJECT_TYPE_MAX; i++)
6592+
for (int i = SAI_OBJECT_TYPE_NULL + 1; i < SAI_OBJECT_TYPE_EXTENSIONS_MAX; i++)
65936593
{
65946594
sai_object_type_t ot = (sai_object_type_t)i;
65956595

0 commit comments

Comments
 (0)