Skip to content

Commit

Permalink
Tunnel Scoped TC MAP and Remarking (#1413) (#1451)
Browse files Browse the repository at this point in the history
This PR add following behavior to tunnel encap and decap

Tunnel Encap:

 SAI_TUNNEL_ATTR_ENCAP_QOS_TC_AND_COLOR_TO_DSCP_MAP for remarking the packet based on normalized TC as per port TC MAP binding
 SAI_TUNNEL_ATTR_ENCAP_QOS_TC_TO_QUEUE_MAP for queue selection based on normalized TC as per port TC MAP binding

Tunnel Decap:

 SAI_TUNNEL_ATTR_DECAP_QOS_DSCP_TO_TC_MAP new TC MAP can be bind'ed to the tunnel for decap. This MAP overrides port MAP if configured.
 SAI_TUNNEL_ATTR_DECAP_QOS_TC_TO_PRIORITY_GROUP_MAP for mapping the normalized TC to priority group mainly for PFC generation.
DSCP mode takes effect as configured for both cases.

Signed-off-by: Jai Kumar <jai.kumar@broadcom.com>

Co-authored-by: Jai Kumar <jai.kumar@broadcom.com>
  • Loading branch information
bingwang-ms and JaiOCP authored Mar 23, 2022
1 parent 62364a3 commit d0f3333
Show file tree
Hide file tree
Showing 3 changed files with 103 additions and 0 deletions.
50 changes: 50 additions & 0 deletions inc/saiswitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,56 @@ typedef enum _sai_switch_tunnel_attr_t
*/
SAI_SWITCH_TUNNEL_ATTR_VXLAN_UDP_SPORT_MASK,

/**
* @brief Enable TC AND COLOR -> DSCP MAP on tunnel at encapsulation (access-to-network) node to remark the DSCP in tunnel header
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_SWITCH_TUNNEL_ATTR_ENCAP_QOS_TC_AND_COLOR_TO_DSCP_MAP,

/**
* @brief Enable TC -> Queue MAP on tunnel encap
*
* Map id = #SAI_NULL_OBJECT_ID to disable map on tunnel.
* Default no map, i.e. packets are queued with static mapping.
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_SWITCH_TUNNEL_ATTR_ENCAP_QOS_TC_TO_QUEUE_MAP,

/**
* @brief Enable DSCP -> TC MAP on tunnel at termination (Network-to-access) node.
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_SWITCH_TUNNEL_ATTR_DECAP_QOS_DSCP_TO_TC_MAP,

/**
* @brief Enable TC -> Priority Group MAP
*
* Map id = #SAI_NULL_OBJECT_ID to disable map on port.
* Default no map
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_SWITCH_TUNNEL_ATTR_DECAP_QOS_TC_TO_PRIORITY_GROUP_MAP,

/**
* @brief End of attributes
*/
Expand Down
52 changes: 52 additions & 0 deletions inc/saitunnel.h
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,56 @@ typedef enum _sai_tunnel_attr_t
*/
SAI_TUNNEL_ATTR_IPSEC_SA_PORT_LIST,

/**
* @brief Enable TC AND COLOR -> DSCP MAP on tunnel at encapsulation (access-to-network) node to remark the DSCP in tunnel header
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_TUNNEL_ATTR_ENCAP_QOS_TC_AND_COLOR_TO_DSCP_MAP,

/**
* @brief Enable TC -> Queue MAP on tunnel encap
*
* Map id = #SAI_NULL_OBJECT_ID to disable map on tunnel.
* Default no map, i.e. packets are queued with static mapping.
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_TUNNEL_ATTR_ENCAP_QOS_TC_TO_QUEUE_MAP,

/**
* @brief Enable DSCP -> TC MAP on tunnel at termination (Network-to-access) node. This map if configured overrides the port MAP
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_TUNNEL_ATTR_DECAP_QOS_DSCP_TO_TC_MAP,

/**
* @brief Enable TC -> Priority Group MAP. TC is derived from the tunnel MAP
*
* Map id = #SAI_NULL_OBJECT_ID to disable map on port.
* Default no map
*
* @type sai_object_id_t
* @flags CREATE_AND_SET
* @objects SAI_OBJECT_TYPE_QOS_MAP
* @allownull true
* @default SAI_NULL_OBJECT_ID
*/
SAI_TUNNEL_ATTR_DECAP_QOS_TC_TO_PRIORITY_GROUP_MAP,

/**
* @brief End of attributes
*/
Expand Down Expand Up @@ -1082,6 +1132,8 @@ typedef struct _sai_tunnel_api_t
sai_remove_tunnel_map_entry_fn remove_tunnel_map_entry;
sai_set_tunnel_map_entry_attribute_fn set_tunnel_map_entry_attribute;
sai_get_tunnel_map_entry_attribute_fn get_tunnel_map_entry_attribute;
sai_bulk_object_get_attribute_fn get_tunnels_attribute;
sai_bulk_object_set_attribute_fn set_tunnels_attribute;

} sai_tunnel_api_t;

Expand Down
1 change: 1 addition & 0 deletions inc/saitypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ typedef struct _sai_acl_capability_t
* @passparam &sai_metadata_enum_sai_acl_action_type_t
*/
sai_s32_list_t action_list;

} sai_acl_capability_t;

/**
Expand Down

0 comments on commit d0f3333

Please sign in to comment.