diff --git a/inc/saiport.h b/inc/saiport.h index 8975a5d62..be007357c 100644 --- a/inc/saiport.h +++ b/inc/saiport.h @@ -2764,6 +2764,70 @@ typedef enum _sai_port_stat_t } sai_port_stat_t; +/** + * @brief Port interruption IDs in get_port_interrupts_status() call + */ +typedef enum _sai_port_interrupt_t +{ + /** PCS Rx FIFO Empty Interrupt */ + SAI_PORT_INTERRUPT_PCS_RX_FIFO_EMPTY, + + /** PCS Rx FIFO Full Interrupt */ + SAI_PORT_INTERRUPT_PCS_RX_FIFO_FULL, + + /** PCS Tx PPM FIFO Overflow Interrupt */ + SAI_PORT_INTERRUPT_PCS_RX_FIFO_OVERFLOW, + + /** PCS Tx PPM FIFO Underflow Interrupt */ + SAI_PORT_INTERRUPT_PCS_RX_FIFO_UNDERFLOW, + + /** PCS Tx PPM FIFO Overrun Interrupt */ + SAI_PORT_INTERRUPT_PCS_TX_FIFO_OVERRUN, + + /** Edge of the Local Fault Condition on Tx Path Interrupt */ + SAI_PORT_INTERRUPT_PCS_RX_LOCAL_FAULT, + + /** Edge of the Local Fault Condition on Rx Path Interrupt */ + SAI_PORT_INTERRUPT_PCS_TX_LOCAL_FAULT, + + /** Edge of the Remote Fault Condition on Tx Path Interrupt */ + SAI_PORT_INTERRUPT_PCS_RX_REMOTE_FAULT, + + /** Edge of the Remote Fault Condition on Rx Path Interrupt */ + SAI_PORT_INTERRUPT_PCS_TX_REMOTE_FAULT, + + /** Edge of the 4 Local Fault Condition on Tx Path Interrupt */ + SAI_PORT_INTERRUPT_PCS_TX_4LOCAL_FAULT, + + /** Edge of the 4 Remote Fault Condition on Tx Path Interrupt */ + SAI_PORT_INTERRUPT_PCS_TX_4REMOTE_FAULT, + + /** PCS Tx PPM FIFO Push back Interrupt */ + SAI_PORT_INTERRUPT_PCS_TX_FIFO_PUSHBACK, + + /** PCS Tx PPM FIFO Stop Write Interrupt */ + SAI_PORT_INTERRUPT_PCS_TX_FIFO_STOPWRITE, + + /** PCS Tx LPI Received Interrupt */ + SAI_PORT_INTERRUPT_PCS_LPI_TX, + + /** PCS Tx LPI Received Interrupt */ + SAI_PORT_INTERRUPT_PCS_LPI_RX, + + /** PCS Tx PPM FIFO Very High Water Interrupt */ + SAI_PORT_INTERRUPT_PCS_VERY_HIGH, + + /** High BER Change Interrupt */ + SAI_PORT_INTERRUPT_HIGH_BER_CHANGE, + + /** Packet CRC Check Error Interrupt */ + SAI_PORT_INTERRUPT_PKT_CRC_ERROR, + + /** Link Change Interrupt */ + SAI_PORT_INTERRUPT_LINK_CHANGE, + +} sai_port_interrupt_t; + /** * @brief Create port * @@ -2874,6 +2938,24 @@ typedef sai_status_t (*sai_clear_port_stats_fn)( typedef sai_status_t (*sai_clear_port_all_stats_fn)( _In_ sai_object_id_t port_id); +/** + * @brief Get port interruptions status. + * + * This API is clear-on-read, the interruption status should be reset after the read. + * + * @param[in] port_id Port id + * @param[in] count Number of interruptions ids in the array + * @param[in] interrupt_ids Specifies the array of interrupts ids + * @param[out] stats Array of resulting interruptions status. + * + * @return #SAI_STATUS_SUCCESS on success, failure status code on error + */ +typedef sai_status_t (*sai_get_port_interrupts_status_fn)( + _In_ sai_object_id_t port_id, + _In_ uint32_t count, + _In_ const sai_interrupt_id_t *interrupt_ids, + _Out_ bool *stats); + /** * @brief Port state change notification * @@ -3485,6 +3567,7 @@ typedef struct _sai_port_api_t sai_get_port_stats_ext_fn get_port_stats_ext; sai_clear_port_stats_fn clear_port_stats; sai_clear_port_all_stats_fn clear_port_all_stats; + sai_get_port_interrupts_status_fn get_port_interrupts_status; sai_create_port_pool_fn create_port_pool; sai_remove_port_pool_fn remove_port_pool; sai_set_port_pool_attribute_fn set_port_pool_attribute; diff --git a/inc/saitypes.h b/inc/saitypes.h index 0c67f5224..1126ac67a 100644 --- a/inc/saitypes.h +++ b/inc/saitypes.h @@ -106,6 +106,7 @@ typedef uint8_t sai_auth_key_t[16]; typedef uint8_t sai_macsec_sak_t[32]; typedef uint8_t sai_macsec_auth_key_t[16]; typedef uint8_t sai_macsec_salt_t[12]; +typedef uint32_t sai_interrupt_id_t; #define _In_ #define _Out_ diff --git a/meta/acronyms.txt b/meta/acronyms.txt index 4f7383701..8045e0b42 100644 --- a/meta/acronyms.txt +++ b/meta/acronyms.txt @@ -6,6 +6,7 @@ AN - Auto Negotiation API - Application Program Interface ARP - Address Resolution Protocol ASIC - Application Specific Integrated Circuit +BER - Bit Error Rate BFD - Bidirectional Forwarding Detection BFDV6 - Bidirectional Forwarding Detection for IPv6 BGP - Border Gateway Protocol @@ -73,6 +74,7 @@ L2MC - Layer 2 Multi Cast L3 - Layer 3 LAG - Link Aggregation Group LDP - Label Distribution Protocol +LPI - Locality-specific Peripheral Interrupts LPM - Longest Prefix Match LSP - Label Switched Path MAC - Medium Access Control diff --git a/meta/style.pm b/meta/style.pm index cbe61353f..9e0f37755 100644 --- a/meta/style.pm +++ b/meta/style.pm @@ -288,13 +288,13 @@ sub CheckFunctionsParams next if not $fname =~ /_fn$/; # below don't apply for global functions if (not $fnparams =~ /^(\w+)(| attr| attr_count attr_list| switch_id attr_count attr_list)$/ and - not $fname =~ /_(stats|stats_ext|notification)_fn$|^sai_(send|allocate|free|recv|bulk)_|^sai_meta/) + not $fname =~ /_(stats|stats_ext|notification|interrupts_status)_fn$|^sai_(send|allocate|free|recv|bulk)_|^sai_meta/) { LogWarning "wrong param names: $fnparams: $fname"; LogWarning " expected: $params[0](| attr| attr_count attr_list| switch_id attr_count attr_list)"; } - if ($fname =~ /^sai_(get|set|create|remove)_(\w+?)(_attribute)?(_stats|_stats_ext)?_fn/) + if ($fname =~ /^sai_(get|set|create|remove)_(\w+?)(_attribute)?(_stats|_stats_ext|_interrupts_status)?_fn/) { my $pattern = $2; my $first = $params[0]; @@ -457,7 +457,7 @@ sub CheckFunctionNaming { # ok } - elsif ($name =~ /^(get|clear)_(\w+?)_(all_)?stats(_ext)?$/) + elsif ($name =~ /^(get|clear)_(\w+?)_(all_)?(stats|stats_ext|interrupts_status)?$/) { LogWarning "not object name $2 in $name" if not IsObjectName($2); }