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
4 changes: 4 additions & 0 deletions inc/sai.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@
#include "saiicmpecho.h"
#include "saisynce.h"
#include "saivirtualchannel.h"
#include "saiofh.h"
#include "saiofhroute.h"

/**
* @defgroup SAI SAI - Entry point specific API definitions.
Expand Down Expand Up @@ -157,6 +159,8 @@ typedef enum _sai_api_t
SAI_API_SYNCE = 54, /**< sai_synce_api_t */
SAI_API_VIRTUAL_CHANNEL = 55, /**< sai_virtual_channel_api_t */
SAI_API_PERFMON = 56, /**< sai_perfmon_api_t */
SAI_API_OFH = 57, /**< sai_ofh_api_t */
SAI_API_OFH_ROUTE = 58, /**< sai_ofh_route_api_t */
SAI_API_MAX, /**< total number of APIs */

/**
Expand Down
199 changes: 196 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,

/** Set Packet OFH COS */
SAI_ACL_ACTION_TYPE_SET_OFH_COS = 0x0000003e,

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

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

/**
* @brief OFH Type
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_ACL_OFH_TYPE = SAI_ACL_TABLE_ATTR_FIELD_START + 0x167,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add match for version field


/**
* @brief OFH COS
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OFH_COS = SAI_ACL_TABLE_ATTR_FIELD_START + 0x168,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add TTL decrement for action as well as match on TTL

/**
* @brief OFH ECN
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OFH_ECN = SAI_ACL_TABLE_ATTR_FIELD_START + 0x169,

/**
* @brief OFH TTL
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OFH_TTL = SAI_ACL_TABLE_ATTR_FIELD_START + 0x16a,

/**
* @brief OFH F
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OFH_F = SAI_ACL_TABLE_ATTR_FIELD_START + 0x16b,

/**
* @brief OFH Flow Label
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OFH_FLOW_LABEL = SAI_ACL_TABLE_ATTR_FIELD_START + 0x16c,

/**
* @brief OFH User Defined Field
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OFH_UD = SAI_ACL_TABLE_ATTR_FIELD_START + 0x16d,

/**
* @brief OFH AR Field
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OFH_AR = SAI_ACL_TABLE_ATTR_FIELD_START + 0x16e,

/**
* @brief OFH Congestion Notification Message Eligible Field
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OFH_C = SAI_ACL_TABLE_ATTR_FIELD_START + 0x16f,

/**
* @brief OFH Congestion Notification Message Field
*
* @type bool
* @flags CREATE_ONLY
* @default false
*/
SAI_ACL_TABLE_ATTR_FIELD_OFH_CNM = SAI_ACL_TABLE_ATTR_FIELD_START + 0x170,

/**
* @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_OFH_CNM,

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

/**
* @brief OFH Type (field mask is not needed)
*
* @type sai_acl_field_data_t sai_ofh_type_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_ACL_OFH_TYPE = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x167,

/**
* @brief OFH COS (6 bits)
*
* @type sai_acl_field_data_t sai_uint8_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_OFH_COS = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x168,

/**
* @brief OFH ECN (2 bits)
*
* @type sai_acl_field_data_t sai_uint8_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_OFH_ECN = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x169,

/**
* @brief OFH TTL
*
* @type sai_acl_field_data_t sai_uint8_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_OFH_TTL = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x16a,

/**
* @brief OFH F Bit
*
* @type sai_acl_field_data_t sai_uint8_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_OFH_F = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x16b,

/**
* @brief OFH Flow Label (16 bits)
*
* @type sai_acl_field_data_t sai_uint16_t
* @flags CREATE_AND_SET
* @isvlan false
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_OFH_FLOW_LABEL = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x16c,

/**
* @brief OFH User Defined Field (2 bits)
*
* @type sai_acl_field_data_t sai_uint8_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_OFH_UD = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x16d,

/**
* @brief OFH AR Bit
*
* @type sai_acl_field_data_t sai_uint8_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_OFH_AR = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x16e,

/**
* @brief OFH Congestion Notification Message Eligible Field
*
* @type sai_acl_field_data_t sai_uint8_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_OFH_C = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x16f,

/**
* @brief OFH Congestion Notification Message Field
*
* @type sai_acl_field_data_t sai_uint8_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_FIELD_OFH_CNM = SAI_ACL_ENTRY_ATTR_FIELD_START + 0x170,

/**
* @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_OFH_CNM,

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

/**
* @brief Set Packet OFH COS (6 bits)
*
* @type sai_acl_action_data_t sai_uint8_t
* @flags CREATE_AND_SET
* @default disabled
*/
SAI_ACL_ENTRY_ATTR_ACTION_SET_OFH_COS = 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_SET_OFH_COS,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SAI_ACL_ACTION_TYPE_SET_ECN = 0x00000017,

