OpenNSL API Guide and Reference Manual
|
Data Structures | |
struct | opennsl_switch_pkt_info_s |
Switch packet info structure. More... | |
struct | opennsl_switch_pkt_trace_hashing_info_s |
packet hashing resolution information More... | |
struct | opennsl_switch_pkt_trace_info_s |
packet trace ingress process data More... | |
struct | opennsl_switch_pkt_trace_lookup_result_s |
lookup result set bit map More... | |
Files | |
file | switchX.h |
Macros | |
#define | OPENNSL_COLOR_OUTER_CFI 1 |
SPVLAN CFI->COLOR mapping. | |
#define | OPENNSL_COLOR_PRIORITY 0 |
Priority->COLOR mapping. | |
#define | OPENNSL_HASH_CONTROL_ECMP_ENHANCE 0x0080 |
Use enhanced ECMP hashing. | |
#define | OPENNSL_HASH_CONTROL_MULTIPATH_DIP 0x0002 |
Use destination IP address. | |
#define | OPENNSL_HASH_CONTROL_MULTIPATH_L4PORTS 0x0001 |
Use TCP/UDP ports. | |
#define | OPENNSL_HASH_CONTROL_TRUNK_NUC_DST 0x0010 |
Use destination MAC or IP address. | |
#define | OPENNSL_HASH_CONTROL_TRUNK_NUC_ENHANCE 0x0100 |
Use enhanced non-unicast trunk hashing. | |
#define | OPENNSL_HASH_CONTROL_TRUNK_NUC_SRC 0x0020 |
Use source MAC or IP address. | |
#define | OPENNSL_HASH_CONTROL_TRUNK_UC_SRCPORT 0x0008 |
Use source port. | |
#define | OPENNSL_HASH_FIELD_CONFIG_CRC16CCITT 0x00000007 |
16-bit CRC using CCITT polynomial. | |
#define | OPENNSL_HASH_FIELD_CONFIG_CRC16XOR8 0x00000001 |
8-bit CRC16 + 8-bit XOR8. | |
#define | OPENNSL_HASH_FIELD_CONFIG_CRC32HI 0x00000009 |
Higher 16-bit of CRC32. | |
#define | OPENNSL_HASH_FIELD_CONFIG_CRC32LO 0x00000008 |
Lower 16-bit of CRC32. | |
#define | OPENNSL_HASH_FIELD_CONFIG_XOR16 0x00000006 |
16-bit XOR. | |
#define | OPENNSL_HASH_FIELD_DSTL4 0x00000020 |
Destination L4 port. | |
#define | OPENNSL_HASH_FIELD_IP4DST_HI 0x00000200 |
IPv4 destination address upper 16 bits. | |
#define | OPENNSL_HASH_FIELD_IP4DST_LO 0x00000100 |
IPv4 destination address lower 16 bits. | |
#define | OPENNSL_HASH_FIELD_IP4SRC_HI 0x00000800 |
IPv4 source address upper 16 bits. | |
#define | OPENNSL_HASH_FIELD_IP4SRC_LO 0x00000400 |
IPv4 source address lower 16 bits. | |
#define | OPENNSL_HASH_FIELD_IP6DST_HI 0x00002000 |
IPv6 collapsed destination address upper 16 bits. | |
#define | OPENNSL_HASH_FIELD_IP6DST_LO 0x00001000 |
IPv6 collapsed destination address lower 16 bits. | |
#define | OPENNSL_HASH_FIELD_IP6SRC_HI 0x00008000 |
IPv6 collapsed source address upper 16 bits. | |
#define | OPENNSL_HASH_FIELD_IP6SRC_LO 0x00004000 |
IPv6 collapsed source address lower 16 bits. | |
#define | OPENNSL_HASH_FIELD_MACDA_HI 0x00100000 |
MAC destination address upper 16 bits. | |
#define | OPENNSL_HASH_FIELD_MACDA_LO 0x00040000 |
MAC destination address lower 16 bits. | |
#define | OPENNSL_HASH_FIELD_MACDA_MI 0x00080000 |
MAC destination address middle 16 bits. | |
#define | OPENNSL_HASH_FIELD_MACSA_HI 0x00800000 |
MAC source address upper 16 bits. | |
#define | OPENNSL_HASH_FIELD_MACSA_LO 0x00200000 |
MAC source address lower 16 bits. | |
#define | OPENNSL_HASH_FIELD_MACSA_MI 0x00400000 |
MAC source address middle 16 bits. | |
#define | OPENNSL_HASH_FIELD_SRCL4 0x00000040 |
Source L4 port. | |
#define | OPENNSL_HASH_FIELD_VLAN 0x00000080 |
VLAN ID. | |
#define | OPENNSL_SWITCH_PKT_INFO_DST_IP (1 << 6) |
Destination IPv4 address field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_DST_IPV6 (1 << 8) |
Destination IPv6 address field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_DST_L4_PORT (1 << 11) |
Destination L4 port field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_DST_MAC (1 << 4) |
Destination MAC address field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_ETHERTYPE (1 << 2) |
Ethertype field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_HASH_LBID (1 << 15) |
Retrieve LBID. | |
#define | OPENNSL_SWITCH_PKT_INFO_HASH_MULTIPATH (1 << 13) |
Retrieve ECMP hash result. | |
#define | OPENNSL_SWITCH_PKT_INFO_HASH_OVERLAY (1 << 16) |
Retrieve ECMP hash result for overlay layer. | |
#define | OPENNSL_SWITCH_PKT_INFO_HASH_TRUNK (1 << 12) |
Retrieve trunk hash result. | |
#define | OPENNSL_SWITCH_PKT_INFO_HASH_UDP_SOURCE_PORT (1 << 14) |
Retrieve Entropy Value of VXLan packet. | |
#define | OPENNSL_SWITCH_PKT_INFO_PROTOCOL (1 << 9) |
IP protocol field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_SRC_GPORT (1 << 0) |
Source gport (module, port) field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_SRC_IP (1 << 5) |
Source IPv4 address field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_SRC_IPV6 (1 << 7) |
Source IPv6 address field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_SRC_L4_PORT (1 << 10) |
Source L4 port field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_SRC_MAC (1 << 3) |
Source MAC address field valid. | |
#define | OPENNSL_SWITCH_PKT_INFO_VLAN (1 << 1) |
VLAN identifier field valid. | |
#define | OPENNSL_SWITCH_PKT_TRACE_ECMP_1 0x0001 |
level 1 ecmp hashing resolution done | |
#define | OPENNSL_SWITCH_PKT_TRACE_ECMP_2 0x0002 |
level 2 ecmp hashing resolution done | |
#define | OPENNSL_SWITCH_PKT_TRACE_FABRIC_TRUNK 0x0008 |
hg trunk hashing resolution done | |
#define | OPENNSL_SWITCH_PKT_TRACE_RAW_DATA_MAX 112 |
max bytes of pkt_trace_info.raw_data | |
#define | OPENNSL_SWITCH_PKT_TRACE_TRUNK 0x0004 |
trunk hashing resolution done | |
#define | OPENNSL_SWITCH_STABLE_APPLICATION (_SHR_SWITCH_STABLE_APPLICATION) |
Functions | |
int | opennsl_switch_control_get (int unit, opennsl_switch_control_t type, int *arg) LIB_DLL_EXPORTED |
Configure port-specific and device-wide operating modes. | |
int | opennsl_switch_control_port_get (int unit, opennsl_port_t port, opennsl_switch_control_t type, int *arg) LIB_DLL_EXPORTED |
Configure port-specific and device-wide operating modes. | |
int | opennsl_switch_control_port_set (int unit, opennsl_port_t port, opennsl_switch_control_t type, int arg) LIB_DLL_EXPORTED |
Configure port-specific and device-wide operating modes. | |
int | opennsl_switch_control_set (int unit, opennsl_switch_control_t type, int arg) LIB_DLL_EXPORTED |
Configure port-specific and device-wide operating modes. | |
int | opennsl_switch_event_register (int unit, opennsl_switch_event_cb_t cb, void *userdata) LIB_DLL_EXPORTED |
Registers/Unregisters a callback function for switch critical events. | |
int | opennsl_switch_event_unregister (int unit, opennsl_switch_event_cb_t cb, void *userdata) LIB_DLL_EXPORTED |
Registers/Unregisters a callback function for switch critical events. | |
int | opennsl_switch_object_count_multi_get (int unit, int object_size, opennsl_switch_object_t *object_array, int *entries) LIB_DLL_EXPORTED |
Retrieving the statistics on the number of API objects. | |
int | opennsl_switch_pkt_info_hash_get (int unit, opennsl_switch_pkt_info_t *pkt_info, opennsl_gport_t *dst_gport, opennsl_if_t *dst_intf) LIB_DLL_EXPORTED |
Gets the hash result for the specified link aggregation method using provided packet parameters and device configuration. | |
void | opennsl_switch_pkt_info_t_init (opennsl_switch_pkt_info_t *pkt_info) LIB_DLL_EXPORTED |
Initialize a opennsl_switch_pkt_info_t structure. | |
int | opennsl_switch_pkt_trace_info_get (int unit, uint32 options, uint8 port, int len, uint8 *data, opennsl_switch_pkt_trace_info_t *pkt_trace_info) LIB_DLL_EXPORTED |
Generate a visibility trace packet and then read the result of the packets ingress processing information. | |
int | opennsl_switch_temperature_monitor_get (int unit, int temperature_max, opennsl_switch_temperature_monitor_t *temperature_array, int *temperature_count) LIB_DLL_EXPORTED |
There are temperature monitors embedded in the various points of some switch chips for the purpose of monitoring the health of the chip. | |
#define OPENNSL_COLOR_OUTER_CFI 1 |
SPVLAN CFI->COLOR mapping.
Definition at line 514 of file switch.h.
Referenced by qos_pcp_map_create().
#define OPENNSL_COLOR_PRIORITY 0 |
Priority->COLOR mapping.
Definition at line 513 of file switch.h.
Referenced by qos_pcp_map_create().
#define OPENNSL_HASH_CONTROL_ECMP_ENHANCE 0x0080 |
#define OPENNSL_HASH_CONTROL_MULTIPATH_DIP 0x0002 |
Use destination IP address.
Definition at line 462 of file switch.h.
Referenced by example_trunk_hash_controls_set().
#define OPENNSL_HASH_CONTROL_MULTIPATH_L4PORTS 0x0001 |
Use TCP/UDP ports.
Definition at line 461 of file switch.h.
Referenced by example_trunk_hash_controls_set().
#define OPENNSL_HASH_CONTROL_TRUNK_NUC_DST 0x0010 |
Use destination MAC or IP address.
Definition at line 465 of file switch.h.
Referenced by example_trunk_hash_controls_set().
#define OPENNSL_HASH_CONTROL_TRUNK_NUC_ENHANCE 0x0100 |
#define OPENNSL_HASH_CONTROL_TRUNK_NUC_SRC 0x0020 |
Use source MAC or IP address.
Definition at line 467 of file switch.h.
Referenced by example_trunk_hash_controls_set().
#define OPENNSL_HASH_CONTROL_TRUNK_UC_SRCPORT 0x0008 |
Use source port.
Definition at line 464 of file switch.h.
Referenced by example_trunk_hash_controls_set().
#define OPENNSL_HASH_FIELD_CONFIG_CRC16CCITT 0x00000007 |
#define OPENNSL_HASH_FIELD_CONFIG_CRC16XOR8 0x00000001 |
#define OPENNSL_HASH_FIELD_CONFIG_CRC32HI 0x00000009 |
#define OPENNSL_HASH_FIELD_CONFIG_CRC32LO 0x00000008 |
#define OPENNSL_HASH_FIELD_CONFIG_XOR16 0x00000006 |
#define OPENNSL_HASH_FIELD_DSTL4 0x00000020 |
#define OPENNSL_HASH_FIELD_IP4DST_HI 0x00000200 |
#define OPENNSL_HASH_FIELD_IP4DST_LO 0x00000100 |
#define OPENNSL_HASH_FIELD_IP4SRC_HI 0x00000800 |
#define OPENNSL_HASH_FIELD_IP4SRC_LO 0x00000400 |
#define OPENNSL_HASH_FIELD_IP6DST_HI 0x00002000 |
#define OPENNSL_HASH_FIELD_IP6DST_LO 0x00001000 |
#define OPENNSL_HASH_FIELD_IP6SRC_HI 0x00008000 |
#define OPENNSL_HASH_FIELD_IP6SRC_LO 0x00004000 |
#define OPENNSL_HASH_FIELD_MACDA_HI 0x00100000 |
#define OPENNSL_HASH_FIELD_MACDA_LO 0x00040000 |
#define OPENNSL_HASH_FIELD_MACDA_MI 0x00080000 |
#define OPENNSL_HASH_FIELD_MACSA_HI 0x00800000 |
#define OPENNSL_HASH_FIELD_MACSA_LO 0x00200000 |
#define OPENNSL_HASH_FIELD_MACSA_MI 0x00400000 |
#define OPENNSL_HASH_FIELD_SRCL4 0x00000040 |
#define OPENNSL_SWITCH_PKT_INFO_DST_IP (1 << 6) |
#define OPENNSL_SWITCH_PKT_INFO_DST_IPV6 (1 << 8) |
#define OPENNSL_SWITCH_PKT_INFO_DST_L4_PORT (1 << 11) |
#define OPENNSL_SWITCH_PKT_INFO_DST_MAC (1 << 4) |
#define OPENNSL_SWITCH_PKT_INFO_ETHERTYPE (1 << 2) |
#define OPENNSL_SWITCH_PKT_INFO_HASH_LBID (1 << 15) |
#define OPENNSL_SWITCH_PKT_INFO_HASH_MULTIPATH (1 << 13) |
#define OPENNSL_SWITCH_PKT_INFO_HASH_OVERLAY (1 << 16) |
#define OPENNSL_SWITCH_PKT_INFO_HASH_TRUNK (1 << 12) |
#define OPENNSL_SWITCH_PKT_INFO_HASH_UDP_SOURCE_PORT (1 << 14) |
#define OPENNSL_SWITCH_PKT_INFO_PROTOCOL (1 << 9) |
#define OPENNSL_SWITCH_PKT_INFO_SRC_GPORT (1 << 0) |
#define OPENNSL_SWITCH_PKT_INFO_SRC_IP (1 << 5) |
#define OPENNSL_SWITCH_PKT_INFO_SRC_IPV6 (1 << 7) |
#define OPENNSL_SWITCH_PKT_INFO_SRC_L4_PORT (1 << 10) |
#define OPENNSL_SWITCH_PKT_INFO_SRC_MAC (1 << 3) |
#define OPENNSL_SWITCH_PKT_INFO_VLAN (1 << 1) |
#define OPENNSL_SWITCH_PKT_TRACE_ECMP_1 0x0001 |
#define OPENNSL_SWITCH_PKT_TRACE_ECMP_2 0x0002 |
#define OPENNSL_SWITCH_PKT_TRACE_FABRIC_TRUNK 0x0008 |
#define OPENNSL_SWITCH_PKT_TRACE_RAW_DATA_MAX 112 |
#define OPENNSL_SWITCH_PKT_TRACE_TRUNK 0x0004 |
#define OPENNSL_SWITCH_STABLE_APPLICATION (_SHR_SWITCH_STABLE_APPLICATION) |
typedef enum opennsl_switch_control_e opennsl_switch_control_t |
Switch controls.
typedef void(* opennsl_switch_event_cb_t)(int unit, opennsl_switch_event_t event, uint32 arg1, uint32 arg2, uint32 arg3, void *userdata) |
typedef enum opennsl_switch_object_e opennsl_switch_object_t |
Packet forward reason for hash calculation.
typedef struct opennsl_switch_pkt_info_s opennsl_switch_pkt_info_t |
Switch packet info structure.
Contains packet fields for calculating aggregate link hash values.
packet hashing resolution information
typedef struct opennsl_switch_pkt_trace_info_s opennsl_switch_pkt_trace_info_t |
packet trace ingress process data
lookup result set bit map
packet trace lookup result enums
Switch controls.
Packet forward reason for hash calculation.
int opennsl_switch_control_get | ( | int | unit, |
opennsl_switch_control_t | type, | ||
int * | arg | ||
) |
Configure port-specific and device-wide operating modes.
Device wide operating modes are configured on all ports, except the stack ports.
unit | [IN] Unit number. |
type | [IN] Switch control parameter (see =opennsl_switches) |
arg | [OUT] (for _set) Argument whose meaning is dependent on type |
OPENNSL_E_UNAVAIL | Feature not available on this device |
OPENNSL_E_XXX | Other error |
Referenced by example_trunk_hash_controls_set().
int opennsl_switch_control_port_get | ( | int | unit, |
opennsl_port_t | port, | ||
opennsl_switch_control_t | type, | ||
int * | arg | ||
) |
Configure port-specific and device-wide operating modes.
Device wide operating modes are configured on all ports, except the stack ports.
unit | [IN] Unit number. |
port | [IN] Device or logical port number |
type | [IN] Switch control parameter (see =opennsl_switches) |
arg | [OUT] (for _set) Argument whose meaning is dependent on type |
OPENNSL_E_UNAVAIL | Feature not available on this device |
OPENNSL_E_XXX | Other error |
int opennsl_switch_control_port_set | ( | int | unit, |
opennsl_port_t | port, | ||
opennsl_switch_control_t | type, | ||
int | arg | ||
) |
Configure port-specific and device-wide operating modes.
Device wide operating modes are configured on all ports, except the stack ports.
unit | [IN] Unit number. |
port | [IN] Device or logical port number |
type | [IN] Switch control parameter (see =opennsl_switches) |
arg | [IN] (for _set) Argument whose meaning is dependent on type |
OPENNSL_E_UNAVAIL | Feature not available on this device |
OPENNSL_E_XXX | Other error |
Referenced by qos_pcp_map_create().
int opennsl_switch_control_set | ( | int | unit, |
opennsl_switch_control_t | type, | ||
int | arg | ||
) |
Configure port-specific and device-wide operating modes.
Device wide operating modes are configured on all ports, except the stack ports.
unit | [IN] Unit number. |
type | [IN] Switch control parameter (see =opennsl_switches) |
arg | [IN] (for _set) Argument whose meaning is dependent on type |
OPENNSL_E_UNAVAIL | Feature not available on this device |
OPENNSL_E_XXX | Other error |
Referenced by example_l3_intf_rif_create(), example_trunk_hash_controls_set(), example_vxlan(), and main().
int opennsl_switch_event_register | ( | int | unit, |
opennsl_switch_event_cb_t | cb, | ||
void * | userdata | ||
) |
Registers/Unregisters a callback function for switch critical events.
unit | [IN] Unit number. |
cb | [IN] A callback function to be called upon critical event |
userdata | [IN] Pointer to any provided user data to be called with a callback |
OPENNSL_E_NONE | - Success |
OPENNSL_E_UNIT | - Invalid unit provided |
OPENNSL_E_PARAM | - Invalid callback function provided. |
OPENNSL_E_MEMORY | - Not enough memory to register callback |
int opennsl_switch_event_unregister | ( | int | unit, |
opennsl_switch_event_cb_t | cb, | ||
void * | userdata | ||
) |
Registers/Unregisters a callback function for switch critical events.
unit | [IN] Unit number. |
cb | [IN] A callback function to be called upon critical event |
userdata | [IN] Pointer to any provided user data to be called with a callback |
OPENNSL_E_NONE | - Success |
OPENNSL_E_UNIT | - Invalid unit provided |
OPENNSL_E_PARAM | - Invalid callback function provided. |
OPENNSL_E_MEMORY | - Not enough memory to register callback |
int opennsl_switch_object_count_multi_get | ( | int | unit, |
int | object_size, | ||
opennsl_switch_object_t * | object_array, | ||
int * | entries | ||
) |
Retrieving the statistics on the number of API objects.
This retrieves for multiple objects.
unit | [IN] Unit number. |
object_size | [IN] Number of objects for which the entries are to be |
object_array | [IN] Object names for which the count is to be |
entries | [OUT] The number of entries in the system for each |
OPENNSL_E_xxx |
int opennsl_switch_pkt_info_hash_get | ( | int | unit, |
opennsl_switch_pkt_info_t * | pkt_info, | ||
opennsl_gport_t * | dst_gport, | ||
opennsl_if_t * | dst_intf | ||
) |
Gets the hash result for the specified link aggregation method using provided packet parameters and device configuration.
unit | [IN] Unit number. |
pkt_info | [IN] Packet parameter information for hash calculation. |
dst_gport | [OUT] Destination module and port. |
dst_intf | [OUT] Destination L3 interface ID egress object. |
OPENNSL_E_xxx |
void opennsl_switch_pkt_info_t_init | ( | opennsl_switch_pkt_info_t * | pkt_info | ) |
Initialize a opennsl_switch_pkt_info_t structure.
pkt_info | [IN,OUT] Packet hashing parameters |
OPENNSL_E_xxx |
int opennsl_switch_pkt_trace_info_get | ( | int | unit, |
uint32 | options, | ||
uint8 | port, | ||
int | len, | ||
uint8 * | data, | ||
opennsl_switch_pkt_trace_info_t * | pkt_trace_info | ||
) |
Generate a visibility trace packet and then read the result of the packets ingress processing information.
unit | [IN] Unit number. |
options | [IN] FLAGS to select pre-configured cpu_pkt_profile register values |
port | [IN] |
len | [IN] Number of bytes to copy from data |
data | [IN] Source packet buffer to copy from |
pkt_trace_info | [IN,OUT] visibility packet process information in opennsl_pkt_trace_info_s format |
OPENNSL_E_xxx |
int opennsl_switch_temperature_monitor_get | ( | int | unit, |
int | temperature_max, | ||
opennsl_switch_temperature_monitor_t * | temperature_array, | ||
int * | temperature_count | ||
) |
There are temperature monitors embedded in the various points of some switch chips for the purpose of monitoring the health of the chip.
This API retrieves each temperature monitor's current value and peak value. The value unit is 0.1 celsius degree. Table =opennsl_switch_temperature_monitor_t describes the meaning of each field of the structure opennsl_switch_temperature_monitor_t.
unit | [IN] Unit number. |
temperature_max | [IN] number of entries of the temperature_array. |
temperature_array | [OUT] the buffer array to hold the retrieved values. |
temperature_count | [OUT] actual number of entries retrieved. |
OPENNSL_E_xxx |