Skip to content
Closed
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
40 changes: 37 additions & 3 deletions inc/saiacl.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ typedef enum _sai_acl_action_type_t
/** Bind a TAM object */
SAI_ACL_ACTION_TYPE_TAM_OBJECT = 0x0000003d,

/** Bind a TAM event object */
SAI_ACL_ACTION_TYPE_TAM_EVENT_OBJECT = 0x0000003e,

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

Expand Down Expand Up @@ -1647,10 +1650,19 @@ typedef enum _sai_acl_table_attr_t
*/
SAI_ACL_TABLE_ATTR_FIELD_CSIG_D_BIT = SAI_ACL_TABLE_ATTR_FIELD_START + 0x166,

/**
* @brief Drop Reason
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_DROP_REASON = SAI_ACL_TABLE_ATTR_FIELD_START + 0x167,

/**
* @brief End of ACL Table Match Field
*/
SAI_ACL_TABLE_ATTR_FIELD_END = SAI_ACL_TABLE_ATTR_FIELD_CSIG_D_BIT,
SAI_ACL_TABLE_ATTR_FIELD_END = SAI_ACL_TABLE_ATTR_FIELD_DROP_REASON,

/**
* @brief ACL table entries associated with this table.
Expand Down Expand Up @@ -2825,10 +2837,19 @@ typedef enum _sai_acl_entry_attr_t
*/
SAI_ACL_ENTRY_ATTR_FIELD_CSIG_D_BIT = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x166,

/**
* @brief Drop Reason
*
* @type sai_acl_field_data_t sai_uint32_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_DROP_REASON = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x167,

/**
* @brief End of Rule Match Fields
*/
SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_CSIG_D_BIT,
SAI_ACL_ENTRY_ATTR_FIELD_END = SAI_ACL_ENTRY_ATTR_FIELD_DROP_REASON,

/*
* Actions [sai_acl_action_data_t]
Expand Down Expand Up @@ -3474,10 +3495,23 @@ typedef enum _sai_acl_entry_attr_t
*/
SAI_ACL_ENTRY_ATTR_ACTION_TAM_OBJECT = SAI_ACL_ENTRY_ATTR_ACTION_START + 0x3d,

/**
* @brief ACL bind point for TAM event object
*
* Bind (or unbind) a TAM event object.
*
* @type sai_acl_action_data_t sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_TAM_EVENT
* @allownull true
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_ACTION_TAM_EVENT_OBJECT = SAI_ACL_ENTRY_ATTR_ACTION_START + 0x3e,

/**
* @brief End of Rule Actions
*/
SAI_ACL_ENTRY_ATTR_ACTION_END = SAI_ACL_ENTRY_ATTR_ACTION_TAM_OBJECT,
SAI_ACL_ENTRY_ATTR_ACTION_END = SAI_ACL_ENTRY_ATTR_ACTION_TAM_EVENT_OBJECT,

/**
* @brief End of ACL Entry attributes
Expand Down
12 changes: 12 additions & 0 deletions inc/saiswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -3593,6 +3593,18 @@ typedef enum _sai_switch_attr_t
*/
SAI_SWITCH_ATTR_PTP_SYNTONIZE_ADJUST,

/**
* @brief Event learn notification callback
* function passed to the adapter.
*
* Use sai_tam_event_learn_notification_fn as notification function.
*
* @type sai_pointer_t sai_tam_event_learn_notification_fn
* @flags CREATE_AND_SET
* @default NULL
*/
SAI_SWITCH_ATTR_TAM_EVENT_LEARN_NOTIFY,

/**
* @brief End of attributes
*/
Expand Down
106 changes: 106 additions & 0 deletions inc/saitam.h
Original file line number Diff line number Diff line change
Expand Up @@ -2311,6 +2311,32 @@ typedef sai_status_t (*sai_set_tam_event_action_attribute_fn)(
_In_ sai_object_id_t tam_event_action_id,
_In_ const sai_attribute_t *attr);

