-
Notifications
You must be signed in to change notification settings - Fork 554
add SAI definitions for optical circuit switch #2229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Nathan Ni <nathan.ni@coherent.com>
|
Need to add new SAI objects and types for OCS in SAI extension header files. Without the following change, the SAI OCS object/api will not be processed by parser to generating meta data. saiextensions.h saitypesextensions.h |
| * @objects SAI_OBJECT_TYPE_OCS_PORT | ||
| */ | ||
| SAI_OCS_CROSS_CONNECT_ATTR_B_SIDE_PORT_ID, | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we add operational status so user know if a connection is up or down, without looking at the corresponding port status?
/**
* @brief Cross connect operation status
*
* @type sai_ocs_cross_connect_oper_status_t
* @flags READ_ONLY
*/
SAI_OCS_CROSS_CONNECT_ATTR_OPER_STATUS,
| /** | ||
| * @brief Default status for any port which is with no configuration | ||
| */ | ||
| SAI_OCS_PORT_STATUS_BLOCKED, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This default value (SAI_OCS_PORT_STATUS_BLOCKED) conflicts to the default of override_state_t, SAI_OCS_PORT_OVERRIDE_STATE_NORMAL??
| * @brief Overrides the status imposed by the programmed cross-connects | ||
| * | ||
| * @type sai_ocs_port_override_state_t | ||
| * @flags CREATE_AND_SET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In latest SAI version, for CREATE_AND_SET attributors, it is required to have default value flag:
@default SAI_OCS_PORT_OVERRIDE_STATE_NORMAL
Otherwise parser and compile will be error-out. All CREATE_AND_SET attributes need to add @default
| SAI_OCS_PORT_OVERRIDE_STATE_POWERED_OFF, | ||
|
|
||
| /** | ||
| * @brief Default, state to be determined by presence of cross-connect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is port state NORMAL is determined connection present or not?
| /** | ||
| * @brief Start of attributes | ||
| */ | ||
| SAI_OCS_CROSS_CONNECT_ATTR_START, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All new acronyms (non-English words), such as OCS need to be add the in the meta dictionary meta/aspell.en.pws. compile will fail without this.
| * List of center frequency values. Use int32 for representation of decimal value with 3 fraction digits | ||
| * | ||
| * @type sai_s32_list_t | ||
| * @flags READ_ONLY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To convert sai_s32_list_t -> decimal, how does the application code (ex. SWSS) know that it should have 3 decimal digits, without hard code to SAI_OCS_CROSS_CONNECT_FACTORY_DATA_ATTR_FREQUENCY_THZ? For decimal -> sai_s32_list_t, how do we validate that the decimal string is 3 precision digits in redis/NBI?
The decimal precision info should be part of the meta data, so the conversion can done generically. One way is to use sai_s32_t and add a new tag @precision n and so the application can retrieve the number of decimal digits from meta data. The proposal to introduce a new type sai_double_t is dropped due to NAN issue.
Same comments for all decimal representation below.
| * @brief End of attributes | ||
| */ | ||
| SAI_OCS_CROSS_CONNECT_ATTR_END, | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add custom rang for vendor extension (see DASH SAI). same for port attributes.
/** Custom range base value */
SAI_OCS_CROSS_CONNECT_ATTR_CUSTOM_RANGE_START = 0x10000000,
/** End of custom range base */
SAI_OCS_CROSS_CONNECT_ATTR_CUSTOM_RANGE_END
| /** | ||
| * @brief Unique identifier for a port | ||
| * | ||
| * @type sai_u8_list_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for port name why not using @type char?
| * | ||
| * @brief This module defines SAI OCS | ||
| */ | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the following to compatible with SAI extension common practice:
*
* @warning This module is a SAI experimental module.
*/
| /** | ||
| * @brief A side port | ||
| * | ||
| * @type sai_object_id_t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why you don't use port name (a string) in the port attributes? sai_object_id is auto-generated when SAI object is created. Do you want to enforce creating cross-connect after creating ports? This would need extra logic in SWSS? In any case, I think port name A and B are useful info.
Signed-off-by: Nathan Ni <nathan.ni@coherent.com>
Signed-off-by: Nathan Ni <nathan.ni@coherent.com>
Add API definitions for Optical Circuit Switch, mainly including: