Mellanox SwitchX SDK API Guide  4.3.2104
Functions
sx_api_fcf.h File Reference

Go to the source code of this file.

Functions

sx_status_t sx_api_fcf_log_verbosity_level (sx_api_handle_t handle, sx_access_cmd_t cmd, 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_fcf_init (const sx_api_handle_t handle, const sx_fcf_param_t *params)
 
sx_status_t sx_api_fcf_deinit (const sx_api_handle_t handle)
 
sx_status_t sx_api_fcf_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_fcf_attributes_t *fcf_attr, sx_fcf_id_t *fcf)
 
sx_status_t sx_api_fcf_get (const sx_api_handle_t handle, const sx_access_cmd_t cmd, sx_fcf_id_t *fcf, sx_fcf_attributes_t *fcf_attr)
 
sx_status_t sx_api_fcf_v_port_interface_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_fcf_id_t fcf, const sx_fcf_v_port_attributes_t *v_port_attr, sx_fcf_v_port_handle_t *v_port_handle)
 
sx_status_t sx_api_fcf_ipl_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_port_log_id_t port_list[], const length_t log_port_num)
 
sx_status_t sx_api_fcf_ipl_get (const sx_api_handle_t handle, sx_port_log_id_t port_list[], length_t *log_port_num)
 
sx_status_t sx_api_fcf_v_port_interface_get (const sx_api_handle_t handle, const sx_access_cmd_t cmd, sx_fcf_v_port_handle_t *v_port_handle, sx_fcf_id_t *fcf, sx_fcf_v_port_attributes_t *v_port_attr)
 
sx_status_t sx_api_fcf_forwarding_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_fcf_id_t fcf, const sx_fc_addr_t *did, const sx_fc_addr_t *did_mask, const sx_fc_addr_t *sid, const sx_fc_addr_t *sid_mask, const sx_fcf_v_port_handle_t v_port_handle)
 
sx_status_t sx_api_fcf_forwarding_get (const sx_api_handle_t handle, sx_access_cmd_t access_cmd, const sx_fcf_id_t fcf, sx_fc_addr_t *did, sx_fc_addr_t *did_mask, sx_fc_addr_t *sid, sx_fc_addr_t *sid_mask, sx_fcf_v_port_handle_t *v_port_handle)
 
sx_status_t sx_api_fcf_cntr_alloc_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, sx_fcf_cntr_id_t *cntr)
 
sx_status_t sx_api_fcf_cntr_bind_set (const sx_api_handle_t handle, const sx_access_cmd_t cmd, const sx_fcf_cntr_id_t cntr, const sx_fcf_v_port_handle_t v_port_handle)
 
sx_status_t sx_api_fcf_cntr_bind_get (const sx_api_handle_t handle, const sx_fcf_cntr_id_t cntr, sx_fcf_v_port_handle_t *v_port_handle)
 
sx_status_t sx_api_fcf_cntr_get (const sx_api_handle_t handle, const sx_fcf_cntr_id_t cntr, sx_fcf_cntr_set_t *cntr_set)
 
sx_status_t sx_api_fcf_cntr_clear_set (const sx_api_handle_t handle, const sx_fcf_cntr_id_t cntr, const boolean_t all)
 

Function Documentation

◆ sx_api_fcf_log_verbosity_level()

sx_status_t sx_api_fcf_log_verbosity_level ( sx_api_handle_t  handle,
sx_access_cmd_t  cmd,
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 FCF MODULE Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle
[in]cmd- SET / GET
[in]verbosity_target- set get verbosity of : API / MODULE / BOTH
[in,out]module_verbosity_level_p- FCF module verbosity level
[in,out]api_verbosity_level_p- FCF API verbosity level
Returns
SX_STATUS_SUCCESS if operation completes successfully
SX_STATUS_PARAM_ERROR if any input parameters is invalid
SX_STATUS_ERROR general error

◆ sx_api_fcf_init()

sx_status_t sx_api_fcf_init ( const sx_api_handle_t  handle,
const sx_fcf_param_t *  params 
)

This function Initiates the FCF module in SDK. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]params- FCF parameters.
Returns
SX_STATUS_SUCCESS - if operation completes successfully.
SX_STATUS_ALREADY_INITIALIZED - When FCF is already initialized.
SX_STATUS_PARAM_EXCEEDS_RANGE - When calling with bad parameters.