Set ECN also supported for normal IP packet.


/**
* @brief End of ACL Entry attributes
Expand Down
18 changes: 18 additions & 0 deletions inc/saidebugcounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,21 @@ typedef enum _sai_in_drop_reason_t
/** IPv4 or IPv6 Routing table (LPM) unicast miss */
SAI_IN_DROP_REASON_LPM_MISS = 0x00000039,

/** OFH packet TTL expired */
SAI_IN_DROP_REASON_OFH_TTL,

/** OFH Routing table miss */
SAI_IN_DROP_REASON_OFH_MISS,

/** OFH Routing table action discard */
SAI_IN_DROP_REASON_OFH_DISCARD,

/** OFH VLAN drop */
SAI_IN_DROP_REASON_OFH_VLAN_DROP,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, SAI_IN_DROP_REASON_OFH_VLAN_DROP is meant to account the drops when RIF of type SAI_ROUTER_INTERFACE_TYPE_VLAN is not created for the given ingress port + packet.VID. Ideally, this would be accounted under SAI_IN_DROP_REASON_INGRESS_VLAN_FILTER. We do not have IPv4/IPv6 specific VLAN drops. I am trying to understand as to why we need OFH specific VLAN drops.


/** OFH VLAN to virtual router id drop */

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Please explain this drop reason either as comments in the header file or in the markdown file to be created.
  2. Which of the below drops are accounted under this drop reason?
  • SAI_ROUTER_INTERFACE_ATTR_ADMIN_OFH_STATE is false
  • SAI_VIRTUAL_ROUTER_ATTR_ADMIN_OFH_STATE is false

SAI_IN_DROP_REASON_OFH_VLAN_TO_VRID_DROP,

/** End of in drop reasons */
SAI_IN_DROP_REASON_END,

Expand Down Expand Up @@ -377,6 +392,9 @@ typedef enum _sai_out_drop_reason_t
*/
SAI_OUT_DROP_REASON_TUNNEL_LOOPBACK_PACKET_DROP,

/** OFH VLAN drop */
SAI_OUT_DROP_REASON_OFH_VLAN_DROP,

/** End of out drop reasons */
SAI_OUT_DROP_REASON_END,

Expand Down
3 changes: 3 additions & 0 deletions inc/saihash.h
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ typedef enum _sai_native_hash_field_t
/** Native hash field RDMA packet BTH destination queue pair */
SAI_NATIVE_HASH_FIELD_RDMA_BTH_DEST_QP = 0x00000023,

/** Native hash field RDMA packet BTH destination queue pair */
SAI_NATIVE_HASH_FIELD_OFH_FLOW_LABEL = 0x00000024,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix the comments cut and paste error.


/** No field - for compatibility, must be last */
SAI_NATIVE_HASH_FIELD_NONE = 0x00000021,

Expand Down
4 changes: 4 additions & 0 deletions inc/saiobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <sainat.h>
#include <saisrv6.h>
#include <saiprefixcompression.h>
#include <saiofhroute.h>

/* new experimental object type includes */
#include <saiexperimentaldashtrustedvni.h>
Expand Down Expand Up @@ -140,6 +141,9 @@ typedef union _sai_object_key_entry_t
/** @validonly object_type == SAI_OBJECT_TYPE_ENI_TRUSTED_VNI_ENTRY */
sai_eni_trusted_vni_entry_t eni_trusted_vni_entry;

/** @validonly object_type == SAI_OBJECT_TYPE_OFH_ROUTE_ENTRY */
sai_ofh_route_entry_t ofh_route_entry;

/* Add new experimental entries above this line */

} sai_object_key_entry_t;
Expand Down
Loading
Loading