/**
* @brief Packet drop types.
*/
typedef enum _sai_packet_drop_type_t
{
/**
* @brief No drops monitored
*/
SAI_PACKET_DROP_TYPE_NONE,

/**
* @brief Ingress drops
*/
SAI_PACKET_DROP_TYPE_INGRESS,

/**
* @brief Egress drops
*/
SAI_PACKET_DROP_TYPE_EGRESS,

/**
* @brief Buffer related drops
*/
SAI_PACKET_DROP_TYPE_BUFFER,
} sai_packet_drop_type_t;

/**
* @brief Tam event attributes
*/
Expand Down Expand Up @@ -2367,6 +2393,26 @@ typedef enum _sai_tam_event_attr_t
*/
SAI_TAM_EVENT_ATTR_DSCP_VALUE,

/**
* @brief Enable hardware based learning of events
*
* @type bool
* @flags CREATE_AND_SET
* @default false
* @validonly SAI_TAM_EVENT_ATTR_TYPE == SAI_TAM_EVENT_TYPE_PACKET_DROP
*/
SAI_TAM_EVENT_ATTR_HW_LEARN,

/**
* @brief Enable hardware based learning of events
*
* @type sai_packet_drop_type_t
* @flags CREATE_AND_SET
* @default SAI_PACKET_DROP_TYPE_NONE
* @validonly SAI_TAM_EVENT_ATTR_TYPE == SAI_TAM_EVENT_TYPE_PACKET_DROP
*/
SAI_TAM_EVENT_ATTR_PACKET_DROP_TYPE,

/**
* @brief End of Attributes
*/
Expand Down Expand Up @@ -2575,6 +2621,66 @@ typedef void (*sai_tam_event_notification_fn)(
_In_ uint32_t attr_count,
_In_ const sai_attribute_t *attr_list);

/**
* @brief TAM tam learn entry
*/
typedef struct _sai_tam_event_learn_entry_t
{
/**
* @brief Switch ID
*
* @objects SAI_OBJECT_TYPE_SWITCH
*/
sai_object_id_t switch_id;

/**
* @brief Ingress Port ID
*
* @objects SAI_OBJECT_TYPE_SWITCH
*/
sai_object_id_t ingress_port_id;

/** IP address */
sai_ip_address_t ip_address;

/** Drop Reason Code */
sai_uint32_t drop_reason;

} sai_tam_event_learn_entry_t;

/**
* @brief Notification data format received from SAI TAM event learn callback
*
* @count attr[attr_count]
*/
typedef struct _sai_tam_event_learn_notification_data_t
{
/** TAM event learn entry */
sai_tam_event_learn_entry_t learn_entry;

/** Attributes count */
uint32_t attr_count;

/**
* @brief Attributes
*
* @objects SAI_OBJECT_TYPE_ACL_ENTRY
*/
sai_attribute_t *attr;
} sai_tam_event_learn_notification_data_t;

/**
* @brief TAM Event learn notifications
*
* @count data[count]
*
* @param[in] count Number of notifications
* @param[in] data Pointer to TAM event learn notification data array
*/
typedef void (*sai_tam_event_learn_notification_fn)(
_In_ uint32_t count,
_In_ const sai_tam_event_learn_notification_data_t *data);

/**
* @brief TAM telemetry data get API
*
Expand Down
1 change: 1 addition & 0 deletions meta/parse.pl
Original file line number Diff line number Diff line change
Expand Up @@ -2720,6 +2720,7 @@ sub ProcessStructValueType
return "SAI_ATTR_VALUE_TYPE_INT32" if defined $SAI_ENUMS{$type}; # enum

return "-1" if $type eq "sai_fdb_entry_t";
return "-1" if $type eq "sai_tam_event_learn_entry_t";
return "-1" if $type eq "sai_nat_entry_t";
return "-1" if $type eq "sai_attribute_t*";

Expand Down
1 change: 1 addition & 0 deletions meta/saisanitycheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -6352,6 +6352,7 @@ void check_struct_and_union_size()
CHECK_STRUCT_SIZE(sai_prbs_per_lane_rx_state_list_t, 16);
CHECK_STRUCT_SIZE(sai_prbs_bit_error_rate_t, 16);
CHECK_STRUCT_SIZE(sai_prbs_per_lane_bit_error_rate_list_t, 16);
CHECK_STRUCT_SIZE(sai_tam_event_learn_entry_t, 40);
}
#pragma GCC diagnostic pop

Expand Down