Skip to content
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
739 changes: 739 additions & 0 deletions doc/CBFC/SAI-Credit_Based_Flow_Control.md

Large diffs are not rendered by default.

Binary file added doc/CBFC/images/CBFC_Object_Overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/CBFC/images/CBFC_operation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/CBFC/images/CBFC_sender_recv_functions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/CBFC/images/Objects_at_receiver.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/CBFC/images/Objects_at_sender.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
2 changes: 2 additions & 0 deletions inc/sai.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
#include "saipoe.h"
#include "saiicmpecho.h"
#include "saisynce.h"
#include "saivirtualchannel.h"

/**
* @defgroup SAI SAI - Entry point specific API definitions.
Expand Down Expand Up @@ -153,6 +154,7 @@ typedef enum _sai_api_t
SAI_API_ICMP_ECHO = 52, /**< sai_icmp_echo_api_t */
SAI_API_PREFIX_COMPRESSION = 53, /**< sai_prefix_compression_api_t */
SAI_API_SYNCE = 54, /**< sai_synce_api_t */
SAI_API_VIRTUAL_CHANNEL = 55, /**< sai_virtual_channel_api_t */
SAI_API_MAX, /**< total number of APIs */

/**
Expand Down
215 changes: 215 additions & 0 deletions inc/saiport.h
Original file line number Diff line number Diff line change
Expand Up @@ -3070,6 +3070,203 @@ typedef enum _sai_port_attr_t
*/
SAI_PORT_ATTR_SUPPORTED_PRBS_PATTERN,

/**
* @brief Get CBFC Native Credit Size in bytes.
*
* Receiver's input buffer is typically divided into cells, and the native credit size is this cell size (in bytes).
*
* @type sai_uint16_t
* @flags READ_ONLY
* @isvlan false
*/
SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_CREDIT_SIZE,

/**
* @brief Get CBFC Receiver Native Packet Overhead in bytes.
*
* @type sai_int16_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_PACKET_OVERHEAD,

/**
* @brief Get CBFC Receiver Total Port Credits in Credits.
*
* If value is 0, receiver sets per-VC credit limits.
*
* @type sai_uint16_t
* @flags READ_ONLY
* @isvlan false
*/
SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_TOTAL_CREDITS,

/**
* @brief Configure CBFC Receiver Credit Size in bytes.
*
* If value is 0, CBFC_RECEIVER_NATIVE_CREDIT_SIZE will be used.
*
* @type sai_uint16_t
* @flags CREATE_AND_SET
* @isvlan false
* @default 0
*/
SAI_PORT_ATTR_CBFC_RECEIVER_CREDIT_SIZE,

/**
* @brief Configure CBFC Receiver Packet Overhead in bytes.
*
* Range: -16 to 127
* If value is 128, SAI_PORT_ATTR_CBFC_RECEIVER_NATIVE_PACKET_OVERHEAD will be used
*
* @type sai_int16_t
* @flags CREATE_AND_SET
* @default 128
*/
SAI_PORT_ATTR_CBFC_RECEIVER_PACKET_OVERHEAD,

/**
* @brief Get CBFC supported Credit Size in bytes.
*
* @type sai_u16_list_t
* @flags READ_ONLY
*/
SAI_PORT_ATTR_CBFC_SENDER_SUPPORTED_CREDIT_SIZE,

/**
* @brief Configure CBFC Sender Credit Size in bytes.
*
* To maximize utilization of the receiver's input buffer, set to largest value in CBFC_SENDER_SUPPORTED_CREDIT_SIZE that does not exceed CBFC_RECEIVER_NATIVE_CREDIT_SIZE.
*
* @type sai_uint16_t
* @flags CREATE_AND_SET
* @isvlan false
* @default 128
*/
SAI_PORT_ATTR_CBFC_SENDER_CREDIT_SIZE,

