|
Mellanox SwitchX SDK API Guide
4.3.2104
|
Go to the source code of this file.
Functions | |
| sx_status_t | sx_api_lag_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_lag_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_lag_port_group_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_swid_t swid, sx_port_log_id_t *lag_log_port_p, const sx_port_log_id_t *log_port_list_p, const uint32_t log_port_cnt) |
| sx_status_t | sx_api_lag_port_group_get (const sx_api_handle_t handle, const sx_swid_t swid, const sx_port_log_id_t lag_log_port, sx_port_log_id_t *log_port_list_p, uint32_t *log_port_cnt_p) |
| sx_status_t | sx_api_lag_port_group_iter_get (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_swid_t swid, const sx_port_log_id_t lag_id, const sx_lag_filter_t *filter_p, sx_port_log_id_t *lag_id_list_p, uint32_t *lag_id_cnt_p) |
| sx_status_t | sx_api_lag_port_collector_set (const sx_api_handle_t handle, const sx_port_log_id_t lag_log_port, const sx_port_log_id_t log_port, const sx_collector_mode_t collector_mode) |
| sx_status_t | sx_api_lag_port_collector_get (const sx_api_handle_t handle, const sx_port_log_id_t lag_log_port, const sx_port_log_id_t log_port, sx_collector_mode_t *collector_mode_p) |
| sx_status_t | sx_api_lag_port_distributor_set (const sx_api_handle_t handle, const sx_port_log_id_t lag_log_port, const sx_port_log_id_t log_port, const sx_distributor_mode_t distributor_mode) |
| sx_status_t | sx_api_lag_port_distributor_get (const sx_api_handle_t handle, const sx_port_log_id_t lag_log_port, const sx_port_log_id_t log_port, sx_distributor_mode_t *distributor_mode_p) |
| sx_status_t | sx_api_lag_hash_flow_params_set (const sx_api_handle_t handle, const sx_lag_hash_param_t *lag_hash_param_p) |
| sx_status_t | sx_api_lag_port_hash_flow_params_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_port_log_id_t log_port, const sx_lag_port_hash_params_t *hash_params_p, const sx_lag_hash_field_enable_t *hash_field_enable_list_p, const uint32_t hash_field_enable_list_cnt, const sx_lag_hash_field_t *hash_field_list_p, const uint32_t hash_field_list_cnt) |
| sx_status_t | sx_api_lag_hash_flow_params_get (const sx_api_handle_t handle, sx_lag_hash_param_t *lag_hash_param_p) |
| sx_status_t | sx_api_lag_port_hash_flow_params_get (const sx_api_handle_t handle, const sx_port_log_id_t log_port, sx_lag_port_hash_params_t *lag_hash_params_p, sx_lag_hash_field_enable_t *hash_field_enable_list_p, uint32_t *hash_field_enable_list_cnt_p, sx_lag_hash_field_t *hash_field_list_p, uint32_t *hash_field_list_cnt_p) |
| sx_status_t | sx_api_lag_redirect_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_port_log_id_t lag_log_port, const sx_port_log_id_t redirect_lag_log_port) |
| sx_status_t | sx_api_lag_redirect_get (const sx_api_handle_t handle, const sx_port_log_id_t lag_log_port, boolean_t *is_redirected_p, sx_port_log_id_t *redirected_lag_log_port_p) |
| sx_status_t | sx_api_lag_redirected_lags_get (const sx_api_handle_t handle, const sx_port_log_id_t lag_log_port, sx_port_log_id_t *lag_log_port_list_p, uint32_t *lag_log_port_cnt_p) |
| sx_status_t | sx_api_lag_distributer_list_set (const sx_api_handle_t handle, const sx_access_cmd_t access_cmd, const sx_port_log_id_t lag_log_port, const sx_lag_fine_grain_params_t *params_p, const sx_lag_fine_grain_member_t *port_list_p, const uint32_t port_cnt) |
| sx_status_t | sx_api_lag_distributer_list_get (const sx_api_handle_t handle, const sx_port_log_id_t lag_log_port, sx_lag_fine_grain_params_t *params_p, sx_lag_fine_grain_member_t *port_list_p, uint32_t *port_cnt_p) |
| sx_status_t sx_api_lag_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 function sets the log verbosity level of LAG MODULE. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | verbosity_target | - set verbosity of : API / MODULE / BOTH |
| [in] | module_verbosity_level | - LAG module verbosity level |
| [in] | api_verbosity_level | - LAG API verbosity level |
| sx_status_t sx_api_lag_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 function sets the log verbosity level of LAG MODULE. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | verbosity_target | - get verbosity of : API / MODULE / BOTH |
| [out] | module_verbosity_level_p | - LAG module verbosity level |
| [out] | api_verbosity_level_p | - LAG API verbosity level |
| sx_status_t sx_api_lag_port_group_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_swid_t | swid, | ||
| sx_port_log_id_t * | lag_log_port_p, | ||
| const sx_port_log_id_t * | log_port_list_p, | ||
| const uint32_t | log_port_cnt | ||
| ) |
This function creates/destroys a new/existing LAG port group in the SDK. This function also adds/deletes ports to/from an existing LAG port group in the SDK.
Note:
Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | cmd | - CREATE/DESTROY/ADD/DELETE |
| [in] | swid | - switch (virtual partition) ID |
| [in,out] | lag_log_port_p | - In: Already created LAG ports group ID Out: Newly created LAG ports group ID |
| [in] | log_port_list_p | - List of logical ports to ADD/DELETE to/from a LAG ports group |
| [in] | log_port_cnt | - Number of logical ports to ADD/DELETE to/from a LAG ports group |
| sx_status_t sx_api_lag_port_group_get | ( | const sx_api_handle_t | handle, |
| const sx_swid_t | swid, | ||
| const sx_port_log_id_t | lag_log_port, | ||
| sx_port_log_id_t * | log_port_list_p, | ||
| uint32_t * | log_port_cnt_p | ||
| ) |
This function retrieves an existing LAG ports group from the SDK.
Note: If the output ports list is NULL, only the number of ports in the LAG is retrieved. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | swid | - switch (virtual partition) ID |
| [in] | lag_log_port | - LAG ports group ID |
| [in,out] | log_port_list_p | - list of logical ports |
| [in,out] | log_port_cnt_p | - In: Number of logical ports in list Out: Number of logical ports in LAG |
| sx_status_t sx_api_lag_port_group_iter_get | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_swid_t | swid, | ||
| const sx_port_log_id_t | lag_id, | ||
| const sx_lag_filter_t * | filter_p, | ||
| sx_port_log_id_t * | lag_id_list_p, | ||
| uint32_t * | lag_id_cnt_p | ||
| ) |
This function retrieves a list of one or more LAG IDs. 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] | swid | - virtual switch partition ID |
| [in] | lag_id | - LAG ID |
| [in] | filter_p | - specify a filter parameter (not supported yet) |
| [out] | lag_id_list_p | - return list of LAG IDs |
| [in,out] | lag_id_cnt_p | - [in] number of LAG IDs to get
|
| sx_status_t sx_api_lag_port_collector_set | ( | const sx_api_handle_t | handle, |
| const sx_port_log_id_t | lag_log_port, | ||
| const sx_port_log_id_t | log_port, | ||
| const sx_collector_mode_t | collector_mode | ||
| ) |
This function enables/disables collection on a specific LAG port. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | lag_log_port | - a logical port number representing the LAG ports group |
| [in] | log_port | - logical port number |
| [in] | collector_mode | - collector mode |
| sx_status_t sx_api_lag_port_collector_get | ( | const sx_api_handle_t | handle, |
| const sx_port_log_id_t | lag_log_port, | ||
| const sx_port_log_id_t | log_port, | ||
| sx_collector_mode_t * | collector_mode_p | ||
| ) |
This function returns information whether collection is enabled or disabled on a specific port in a LAG port. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle. |
| [in] | lag_log_port | - a logical port number representing the LAG ports group |
| [in] | log_port | - logical port number |
| [out] | collector_mode_p | - collector mode. |
| sx_status_t sx_api_lag_port_distributor_set | ( | const sx_api_handle_t | handle, |
| const sx_port_log_id_t | lag_log_port, | ||
| const sx_port_log_id_t | log_port, | ||
| const sx_distributor_mode_t | distributor_mode | ||
| ) |
This function enables/disables distribution on a specific LAG port. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | lag_log_port | - a logical port number representing the LAG ports group |
| [in] | log_port | - logical port number |
| [in] | distributor_mode | - distributor mode |
| sx_status_t sx_api_lag_port_distributor_get | ( | const sx_api_handle_t | handle, |
| const sx_port_log_id_t | lag_log_port, | ||
| const sx_port_log_id_t | log_port, | ||
| sx_distributor_mode_t * | distributor_mode_p | ||
| ) |
This function returns information whether distribution is enabled or disabled on a specific port in a LAG port. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle. |
| [in] | lag_log_port | - a logical port number representing the LAG ports group |
| [in] | log_port | - logical port number |
| [out] | distributor_mode_p | - distributor mode. |
| sx_status_t sx_api_lag_hash_flow_params_set | ( | const sx_api_handle_t | handle, |
| const sx_lag_hash_param_t * | lag_hash_param_p | ||
| ) |
This function configures the flow indicators that impact the LAG hash distribution function. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | lag_hash_param_p | - hash parameters |
| sx_status_t sx_api_lag_port_hash_flow_params_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_port_log_id_t | log_port, | ||
| const sx_lag_port_hash_params_t * | hash_params_p, | ||
| const sx_lag_hash_field_enable_t * | hash_field_enable_list_p, | ||
| const uint32_t | hash_field_enable_list_cnt, | ||
| const sx_lag_hash_field_t * | hash_field_list_p, | ||
| const uint32_t | hash_field_list_cnt | ||
| ) |
This function sets the ingress port configuration parameters of LAG hash. Once this API is called sx_api_lag_hash_params_set is disabled.
Command SET replaces existing hash parameters, fields enables and fields with new values. Command ADD adds new fields and fields enables to existing ones. Hash parameters are ignored Command DELETE deletes specific fields and fields enables from the existing ones. Hash parameters are ignored Each element in hash_field_enable_list_p enables a specific layer field to be included in the hash calculation according to the de-facto fields of the parsed packet. Each element in hash_field_list_p represents a different field to be included in the hash calculation, subject to the enables which are given in hash_field_enable_list_p. LAG hash parameters are configured per ingress port and impact egress LAG.
Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle. |
| [in] | cmd | - SET/ ADD/ DELETE. |
| [in] | log_port | - log port ID of ingress port |
| [in] | lag_hash_params_p | - LAG hash configuration parameters. |
| [in] | hash_field_enable_list_p | - Array of enables to be included in the hash calculation (may be NULL if empty) |
| [in] | hash_field_enable_list_cnt | - Number of elements in hash_field_enable_list_p |
| [in] | hash_field_list_p | - Array of fields to be included in the hash calculation (may be NULL if empty) Note that for Spectrum devices, custom_bytes are not supported |
| [in] | hash_field_list_cnt | - Number of elements in hash_field_list_p |
| sx_status_t sx_api_lag_hash_flow_params_get | ( | const sx_api_handle_t | handle, |
| sx_lag_hash_param_t * | lag_hash_param_p | ||
| ) |
This function retrieves the flow indicators that impact the LAG hash distribution function. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle |
| [out] | lag_hash_param_p | - hash parameters to be retrieved |
| sx_status_t sx_api_lag_port_hash_flow_params_get | ( | const sx_api_handle_t | handle, |
| const sx_port_log_id_t | log_port, | ||
| sx_lag_port_hash_params_t * | lag_hash_params_p, | ||
| sx_lag_hash_field_enable_t * | hash_field_enable_list_p, | ||
| uint32_t * | hash_field_enable_list_cnt_p, | ||
| sx_lag_hash_field_t * | hash_field_list_p, | ||
| uint32_t * | hash_field_list_cnt_p | ||
| ) |
This function gets the LAG hash function configuration parameters. if the given number of fields / field enables is 0, the API will only return number of fields / field enables. Once this API is called sx_api_lag_hash_params_get is disable
Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle. |
| [in] | log_port | - local port |
| [out] | lag_hash_params_p | - LAG hash configuration parameters. |
| [out] | hash_field_enable_list_p | - array of enables used in the hash calculation |
| [in/out] | hash_field_enable_list_cnt_p - number of objects in hash_field_list_p | |
| [out] | hash_field_list_p | - array of fields used in the hash calculation |
| [in/out] | hash_field_list_cnt_p - number of objects in hash_field_list_p |
| sx_status_t sx_api_lag_redirect_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | cmd, | ||
| const sx_port_log_id_t | lag_log_port, | ||
| const sx_port_log_id_t | redirect_lag_log_port | ||
| ) |
This function CREATEs/DESTROYs a redirection between a LAG and a destination LAG. Redirection doesn't align LAG configuration, only TX traffic.
Note:
| [in] | handle | - SX-API handle |
| [in] | cmd | - CREATE/DESTROY |
| [in] | lag_log_port | - LAG logical ID |
| [in] | redirect_lag_log_port | - LAG logical ID which lag_log_port now points to. Ignored in DESTROY command. |
| sx_status_t sx_api_lag_redirect_get | ( | const sx_api_handle_t | handle, |
| const sx_port_log_id_t | lag_log_port, | ||
| boolean_t * | is_redirected_p, | ||
| sx_port_log_id_t * | redirected_lag_log_port_p | ||
| ) |
This function returns information whether a given LAG is redirected. If so, the redirected LAG logical ID is return. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle. |
| [in] | lag_log_port | - LAG logical ID. |
| [out] | is_redirected_p | - is lag_port redirected. |
| [out] | redirected_lag_log_port_p | - the LAG logical ID which lag_log_port point to. Valid when the LAG is redirected. |
| sx_status_t sx_api_lag_redirected_lags_get | ( | const sx_api_handle_t | handle, |
| const sx_port_log_id_t | lag_log_port, | ||
| sx_port_log_id_t * | lag_log_port_list_p, | ||
| uint32_t * | lag_log_port_cnt_p | ||
| ) |
This function returns all LAGs redirected to the given LAG. Call this API with lag_log_port_list_p=NULL will set to lag_log_port_cnt_p the number of LAG redirected to lag_port. Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle |
| [in] | lag_log_port | - LAG logical ID |
| [in,out] | lag_log_port_list_p | - pointer to array of LAG port list |
| [in,out] | lag_log_port_cnt_p | - number of LAG ports in a list retrieve |
| sx_status_t sx_api_lag_distributer_list_set | ( | const sx_api_handle_t | handle, |
| const sx_access_cmd_t | access_cmd, | ||
| const sx_port_log_id_t | lag_log_port, | ||
| const sx_lag_fine_grain_params_t * | params_p, | ||
| const sx_lag_fine_grain_member_t * | port_list_p, | ||
| const uint32_t | port_cnt | ||
| ) |
This function sets a fine grained LAG distribution list. Lag distribution will be according to the given port list with relative weight.
Note:
Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle. |
| [in] | access_cmd | - SET/ADD/DELETE/DELETE_ALL. SET - LAG distribution list according to port list with relative weight. ADD - Add ports to the existing LAG distribution list. DELETE - Delete ports from distribution list. DELETE ALL - return to the default distribution function. |
| [in] | lag_log_port | - logical port number representing the LAG. |
| [in] | params_p | - the fine grain lag parameters. Controls the resolution of the distribution list. valid for SET command only. |
| [in] | port_list_p | - list of ports to SET/ADD/DELETE distribution list with weights. On add the members should not exist in the LAG distribution list. On delete the members should exist in the LAG distribution list. |
| [in] | port_cnt | - number of elements on port_list_p |
| sx_status_t sx_api_lag_distributer_list_get | ( | const sx_api_handle_t | handle, |
| const sx_port_log_id_t | lag_log_port, | ||
| sx_lag_fine_grain_params_t * | params_p, | ||
| sx_lag_fine_grain_member_t * | port_list_p, | ||
| uint32_t * | port_cnt_p | ||
| ) |
This function retrieves a fine grained LAG distribution list and the fine grain lag parameters.
Supported devices: Spectrum, Spectrum2.
| [in] | handle | - SX-API handle. |
| [in] | lag_log_port | - logical port number representing the LAG. |
| [out] | params_p | - the fine grained lag parameters. |
| [out] | port_list_p | - list of ports and weights in the advance distribution port list. |
| [in/out] | port_cnt_p - number of ports in the distribution list |
1.8.16