Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions inc/saiport.h
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,22 @@ typedef enum _sai_port_priority_flow_control_mode_t

} sai_port_priority_flow_control_mode_t;

/**
* @brief MACsec PFC mode
*
* Controls whether PFC frames on a MACsec-enabled port are handled as
* normal clear PFC frames or as encrypted/secure PFC frames.
*/
typedef enum _sai_port_macsec_pfc_mode_t
{
/** Default behavior: clear PFC */
SAI_PORT_MACSEC_PFC_MODE_UNENCRYPTED,

/** Secure / encrypted PFC */
SAI_PORT_MACSEC_PFC_MODE_ENCRYPTED,

} sai_port_macsec_pfc_mode_t;

/**
* @brief PTP mode
* These modes can be used at the port and switch level.
Expand Down Expand Up @@ -1508,6 +1524,18 @@ typedef enum _sai_port_attr_t
*/
SAI_PORT_ATTR_MACSEC_PORT_LIST,

/**
* @brief Configure per-port MACsec PFC mode
*
* When MACsec is not enabled on the port, implementations may ignore this
* attribute and behave as SAI_PORT_MACSEC_PFC_MODE_UNENCRYPTED.
*
* @type sai_port_macsec_pfc_mode_t
* @flags CREATE_AND_SET
* @default SAI_PORT_MACSEC_PFC_MODE_UNENCRYPTED
*/
SAI_PORT_ATTR_MACSEC_PFC_MODE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the SAI_PORT_ATTR_MACSEC_PFC_MODE placed in saiport.h rather than as a SAI_MACSEC_PORT_ATTR_* in saimacsec.h on SAI_OBJECT_TYPE_MACSEC_PORT? All other MACsec port config id defined there. Placing it on the generic port creates GET/SET ambiguity when MACSEC is not enabled on this port.


Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New attr is placed in-between the existing attr - pl note that this placement changes the enum integer values of subsequent port attributes, which is an API break. The SAI community convention is to add new attributes at the end of the list, immediately before SAI_XXX_ATTR_END

/**
* @brief Enable/Disable Mirror session
*
Expand Down
Loading