◆ sx_api_fcf_deinit()

sx_status_t sx_api_fcf_deinit ( const sx_api_handle_t  handle)

This api deinitializes the FCF in the sdk. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_RESOURCE_IN_USE When FCF is still active.

◆ sx_api_fcf_set()

sx_status_t sx_api_fcf_set ( const sx_api_handle_t  handle,
const sx_access_cmd_t  cmd,
const sx_fcf_attributes_t *  fcf_attr,
sx_fcf_id_t *  fcf 
)

This function adds/modifies/deletes a FCF. The FCF ID is allocated and returned to the caller when cmd is ADD, otherwise it is given by the caller. All v_ports and forwarding rules associated with a FCF must be deleted and deallocated before the FCF can be deleted as well. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cmd- ADD/EDIT/DELETE.
[in]fcf_attr- FCF attributes.
[in,out]fcf- FCF ID
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_CMD_UNSUPPORTED if access command isn't supported.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_PARAM_NULL if parameter is NULL.
SX_STATUS_PARAM_ERROR if any input parameters is invalid.
SX_STATUS_ENTRY_NOT_FOUND if FCF was not added.
SX_STATUS_NO_RESOURCES if there are no resources to create another FCF
SX_STATUS_RESOURCE_IN_USE if FCF has v_ports or forwarding rules.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_get()

sx_status_t sx_api_fcf_get ( const sx_api_handle_t  handle,
const sx_access_cmd_t  cmd,
sx_fcf_id_t *  fcf,
sx_fcf_attributes_t *  fcf_attr 
)

This function gets a FCF information. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cmd- get, get_next, get first
[in,out]fcf- FCF ID.
[out]fcf_attr- FCF attributes.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_PARAM_NULL if parameter is NULL.
SX_STATUS_ENTRY_NOT_FOUND if FCF was not added.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_v_port_interface_set()

sx_status_t sx_api_fcf_v_port_interface_set ( const sx_api_handle_t  handle,
const sx_access_cmd_t  cmd,
const sx_fcf_id_t  fcf,
const sx_fcf_v_port_attributes_t *  v_port_attr,
sx_fcf_v_port_handle_t *  v_port_handle 
)

This function adds/deletes a v_port from a FCF. If the type if VE_port a MAC should be given. If the type is VF_port, a mac should not be given as it is calculated by the fabric. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cmd- ADD/DELETE/DELETE_ALL.
[in]fcf- FCF ID.
[in]v_port_attr- v port attributes, can be NULL in case of delete
[in,out]v_port_handle- A pointer to the added/deleted v_port object.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_CMD_UNSUPPORTED if access command isn't supported.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_ENTRY_NOT_FOUND if FCF v_port was not added.
SX_STATUS_PARAM_ERROR if any input parameters is invalid.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_ipl_set()

sx_status_t sx_api_fcf_ipl_set ( const sx_api_handle_t  handle,
const sx_access_cmd_t  cmd,
const sx_port_log_id_t  port_list[],
const length_t  log_port_num 
)

This function defines the IPL (Ingress Port List) in the SDK. SET = Discard the previous list and use the given list DEFAULT = Return all the ports to the IPL (by default, all the ports are in the IPL). DELETE_ALL = Remove all the ports from the IPL. In addition, it can also ADD/DELETE ports to/from the IPL. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cmd- DEFAULT/SET/DELETE_ALL/ADD/DELETE.
[in]port_list- List of Logical Ports to ADD/DELETE to/from an IPL.
[in]port_num- Number of Logical Ports to ADD/DELETE to/from an IPL.
Returns
SX_STATUS_SUCCESS - Operation completes successfully.
SX_STATUS_CMD_UNSUPPORTED if unsupported command is requested
SX_STATUS_INVALID_HANDLE: Invalid Handle
SX_STATUS_MESSAGE_SIZE_ZERO: Message size error
SX_STATUS_MESSAGE_SIZE_EXCEEDS_LIMIT: Message size error
SX_STATUS_PARAM_NULL - Parameter is unexpectedly NULL.
SX_STATUS_PARAM_ERROR - Parameter is invalid.
SX_STATUS_ENTRY_NOT_FOUND - Requested element is not found in DB.
SX_STATUS_PARAM_EXCEEDS_RANGE - Parameter exceeds its range.
SX_STATUS_SXD_RETURNED_NON_ZERO - Error status returned from Firmware

