Skip to content

Added new port attributes to get the interrupts information. #1495

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
83 changes: 83 additions & 0 deletions inc/saiport.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
Expand Down Expand Up @@ -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
*
Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions inc/saitypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down
2 changes: 2 additions & 0 deletions meta/acronyms.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions meta/style.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down Expand Up @@ -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);
}
Expand Down