/**
* @brief Configure CBFC Sender Packet Overhead in bytes.
*
* Range: -16 to 127.
*
* @type sai_int16_t
* @flags CREATE_AND_SET
* @default 0
*/
SAI_PORT_ATTR_CBFC_SENDER_PACKET_OVERHEAD,

/**
* @brief Configure CBFC Sender Port Credit Limit.
*
* Range; 0 to (2^20 - 1).
*
* @type sai_uint32_t
* @flags CREATE_AND_SET
* @default 0
*/
SAI_PORT_ATTR_CBFC_SENDER_CREDIT_LIMIT,

/**
* @brief Configure CBFC CC_Update message timer in microseconds.
*
* Range: 1us to 250000us.
*
* @type sai_uint32_t
* @flags CREATE_AND_SET
* @default 256
*/
SAI_PORT_ATTR_CBFC_CC_MESSAGE_TIMER,

/**
* @brief Configure minimum space between CBFC CF_Update messages in bytes.
*
* Must be >=800B.
*
* @type sai_uint32_t
* @flags CREATE_AND_SET
* @default 6400
*/
SAI_PORT_ATTR_CBFC_CF_MIN_SPACING,

/**
* @brief Configure minimum space in bytes between CtlOS messages
* like CBFC CF_Update, LLR ACK etc.
* Must be >=800B.
*
* @type sai_uint32_t
* @flags CREATE_AND_SET
* @default 6400
*/
SAI_PORT_ATTR_CTLOS_MIN_SPACING,

/**
* @brief Configure maximum space between CBFC CF_Update messages in bytes.
*
* Range: 16 KB to 1 MB with minimum granularity of 16 KB.
*
* @type sai_uint32_t
* @flags CREATE_AND_SET
* @default 262144
*/
SAI_PORT_ATTR_CBFC_CF_MAX_SPACING,

/**
* @brief Enable Queue to VC MAP on port
*
* QOS_MAP of type SAI_QOS_MAP_TYPE_QUEUE_TO_VC
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_PORT_ATTR_QOS_QUEUE_TO_VC_MAP,

/**
* @brief Enable TC to VC MAP on port.
*
* QOS_MAP of type SAI_QOS_MAP_TYPE_TC_TO_VC
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_PORT_ATTR_QOS_TC_TO_VC_MAP,

/**
* @brief Enable {DOT1P,DEI} -> TC MAP on port.
*
* Cannot co-exist with SAI_PORT_ATTR_QOS_DOT1P_TO_TC_MAP.
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_PORT_ATTR_QOS_DOT1P_DEI_TO_TC_MAP,

/**
* @brief List of virtual channels for the port.
*
* @type sai_object_list_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_VIRTUAL_CHANNEL
*/
SAI_PORT_ATTR_QOS_VIRTUAL_CHANNEL_LIST,

/**
* @brief List of CBFC credit pools for the port.
*
* @type sai_object_list_t
* @flags READ_ONLY
* @objects SAI_OBJECT_TYPE_CBFC_CREDIT_POOL
*/
SAI_PORT_ATTR_CBFC_CREDIT_POOL_LIST,

/**
* @brief End of attributes
*/
Expand Down Expand Up @@ -3827,6 +4024,24 @@ typedef enum _sai_port_stat_t
/** Number of times that LLR Rx detected the start of a replay */
SAI_PORT_STAT_LLR_RX_REPLAY,

/** SAI port stat sender credits used */
SAI_PORT_STAT_CBFC_SENDER_CREDITS_USED,

/** SAI port stat sender credits used watermark */
SAI_PORT_STAT_CBFC_SENDER_CREDITS_USED_WATERMARK,

/** SAI port stat credits consumed update messages tx */
SAI_PORT_STAT_CBFC_NUM_CC_UPDATE_MESSAGES_TX,

/** SAI port stat credits freed update messages tx */
SAI_PORT_STAT_CBFC_NUM_CF_UPDATE_MESSAGES_TX,

/** SAI port stat credits consumed update messages rx */
SAI_PORT_STAT_CBFC_NUM_CC_UPDATE_MESSAGES_RX,