◆ sx_api_fcf_ipl_get()

sx_status_t sx_api_fcf_ipl_get ( const sx_api_handle_t  handle,
sx_port_log_id_t  port_list[],
length_t *  log_port_num 
)

This function retrieves the IPL (Ingress Port List) from the SDK. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[out]port_list- List of Logical Ports in the IPL.
[out]port_num- Number of Logical Ports in the IPL.
Returns
SX_STATUS_SUCCESS - Operation completes successfully.
SX_STATUS_CMD_UNSUPPORTED if unsupported command is requested
SX_STATUS_INVALID_HANDLE: Invalid Handle
SX_STATUS_MESSAGE_SIZE_ZERO: Message size error
SX_STATUS_MESSAGE_SIZE_EXCEEDS_LIMIT: Message size error
SX_STATUS_PARAM_NULL - Parameter is unexpectedly NULL.
SX_STATUS_PARAM_ERROR - Parameter is invalid.
SX_STATUS_ENTRY_NOT_FOUND - Requested element is not found in DB.
SX_STATUS_PARAM_EXCEEDS_RANGE - Parameter exceeds its range.

◆ sx_api_fcf_v_port_interface_get()

sx_status_t sx_api_fcf_v_port_interface_get ( const sx_api_handle_t  handle,
const sx_access_cmd_t  cmd,
sx_fcf_v_port_handle_t *  v_port_handle,
sx_fcf_id_t *  fcf,
sx_fcf_v_port_attributes_t *  v_port_attr 
)

This function gets a v_port of a FCF. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cmd- get, get_next, get first
[in,out]v_port_handle- A pointer to the queried v_port object.
[out]fcf- FCF ID to which the v_port belongs.
[out]v_port_attr- The attributes of the queried v_port.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_PARAM_NULL if parameter is NULL.
SX_STATUS_PARAM_ERROR if any input parameters is invalid.
SX_STATUS_ENTRY_NOT_FOUND if FCF was not added.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_forwarding_set()

sx_status_t sx_api_fcf_forwarding_set ( const sx_api_handle_t  handle,
const sx_access_cmd_t  cmd,
const sx_fcf_id_t  fcf,
const sx_fc_addr_t *  did,
const sx_fc_addr_t *  did_mask,
const sx_fc_addr_t *  sid,
const sx_fc_addr_t *  sid_mask,
const sx_fcf_v_port_handle_t  v_port_handle 
)

This function adds/modifies/deletes a forwarding entry into the forwarding table. The forwarding entry is composed of sid, sid mask, did, did mask mapped to a V_port Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cmd- ADD/EDIT/DELETE/DELETE_ALL.
[in]fcf- FCF ID.
[in]did- FC destination address
[in]did_mask- bits from the DID that are used for LPM
[in]sid- FC source address
[in]sid_mask- bits from the DID that are used for LPM
[in]v_port_handle- The v_port the forwarding rule is mapped to.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_CMD_UNSUPPORTED if access command isn't supported.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_PARAM_ERROR if any input parameters is invalid.
SX_STATUS_NO_RESOURCES if no forwarding entry is available to create.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_forwarding_get()

sx_status_t sx_api_fcf_forwarding_get ( const sx_api_handle_t  handle,
sx_access_cmd_t  access_cmd,
const sx_fcf_id_t  fcf,
sx_fc_addr_t *  did,
sx_fc_addr_t *  did_mask,
sx_fc_addr_t *  sid,
sx_fc_addr_t *  sid_mask,
sx_fcf_v_port_handle_t *  v_port_handle 
)

