Skip to content

Commit d0aaeb3

Browse files
committed
[configure] Check for minimal SAI version
since commit 8e1fb37 (v1.8.0) there is check enum binary backward compatibility so we are relaxing this check below, versions do not have to be equal but both need to be at least 2ebde24 (v1.9.0), this will make sure that enums are always ok, but since that commit some data structures changed and are not binary backwad compatible like next hop group api, acl_capability, structs are backward binary compatible from commit aed34c8, which closest tag version for it is commit 3ff228a (v1.12.0), so min version check should be set to (v1.12.0), but some production branches do not use that high SAI version yet, some use even version v1.7.0 which then it is impossible to provide even enum backward compatibility, check those links: opencomputeproject/SAI#1297 (enums) opencomputeproject/SAI#1795 (structs)
1 parent b299bb4 commit d0aaeb3

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

configure.ac

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,24 @@ int main() {
199199
{
200200
return 1;
201201
}
202-
return (version != SAI_API_VERSION);
202+
/*
203+
since commit 8e1fb37 (v1.8.0) there is check enum binary backward compatibility
204+
so we are relaxing this check below, versions do not have to be equal but both
205+
need to be at least 2ebde24 (v1.9.0), this will make sure that enums are always
206+
ok, but since that commit some data structures changed and are not binary
207+
backwad compatible like next hop group api, acl_capability, structs are
208+
backward binary compatible from commit aed34c8, which closest tag version for
209+
it is commit 3ff228a (v1.12.0), so min version check should be set to
210+
(v1.12.0), but some production branches do not use that high SAI version yet,
211+
some use even version v1.7.0 which then it is impossible to provide even enum
212+
backward compatibility, check those links:
213+
https://github.com/opencomputeproject/SAI/pull/1297 (enums)
214+
https://github.com/opencomputeproject/SAI/pull/1795 (structs)
215+
*/
216+
sai_api_version_t minversion = SAI_VERSION(1,9,0);
217+
printf("min SAI version: %ld, sairedis SAI headers version: %ld, vendor lib SAI query api version: %ld\n",
218+
minversion, SAI_API_VERSION, version);
219+
return (version >= minversion) && (SAI_API_VERSION >= minversion);
203220
}],
204221
[AC_MSG_RESULT(ok)],
205222
[AC_MSG_RESULT(failed)

0 commit comments

Comments
 (0)