Skip to content
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

Changes for supporting some PHY Diagnostics #1527

Merged
merged 5 commits into from
Aug 4, 2022
Merged
Show file tree
Hide file tree
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
32 changes: 32 additions & 0 deletions inc/saiport.h
Original file line number Diff line number Diff line change
Expand Up @@ -2104,6 +2104,38 @@ typedef enum _sai_port_attr_t
*/
SAI_PORT_ATTR_SUPPORTED_LINK_TRAINING_MODE,

/**
* @brief List of port's PMD lanes rx signal detect
*
* @type sai_port_lane_latch_status_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_RX_SIGNAL_DETECT,

/**
* @brief List of port's PMD lanes rx lock status
*
* @type sai_port_lane_latch_status_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_RX_LOCK_STATUS,

/**
* @brief Port's PCS RX Link Status
*
* @type sai_latch_status_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_PCS_RX_LINK_STATUS,

/**
* @brief List of port's FEC lanes alignment marker lock
*
* @type sai_port_lane_latch_status_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_FEC_ALIGNMENT_LOCK,

/**
* @brief End of attributes
*/
Expand Down
27 changes: 27 additions & 0 deletions inc/saitypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,27 @@ typedef struct _sai_prbs_rx_state_t
uint32_t error_count;
} sai_prbs_rx_state_t;

typedef struct _sai_latch_status_t
{
/** Current status at the time of read */
bool current_status;

/** Indicates that the status changed at least once since the last read */
bool changed;
} sai_latch_status_t;

typedef struct _sai_port_lane_latch_status_t
{
uint32_t lane;
sai_latch_status_t value;
} sai_port_lane_latch_status_t;

typedef struct _sai_port_lane_latch_status_list_t
{
uint32_t count;
sai_port_lane_latch_status_t *list;
} sai_port_lane_latch_status_list_t;

/**
* @brief Field match mask
*
Expand Down Expand Up @@ -1308,6 +1329,12 @@ typedef union _sai_attribute_value_t

/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_PORT_ERR_STATUS_LIST */
sai_port_err_status_list_t porterror;

/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_PORT_LANE_LATCH_STATUS_LIST */
sai_port_lane_latch_status_list_t portlanelatchstatuslist;

/** @validonly meta->attrvaluetype == SAI_ATTR_VALUE_TYPE_LATCH_STATUS */
sai_latch_status_t latchstatus;
} sai_attribute_value_t;

/**
Expand Down
2 changes: 2 additions & 0 deletions meta/acronyms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,11 @@ P4RT - Programming Protocol-independent Packet Processors Runtime
PAM4 - Pulse Amplitude Modulation 4-level
PBS - Peak Burst Size
PCI - Peripheral Component Interconnect
PCS - Physical Coding Sublayer
PFC - Priority Flow Control
PHP - Penultimate Hop Pop
PIR - Peak Information Rate
PMD - Physical Medium Dependent
PN - Packet Number
PRBS - Pseudorandom binary sequence
PSC - PHB Scheduling Class
Expand Down
9 changes: 9 additions & 0 deletions meta/saimetadatatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,15 @@ typedef enum _sai_attr_value_type_t
*/
SAI_ATTR_VALUE_TYPE_AUTH_KEY,

/**
* @brief Attribute value is a latch's status.
*/
SAI_ATTR_VALUE_TYPE_LATCH_STATUS,

/**
* @brief Attribute value is a list of latch status for all lanes in a port.
*/
SAI_ATTR_VALUE_TYPE_PORT_LANE_LATCH_STATUS_LIST,
} sai_attr_value_type_t;

/**
Expand Down
7 changes: 7 additions & 0 deletions meta/saisanitycheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ void check_attr_object_type_provided(
case SAI_ATTR_VALUE_TYPE_SEGMENT_LIST:
case SAI_ATTR_VALUE_TYPE_IP_ADDRESS_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_EYE_VALUES_LIST:
case SAI_ATTR_VALUE_TYPE_LATCH_STATUS:
case SAI_ATTR_VALUE_TYPE_PORT_LANE_LATCH_STATUS_LIST:
case SAI_ATTR_VALUE_TYPE_TIMESPEC:

case SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_BOOL:
Expand Down Expand Up @@ -964,6 +966,7 @@ void check_attr_default_required(
case SAI_ATTR_VALUE_TYPE_MAP_LIST:
case SAI_ATTR_VALUE_TYPE_IP_ADDRESS_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_EYE_VALUES_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_LANE_LATCH_STATUS_LIST:
case SAI_ATTR_VALUE_TYPE_SYSTEM_PORT_CONFIG_LIST:

if (((md->objecttype == SAI_OBJECT_TYPE_PORT) || (md->objecttype == SAI_OBJECT_TYPE_PORT_SERDES))
Expand Down Expand Up @@ -1167,6 +1170,7 @@ void check_attr_default_value_type(
case SAI_ATTR_VALUE_TYPE_MAP_LIST:
case SAI_ATTR_VALUE_TYPE_IP_ADDRESS_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_EYE_VALUES_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_LANE_LATCH_STATUS_LIST:
case SAI_ATTR_VALUE_TYPE_SYSTEM_PORT_CONFIG_LIST:
break;

Expand Down Expand Up @@ -1766,6 +1770,7 @@ void check_attr_allow_flags(
case SAI_ATTR_VALUE_TYPE_SEGMENT_LIST:
case SAI_ATTR_VALUE_TYPE_IP_ADDRESS_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_EYE_VALUES_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_LANE_LATCH_STATUS_LIST:
case SAI_ATTR_VALUE_TYPE_ACL_FIELD_DATA_UINT8_LIST:
case SAI_ATTR_VALUE_TYPE_SYSTEM_PORT_CONFIG_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_ERR_STATUS_LIST:
Expand Down Expand Up @@ -2610,6 +2615,7 @@ void check_attr_is_primitive(
case SAI_ATTR_VALUE_TYPE_SYSTEM_PORT_CONFIG_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_ERR_STATUS_LIST:
case SAI_ATTR_VALUE_TYPE_UINT16_RANGE_LIST:
case SAI_ATTR_VALUE_TYPE_PORT_LANE_LATCH_STATUS_LIST:

if (md->isprimitive)
{
Expand Down Expand Up @@ -2667,6 +2673,7 @@ void check_attr_is_primitive(
case SAI_ATTR_VALUE_TYPE_MACSEC_SALT:
case SAI_ATTR_VALUE_TYPE_SYSTEM_PORT_CONFIG:
case SAI_ATTR_VALUE_TYPE_FABRIC_PORT_REACHABILITY:
case SAI_ATTR_VALUE_TYPE_LATCH_STATUS:

if (!md->isprimitive)
{
Expand Down