sonic-net / DASH

Disaggregated APIs for SONiC Hosts
Apache License 2.0
80 stars 89 forks source link

[sai-gen] Move default value from template to SAI generation script. #495

Closed r12f closed 8 months ago

r12f commented 8 months ago

Currently, the default value of each SAI attribute is specified in saiapi.h.j2 template, using if-else. This can be simplified by directly using the default value from the type info in SAI generation script.

This change also makes adding more SAI types easier in the future, for both existing types or new types (just like new enums today, we only need to register it to type registry, then everything else will be taken care of).