/** SAI port stat credits freed update messages rx */
SAI_PORT_STAT_CBFC_NUM_CF_UPDATE_MESSAGES_RX,

/** Port stat in drop reasons range start */
SAI_PORT_STAT_IN_DROP_REASON_RANGE_BASE = 0x00001000,

Expand Down
13 changes: 11 additions & 2 deletions inc/saiqosmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ typedef enum _sai_qos_map_type_t
/** QOS Map to set EXP to Forwarding class */
SAI_QOS_MAP_TYPE_MPLS_EXP_TO_FORWARDING_CLASS = 0x0000000e,

/** QOS Map to map packet {dot1p+DEI} to TC */
SAI_QOS_MAP_TYPE_DOT1P_DEI_TO_TC = 0x0000000f,

/** QOS Map to map Traffic class to VC */
SAI_QOS_MAP_TYPE_TC_TO_VC = 0x00000010,

/** QOS Map to set queue to VC */
SAI_QOS_MAP_TYPE_QUEUE_TO_VC = 0x00000011,

/** Custom range base value */
SAI_QOS_MAP_TYPE_CUSTOM_RANGE_BASE = 0x10000000

Expand Down Expand Up @@ -110,8 +119,8 @@ typedef enum _sai_qos_map_attr_t
* @brief Dot1p to TC Mapping
*
* Defaults:
* - All Dot1p/DSCP maps to traffic class 0
* - All Dot1p/DSCP maps to color #SAI_PACKET_COLOR_GREEN
* - All Dot1p/Dot1p+DEI/DSCP maps to traffic class 0
* - All Dot1p/Dot1p+DEI/DSCP maps to color #SAI_PACKET_COLOR_GREEN
* - All traffic class maps to queue 0
*
* @type sai_qos_map_list_t
Expand Down
26 changes: 26 additions & 0 deletions inc/saiqueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,32 @@ typedef enum _sai_queue_attr_t
*/
SAI_QUEUE_ATTR_SELECTIVE_COUNTER_LIST,

/**
* @brief Queue packet dequeue enable
*
* True: Enable packet transmission of a queue.
* False: Disable packet transmission of a queue.
* When packet transmission is disabled on a queue, packets are still subject
* to regular ingress and egress admission control to determine the actions on a packet
*
* @type bool
* @flags CREATE_AND_SET
* @default true
*/
SAI_QUEUE_ATTR_PKT_DEQUEUE_ENABLE,

/**
* @brief Queue packet enqueue enable
*
* True: Enable packet enqueue to a queue.
* False: Disable packet enqueue to a queue.
*
* @type bool
* @flags CREATE_AND_SET
* @default true
*/
SAI_QUEUE_ATTR_PKT_ENQUEUE_ENABLE,

/**
* @brief End of attributes
*/
Expand Down
9 changes: 9 additions & 0 deletions inc/saitypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,9 @@ typedef enum _sai_object_type_t
SAI_OBJECT_TYPE_PREFIX_COMPRESSION_ENTRY = 113,
SAI_OBJECT_TYPE_SYNCE_CLOCK = 114,
SAI_OBJECT_TYPE_PORT_LLR_PROFILE = 115,
SAI_OBJECT_TYPE_VIRTUAL_CHANNEL = 116,
SAI_OBJECT_TYPE_CBFC_CREDIT_POOL = 117,
SAI_OBJECT_TYPE_CBFC_CREDIT_PROFILE = 118,

/** Must remain in last position */
SAI_OBJECT_TYPE_MAX,
Expand Down Expand Up @@ -836,6 +839,12 @@ typedef struct _sai_qos_map_params_t
/** Forwarding class */
sai_uint8_t fc;

/** DEI used in SAI_QOS_MAP_TYPE_DOT1P_DEI_TO_TC */
sai_uint8_t dei;

/** Virtual Channel */
sai_uint8_t vc;

} sai_qos_map_params_t;

typedef struct _sai_qos_map_t
Expand Down
Loading
Loading