This function gets a forwarding entry from the forwarding table. The forwarding entry is composed of sid, sid mask, did, did mask mapped to a V_port Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]access_cmd- get, get_next, get first
[in]fcf- FCF ID.
[in]did- FC destination address
[in]did_mask- bits from the DID that are used for LPM
[in]sid- FC source address
[in]sid_mask- bits from the DID that are used for LPM
[out]v_port_handle- The v_port the forwarding rule is mapped to.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_CMD_UNSUPPORTED if access command isn't supported.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_PARAM_ERROR if any input parameters is invalid.
SX_STATUS_NO_RESOURCES if no forwarding entry is available to create.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_cntr_alloc_set()

sx_status_t sx_api_fcf_cntr_alloc_set ( const sx_api_handle_t  handle,
const sx_access_cmd_t  cmd,
sx_fcf_cntr_id_t *  cntr 
)

This function allocates/deallocates a FCF counter. A FCF counter should be bound later to a FCF v_port. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cmd- ADD/DELETE.
[in,out]cntr- FCF counter ID.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_CMD_UNSUPPORTED if access command isn't supported.
SX_STATUS_PARAM_NULL if parameter is NULL.
SX_STATUS_NO_RESOURCES if no counter is available to create.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_cntr_bind_set()

sx_status_t sx_api_fcf_cntr_bind_set ( const sx_api_handle_t  handle,
const sx_access_cmd_t  cmd,
const sx_fcf_cntr_id_t  cntr,
const sx_fcf_v_port_handle_t  v_port_handle 
)

This function binds/unbinds a FCF counter to a FCF v_port. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cmd- ADD/DELETE.
[in]cntr- FCF counter ID.
[in]v_port_handle- The v_port the counter should be bound/unbound from.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_CMD_UNSUPPORTED if access command isn't supported.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_PARAM_ERROR if any input parameters is invalid.
SX_STATUS_ENTRY_NOT_FOUND if counter was not added.
SX_STATUS_RESOURCE_IN_USE if interface is already bound.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_cntr_bind_get()

sx_status_t sx_api_fcf_cntr_bind_get ( const sx_api_handle_t  handle,
const sx_fcf_cntr_id_t  cntr,
sx_fcf_v_port_handle_t *  v_port_handle 
)
Deprecated:
This API is deprecated and will be removed in the future

This function gets a FCF counter bind of a FCF v_port. Supported devices: Not Supported

Parameters
[in]handle- SX-API handle.
[in]cntr- FCF counter ID.
[out]v_port_handle- The v_port the counter is bound to.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_CMD_UNSUPPORTED if access command isn't supported.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_ENTRY_NOT_FOUND if counter was not added.
SX_STATUS_ENTRY_NOT_BOUND if counter was not bound.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_cntr_get()

sx_status_t sx_api_fcf_cntr_get ( const sx_api_handle_t  handle,
const sx_fcf_cntr_id_t  cntr,
sx_fcf_cntr_set_t *  cntr_set 
)

This function gets FCF counter set of a FCF counter. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cntr- FCF counter ID.
[out]cntr_set- FCF counter set values.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_PARAM_NULL if parameter is NULL.
SX_STATUS_PARAM_ERROR if any input parameters is invalid.
SX_STATUS_ENTRY_NOT_FOUND if counter was not added.
SX_STATUS_ERROR general error.

◆ sx_api_fcf_cntr_clear_set()

sx_status_t sx_api_fcf_cntr_clear_set ( const sx_api_handle_t  handle,
const sx_fcf_cntr_id_t  cntr,
const boolean_t  all 
)

This function clears fcf counter set of a fcf counter. Supported devices: Not Supported

Deprecated:
This API is deprecated and will be removed in the future
Parameters
[in]handle- SX-API handle.
[in]cntr- FCF counter ID.
[in]all- Clear all FCF counters.
Returns
SX_STATUS_SUCCESS if operation completes successfully.
SX_STATUS_PARAM_EXCEEDS_RANGE if parameters exceed range.
SX_STATUS_PARAM_NULL if parameter is NULL.
SX_STATUS_PARAM_ERROR if any input parameters is invalid.
SX_STATUS_ENTRY_NOT_FOUND if counter was not added.
SX_STATUS_ERROR general error.