|
Mellanox SwitchX SDK API Guide
4.3.2104
|
Go to the source code of this file.
Functions | |
| sx_status_t | sx_api_bridge_log_verbosity_level_set (const sx_api_handle_t handle, const sx_log_verbosity_target_t verbosity_target, const sx_verbosity_level_t module_verbosity_level, const sx_verbosity_level_t api_verbosity_level) |
| sx_status_t | sx_api_bridge_log_verbosity_level_get (const sx_api_handle_t handle, const sx_log_verbosity_target_t verbosity_target, sx_verbosity_level_t *module_verbosity_level_p, sx_verbosity_level_t *api_verbosity_level_p) |
| sx_status_t | sx_api_bridge_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, sx_bridge_id_t *bridge_id_p) |
| sx_status_t | sx_api_bridge_iter_get (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_bridge_id_t bridge_id, const sx_bridge_filter_t *filter_p, sx_bridge_id_t *bridge_id_list_p, uint32_t *bridge_id_cnt_p) |
| sx_status_t | sx_api_bridge_port_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_bridge_id_t bridge_id, const sx_port_log_id_t log_port, const sx_vlan_id_t vlan, const sx_untagged_member_state_t egress_mode) |
| sx_status_t | sx_api_bridge_port_get (const sx_api_handle_t handle, const sx_bridge_id_t bridge_id, sx_bridge_port_t *bridge_port_list_p, uint32_t *bridge_port_cnt_p) |
| sx_status_t | sx_api_bridge_vport_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_bridge_id_t bridge_id, const sx_port_log_id_t log_port) |
| sx_status_t | sx_api_bridge_vport_get (const sx_api_handle_t handle, const sx_bridge_id_t bridge_id, sx_port_log_id_t *bridge_vport_list_p, uint32_t *bridge_vport_cnt_p) |
| sx_status_t | sx_api_bridge_vport_multi_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_bridge_id_t *bridge_id_list, const sx_port_log_id_t *log_port_list, uint32_t list_cnt) |
| sx_status_t | sx_api_bridge_counter_bind_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_bridge_id_t bridge_id, const sx_flow_counter_id_t flow_counter_id) |
| sx_status_t | sx_api_bridge_counter_bind_get (const sx_api_handle_t handle, const sx_bridge_id_t bridge_id, sx_flow_counter_id_t *flow_counter_id_p) |
| sx_status_t | sx_api_bridge_mirror_set (const sx_api_handle_t handle, const sx_bridge_id_t bridge_id, const sx_mirror_direction_t mirror_direction, const sx_mirror_mode_t mirror_mode) |
| sx_status_t | sx_api_bridge_mirror_get (const sx_api_handle_t handle, const sx_bridge_id_t bridge_id, const sx_mirror_direction_t mirror_direction, sx_mirror_mode_t *mirror_mode_p) |
| sx_status_t | sx_api_bridge_tunnel_counter_bind_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_bridge_id_t bridge_id, const sx_bridge_tunnel_counter_attr_t *counter_attr_p, const sx_flow_counter_id_t counter_id) |
| sx_status_t | sx_api_bridge_tunnel_counter_bind_get (const sx_api_handle_t handle, const sx_bridge_id_t bridge_id, const sx_bridge_tunnel_counter_attr_t *counter_attr_p, sx_flow_counter_id_t *counter_id_p) |
| sx_status_t sx_api_bridge_log_verbosity_level_set | ( | const sx_api_handle_t | handle, |
| const sx_log_verbosity_target_t | verbosity_target, | ||
| const sx_verbosity_level_t | module_verbosity_level, | ||
| const sx_verbosity_level_t | api_verbosity_level | ||
| ) |
This API sets the log verbosity level of BRIDGE MODULE. Supported devices: Spectrum , Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | verbosity_target | - set verbosity of : API / MODULE / BOTH |
| [in] | module_verbosity_level | - BRIDGE module verbosity level |
| [in] | api_verbosity_level | - BRIDGE API verbosity level |
| sx_status_t sx_api_bridge_log_verbosity_level_get | ( | const sx_api_handle_t | handle, |
| const sx_log_verbosity_target_t | verbosity_target, | ||
| sx_verbosity_level_t * | module_verbosity_level_p, | ||
| sx_verbosity_level_t * | api_verbosity_level_p | ||
| ) |
This API gets the log verbosity level of BRIDGE MODULE. Supported devices: Spectrum , Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | verbosity_target | - get verbosity of : API / MODULE / BOTH |
| [out] | module_verbosity_level_p | - BRIDGE module verbosity level |
| [out] | api_verbosity_level_p | - BRIDGE API verbosity level |
| sx_status_t sx_api_bridge_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| sx_bridge_id_t * | bridge_id_p | ||
| ) |
This function is used to create/destroy a bridge. This function is supported in 802.1D mode only. Supported devices: Spectrum , Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | cmd | - CREATE/DESTROY |
| [out] | bridge_id_p | - a bridge_id. |
| sx_status_t sx_api_bridge_iter_get | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_bridge_id_t | bridge_id, | ||
| const sx_bridge_filter_t * | filter_p, | ||
| sx_bridge_id_t * | bridge_id_list_p, | ||
| uint32_t * | bridge_id_cnt_p | ||
| ) |
This function retrieves a list of one or more Bridge IDs. This function is not supported in 802.1Q mode. The following use case scenarios apply with different input parameters X = don't-care
Supported devices: Spectrum , Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | cmd | - GET/GET_FIRST/GET_NEXT |
| [in] | bridge_id | - bridge ID |
| [in] | filter_p | - specify a filter parameter (not supported yet) |
| [out] | bridge_id_list_p | - return list of bridge IDs |
| [in,out] | bridge_id_cnt_p | - [in] number of bridge IDs to get
|
| sx_status_t sx_api_bridge_port_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_bridge_id_t | bridge_id, | ||
| const sx_port_log_id_t | log_port, | ||
| const sx_vlan_id_t | vlan, | ||
| const sx_untagged_member_state_t | egress_mode | ||
| ) |
Supported devices: switchX2 This function is used to add a port and vlan to a bridge. When multiple vlan bridge support is enabled, it is possible to bind different vlans to the same bridge. When multiple vlan bridge support is disabled, you can bind only one vlan to each bridge. When cmd==DELETE_PORT the log_port will be removed from all associated bridges. This function is supported in 802.1D mode only. Supported devices: SwitchX, SwitchX2.
| [in] | handle | - SX-API handle |
| [in] | cmd | - ADD/DELETE/DELETE_PORT |
| [in] | bridge_id | - bridge_id. |
| [in] | log_port | - logical port ID. |
| [in] | vlan | - vlan_id. |
| [in] | egress_mode | - TAGGED/UNTAGGED. |
| sx_status_t sx_api_bridge_port_get | ( | const sx_api_handle_t | handle, |
| const sx_bridge_id_t | bridge_id, | ||
| sx_bridge_port_t * | bridge_port_list_p, | ||
| uint32_t * | bridge_port_cnt_p | ||
| ) |
Supported devices: switchX2 This function is used to get a list of all ports and vlans associated with a bridge. When using bridge_port_cnt_p == 0, the number of existing entries will be returned. This function is supported in 802.1D mode only. Supported devices: SwitchX, SwitchX2.
| [in] | handle | - SX-API handle |
| [in] | bridge_id | - bridge_id. |
| [out] | bridge_port_list_p | log_port - a pointer to a bridge_port list. |
| [in/out] | bridge_port_cnt_p - size of the bridge_port_list. |
| sx_status_t sx_api_bridge_vport_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_bridge_id_t | bridge_id, | ||
| const sx_port_log_id_t | log_port | ||
| ) |
Supported devices: Spectrum, Spectrum2. This function is used to add a virtual port to a bridge.
| [in] | handle | - SX-API handle |
| [in] | cmd | - ADD/DELETE/DELETE_ALL |
| [in] | bridge_id | - bridge_id. |
| [in] | log_port | - logical virtual port ID. |
| sx_status_t sx_api_bridge_vport_get | ( | const sx_api_handle_t | handle, |
| const sx_bridge_id_t | bridge_id, | ||
| sx_port_log_id_t * | bridge_vport_list_p, | ||
| uint32_t * | bridge_vport_cnt_p | ||
| ) |
Supported devices: Spectrum, Spectrum2. This function is used to get a list of all virtual ports associated with a bridge. When using bridge_vport_cnt_p == 0, the number of existing entries will be returned.
| [in] | handle | - SX-API handle |
| [in] | bridge_id | - bridge_id. |
| [out] | bridge_vport_list_p | - a pointer to a sx_port_log_id_t list. |
| [in/out] | bridge_vport_cnt_p - size of the bridge_vport_list. |
| sx_status_t sx_api_bridge_vport_multi_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_bridge_id_t * | bridge_id_list, | ||
| const sx_port_log_id_t * | log_port_list, | ||
| uint32_t | list_cnt | ||
| ) |
Supported devices: Spectrum, Spectrum2. This function is used to add/del a virtual ports from list to corresponding bridge from list.
| [in] | handle | - SX-API handle |
| [in] | cmd | - ADD/DELETE/DELETE_ALL |
| [in] | bridge_id_list | - bridge_id list |
| [in] | log_port_list | - logical virtual port ID list |
| [in] | list_cnt | - list counter. |
| sx_status_t sx_api_bridge_counter_bind_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_bridge_id_t | bridge_id, | ||
| const sx_flow_counter_id_t | flow_counter_id | ||
| ) |
Supported devices: Spectrum, Spectrum2. This function is used to bind/unbind a flow counter to a bridge.
| [in] | handle | - SX-API handle |
| [in] | cmd | - BIND/UNBIND |
| [in] | bridge_id | - bridge_id. |
| [in] | flow_counter_id | - flow counter id to bind |
| sx_status_t sx_api_bridge_counter_bind_get | ( | const sx_api_handle_t | handle, |
| const sx_bridge_id_t | bridge_id, | ||
| sx_flow_counter_id_t * | flow_counter_id_p | ||
| ) |
Supported devices: Spectrum, Spectrum2. This function is used to get the flow counter bound to the bridge. When no counter is bound to the bridge, flow_counter_id_p will be set to SX_FLOW_COUNTER_ID_INVALID.
| [in] | handle | - SX-API handle |
| [in] | bridge_id | - bridge_id. |
| [out] | flow_counter_id_p | - bound counter id |
| sx_status_t sx_api_bridge_mirror_set | ( | const sx_api_handle_t | handle, |
| const sx_bridge_id_t | bridge_id, | ||
| const sx_mirror_direction_t | mirror_direction, | ||
| const sx_mirror_mode_t | mirror_mode | ||
| ) |
Supported devices: Spectrum, Spectrum2. This function sets the mirroring mode for a bridge. Currently only ingress direction is supported.
| [in] | handle | - SX-API handle |
| [in] | bridge_id | - mirror bridge. |
| [in] | mirror_direction | - ingress\egress |
| [in] | mirror_mode | - enabled\disabled |
| sx_status_t sx_api_bridge_mirror_get | ( | const sx_api_handle_t | handle, |
| const sx_bridge_id_t | bridge_id, | ||
| const sx_mirror_direction_t | mirror_direction, | ||
| sx_mirror_mode_t * | mirror_mode_p | ||
| ) |
Supported devices: Spectrum, Spectrum2. This function gets the mirroring mode for a bridge by direction and bridge ID Currently only ingress direction is supported.
| [in] | handle | - SX-API handle. |
| [in] | bridge_id | - mirror bridge |
| [in] | mirror_direction | - ingress/egress |
| [out] | mirror_mode_p | - the returned mirroring mode |
| sx_status_t sx_api_bridge_tunnel_counter_bind_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_bridge_id_t | bridge_id, | ||
| const sx_bridge_tunnel_counter_attr_t * | counter_attr_p, | ||
| const sx_flow_counter_id_t | counter_id | ||
| ) |
This API bind counter for tunnel mapped to the bridge Supported devices: Spectrum, Spectrum2.
For ENCAP_UC and ENCAP_MC counters this operation can be performed only when FDB doesn't contain any entries for tunnel in fid counters can be bind only if mapping bridge/VLAN to tunnel is configured
| [in] | handle | - SX-API handle. |
| [in] | cmd | - SX_ACCESS_CMD_BIND/SX_ACCESS_CMD_UNBIND. |
| [in] | bridge_id | - bridge_id/vlan_id on which tunnel mapped. |
| [in] | attr_p | - counter attributes (type, tunnel_id) |
| [in] | counter_d | - flow counter ID which will be bound |
| sx_status_t sx_api_bridge_tunnel_counter_bind_get | ( | const sx_api_handle_t | handle, |
| const sx_bridge_id_t | bridge_id, | ||
| const sx_bridge_tunnel_counter_attr_t * | counter_attr_p, | ||
| sx_flow_counter_id_t * | counter_id_p | ||
| ) |
This API get flow counter for tunnel mapped to the bridge Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle. |
| [in] | bridge_id | - bridge_id/vlan_id on which tunnel mapped. |
| [in] | attr_p | - counter attributes (type, tunnel_id) |
| [out] | counter_id_p | - pointer to flow counter ID. Returns bound counter_id |
1.8.16