OpenNSL API Guide and Reference Manual
Data Structures | Files | Macros | Typedefs | Enumerations | Functions
Switch Management

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)
 

Typedefs

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
 
typedef enum
opennsl_switch_pkt_hash_info_fwd_reason_e 
opennsl_switch_pkt_hash_info_fwd_reason_t
 Packet forward reason for hash calculation.
 
typedef struct
opennsl_switch_pkt_info_s 
opennsl_switch_pkt_info_t
 Switch packet info structure.
 
typedef struct
opennsl_switch_pkt_trace_hashing_info_s 
opennsl_switch_pkt_trace_hashing_info_t
 packet hashing resolution information
 
typedef struct
opennsl_switch_pkt_trace_info_s 
opennsl_switch_pkt_trace_info_t
 packet trace ingress process data
 
typedef struct
opennsl_switch_pkt_trace_lookup_result_s 
opennsl_switch_pkt_trace_lookup_result_t
 lookup result set bit map
 
typedef enum
opennsl_switch_pkt_trace_lookup_e 
opennsl_switch_pkt_trace_lookup_t
 packet trace lookup result enums
 
typedef
_shr_switch_temperature_monitor_t 
opennsl_switch_temperature_monitor_t
 Entry type for retrieving temperature values.
 

Enumerations

enum  opennsl_switch_control_e {
  opennslSwitchCpuSamplePrio = 16,
  opennslSwitchUnknownL3DestToCpu = 26,
  opennslSwitchSampleIngressRandomSeed = 31,
  opennslSwitchSampleEgressRandomSeed = 32,
  opennslSwitchV6L3DstMissToCpu = 40,
  opennslSwitchV4L3DstMissToCpu = 43,
  opennslSwitchL3SlowpathToCpu = 48,
  opennslSwitchArpReplyToCpu = 84,
  opennslSwitchArpRequestToCpu = 86,
  opennslSwitchNdPktToCpu = 89,
  opennslSwitchIgmpPktToCpu = 92,
  opennslSwitchIgmpToCPU = opennslSwitchIgmpPktToCpu,
  opennslSwitchDhcpPktToCpu = 94,
  opennslSwitchDhcpPktDrop = 95,
  opennslSwitchV4ResvdMcPktToCpu = 98,
  opennslSwitchDirectedMirroring = 125,
  opennslSwitchHashControl = 136,
  opennslSwitchMirrorUnmarked = 141,
  opennslSwitchColorSelect = 143,
  opennslSwitchHashSeed0 = 147,
  opennslSwitchHashSeed1 = 148,
  opennslSwitchHashField0PreProcessEnable = 149,
  opennslSwitchHashField1PreProcessEnable = 150,
  opennslSwitchHashField0Config = 151,
  opennslSwitchHashField0Config1 = 152,
  opennslSwitchHashField1Config = 153,
  opennslSwitchHashField1Config1 = 154,
  opennslSwitchHashSelectControl = 156,
  opennslSwitchHashIP4Field0 = 157,
  opennslSwitchHashIP4Field1 = 158,
  opennslSwitchHashIP4TcpUdpField0 = 159,
  opennslSwitchHashIP4TcpUdpField1 = 160,
  opennslSwitchHashIP4TcpUdpPortsEqualField0 = 161,
  opennslSwitchHashIP4TcpUdpPortsEqualField1 = 162,
  opennslSwitchHashIP6Field0 = 163,
  opennslSwitchHashIP6Field1 = 164,
  opennslSwitchHashIP6TcpUdpField0 = 165,
  opennslSwitchHashIP6TcpUdpField1 = 166,
  opennslSwitchHashIP6TcpUdpPortsEqualField0 = 167,
  opennslSwitchHashIP6TcpUdpPortsEqualField1 = 168,
  opennslSwitchHashL2Field0 = 169,
  opennslSwitchHashL2Field1 = 170,
  opennslSwitchECMPHashSet0Offset = 210,
  opennslSwitchECMPHashSet1Offset = 211,
  opennslSwitchMirrorInvalidVlanDrop = 221,
  opennslSwitchMirrorPktChecksEnable = 222,
  opennslSwitchL3EgressMode = 230,
  opennslSwitchL3IngressMode = 232,
  opennslSwitchWarmBoot = 238,
  opennslSwitchStableSelect = 239,
  opennslSwitchStableSize = 240,
  opennslSwitchStableUsed = 241,
  opennslSwitchStableConsistent = 242,
  opennslSwitchControlSync = 243,
  opennslSwitchControlAutoSync = 244,
  opennslSwitchIpmcTtl1ToCpu = 249,
  opennslSwitchL3UcastTtl1ToCpu = 250,
  opennslSwitchL3UrpfMode = 262,
  opennslSwitchBstEnable = 717,
  opennslSwitchBstTrackingMode = 718,
  opennslSwitchVxlanUdpDestPortSet = 729,
  opennslSwitchVxlanEntropyEnable = 730,
  opennslSwitchVxlanVnIdMissToCpu = 731,
  opennslSwitchVxlanTunnelMissToCpu = 732,
  opennslSwitchFlexibleMirrorDestinations = 781,
  opennslSwitchEcmpMacroFlowHashEnable = 782,
  opennslSwitchMcQueueSchedMode = 871,
  opennslSwitchBstSnapshotEnable = 878,
  opennslSwitchMirrorExclusive = 912
}
 Switch controls. More...
 
enum  opennsl_switch_object_e {
  opennslSwitchObjectL2EntryCurrent = 0,
  opennslSwitchObjectVlanCurrent = 1,
  opennslSwitchObjectL3HostCurrent = 2,
  opennslSwitchObjectL3RouteCurrent = 3,
  opennslSwitchObjectL3EgressCurrent = 4,
  opennslSwitchObjectIpmcCurrent = 5,
  opennslSwitchObjectEcmpCurrent = 6,
  opennslSwitchObjectL3RouteV4RoutesMax = 7,
  opennslSwitchObjectL3RouteV4RoutesFree = 8,
  opennslSwitchObjectL3RouteV4RoutesUsed = 9,
  opennslSwitchObjectL3RouteV6Routes64bMax = 10,
  opennslSwitchObjectL3RouteV6Routes64bFree = 11,
  opennslSwitchObjectL3RouteV6Routes64bUsed = 12,
  opennslSwitchObjectL3RouteV6Routes128bMax = 13,
  opennslSwitchObjectL3RouteV6Routes128bFree = 14,
  opennslSwitchObjectL3RouteV6Routes128bUsed = 15,
  opennslSwitchObjectL3RouteTotalUsedRoutes = 16,
  opennslSwitchObjectIpmcHeadTableFree = 17,
  opennslSwitchObjectL3HostV4Used = 18,
  opennslSwitchObjectL3HostV6Used = 19,
  opennslSwitchObjectEcmpMax = 20,
  opennslSwitchObjectPFCDeadlockCosMax = 21,
  opennslSwitchObjectL3HostV4Max = 22,
  opennslSwitchObjectL3HostV6Max = 23,
  opennslSwitchObjectL3RouteV4RoutesMinGuaranteed = 24,
  opennslSwitchObjectL3RouteV6Routes64bMinGuaranteed = 25,
  opennslSwitchObjectL3RouteV6Routes128bMinGuaranteed = 26,
  opennslSwitchObjectL3EgressMax = 27,
  opennslSwitchObjectIpmcV4Used = 28,
  opennslSwitchObjectIpmcV6Used = 29,
  opennslSwitchObjectIpmcV4Max = 30,
  opennslSwitchObjectIpmcV6Max = 31,
  opennslSwitchObjectL2EntryMax = 32,
  opennslSwitchObjectCount
}
 
enum  opennsl_switch_pkt_hash_info_fwd_reason_e {
  opennslSwitchPktHashInfoFwdReasonUnicast = 0,
  opennslSwitchPktHashInfoFwdReasonIpmc = 1,
  opennslSwitchPktHashInfoFwdReasonL2mc = 2,
  opennslSwitchPktHashInfoFwdReasonBcast = 3,
  opennslSwitchPktHashInfoFwdReasonDlf = 4
}
 Packet forward reason for hash calculation. More...
 
enum  opennsl_switch_pkt_trace_lookup_e { opennslSwitchPktTraceLookupCount = 20 }
 packet trace lookup result enums More...
 

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.
 

Detailed Description

Macro Definition Documentation

#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

Use enhanced ECMP hashing.

Definition at line 469 of file switch.h.

#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

Use enhanced non-unicast trunk hashing.

Definition at line 471 of file switch.h.

#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

16-bit CRC using CCITT polynomial.

Definition at line 477 of file switch.h.

#define OPENNSL_HASH_FIELD_CONFIG_CRC16XOR8   0x00000001

8-bit CRC16 + 8-bit XOR8.

Definition at line 474 of file switch.h.

#define OPENNSL_HASH_FIELD_CONFIG_CRC32HI   0x00000009

Higher 16-bit of CRC32.

Definition at line 480 of file switch.h.

#define OPENNSL_HASH_FIELD_CONFIG_CRC32LO   0x00000008

Lower 16-bit of CRC32.

Definition at line 479 of file switch.h.

#define OPENNSL_HASH_FIELD_CONFIG_XOR16   0x00000006

16-bit XOR.

Definition at line 476 of file switch.h.

#define OPENNSL_HASH_FIELD_DSTL4   0x00000020

Destination L4 port.

Definition at line 482 of file switch.h.

#define OPENNSL_HASH_FIELD_IP4DST_HI   0x00000200

IPv4 destination address upper 16 bits.

Definition at line 487 of file switch.h.

#define OPENNSL_HASH_FIELD_IP4DST_LO   0x00000100

IPv4 destination address lower 16 bits.

Definition at line 485 of file switch.h.

#define OPENNSL_HASH_FIELD_IP4SRC_HI   0x00000800

IPv4 source address upper 16 bits.

Definition at line 491 of file switch.h.

#define OPENNSL_HASH_FIELD_IP4SRC_LO   0x00000400

IPv4 source address lower 16 bits.

Definition at line 489 of file switch.h.

#define OPENNSL_HASH_FIELD_IP6DST_HI   0x00002000

IPv6 collapsed destination address upper 16 bits.

Definition at line 495 of file switch.h.

#define OPENNSL_HASH_FIELD_IP6DST_LO   0x00001000

IPv6 collapsed destination address lower 16 bits.

Definition at line 493 of file switch.h.

#define OPENNSL_HASH_FIELD_IP6SRC_HI   0x00008000

IPv6 collapsed source address upper 16 bits.

Definition at line 499 of file switch.h.

#define OPENNSL_HASH_FIELD_IP6SRC_LO   0x00004000

IPv6 collapsed source address lower 16 bits.

Definition at line 497 of file switch.h.

#define OPENNSL_HASH_FIELD_MACDA_HI   0x00100000

MAC destination address upper 16 bits.

Definition at line 505 of file switch.h.

#define OPENNSL_HASH_FIELD_MACDA_LO   0x00040000

MAC destination address lower 16 bits.

Definition at line 501 of file switch.h.

#define OPENNSL_HASH_FIELD_MACDA_MI   0x00080000

MAC destination address middle 16 bits.

Definition at line 503 of file switch.h.

#define OPENNSL_HASH_FIELD_MACSA_HI   0x00800000

MAC source address upper 16 bits.

Definition at line 511 of file switch.h.

#define OPENNSL_HASH_FIELD_MACSA_LO   0x00200000

MAC source address lower 16 bits.

Definition at line 507 of file switch.h.

#define OPENNSL_HASH_FIELD_MACSA_MI   0x00400000

MAC source address middle 16 bits.

Definition at line 509 of file switch.h.

#define OPENNSL_HASH_FIELD_SRCL4   0x00000040

Source L4 port.

Definition at line 483 of file switch.h.

#define OPENNSL_HASH_FIELD_VLAN   0x00000080

VLAN ID.

Definition at line 484 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_DST_IP   (1 << 6)

Destination IPv4 address field valid.

Definition at line 284 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_DST_IPV6   (1 << 8)

Destination IPv6 address field valid.

Definition at line 288 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_DST_L4_PORT   (1 << 11)

Destination L4 port field valid.

Definition at line 294 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_DST_MAC   (1 << 4)

Destination MAC address field valid.

Definition at line 280 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_ETHERTYPE   (1 << 2)

Ethertype field valid.

Definition at line 277 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_HASH_LBID   (1 << 15)

Retrieve LBID.

Definition at line 302 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_HASH_MULTIPATH   (1 << 13)

Retrieve ECMP hash result.

Definition at line 298 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_HASH_OVERLAY   (1 << 16)

Retrieve ECMP hash result for overlay layer.

Definition at line 303 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_HASH_TRUNK   (1 << 12)

Retrieve trunk hash result.

Definition at line 296 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_HASH_UDP_SOURCE_PORT   (1 << 14)

Retrieve Entropy Value of VXLan packet.

Definition at line 300 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_PROTOCOL   (1 << 9)

IP protocol field valid.

Definition at line 290 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_SRC_GPORT   (1 << 0)

Source gport (module, port) field valid.

Definition at line 273 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_SRC_IP   (1 << 5)

Source IPv4 address field valid.

Definition at line 282 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_SRC_IPV6   (1 << 7)

Source IPv6 address field valid.

Definition at line 286 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_SRC_L4_PORT   (1 << 10)

Source L4 port field valid.

Definition at line 292 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_SRC_MAC   (1 << 3)

Source MAC address field valid.

Definition at line 278 of file switch.h.

#define OPENNSL_SWITCH_PKT_INFO_VLAN   (1 << 1)

VLAN identifier field valid.

Definition at line 275 of file switch.h.

#define OPENNSL_SWITCH_PKT_TRACE_ECMP_1   0x0001

level 1 ecmp hashing resolution done

Definition at line 613 of file switch.h.

#define OPENNSL_SWITCH_PKT_TRACE_ECMP_2   0x0002

level 2 ecmp hashing resolution done

Definition at line 615 of file switch.h.

#define OPENNSL_SWITCH_PKT_TRACE_FABRIC_TRUNK   0x0008

hg trunk hashing resolution done

Definition at line 619 of file switch.h.

#define OPENNSL_SWITCH_PKT_TRACE_RAW_DATA_MAX   112

max bytes of pkt_trace_info.raw_data

Definition at line 639 of file switch.h.

#define OPENNSL_SWITCH_PKT_TRACE_TRUNK   0x0004

trunk hashing resolution done

Definition at line 617 of file switch.h.

#define OPENNSL_SWITCH_STABLE_APPLICATION   (_SHR_SWITCH_STABLE_APPLICATION)

Definition at line 138 of file switch.h.

Typedef Documentation

Switch controls.

typedef void(* opennsl_switch_event_cb_t)(int unit, opennsl_switch_event_t event, uint32 arg1, uint32 arg2, uint32 arg3, void *userdata)

Definition at line 391 of file switch.h.

Packet forward reason for hash calculation.

Switch packet info structure.

Contains packet fields for calculating aggregate link hash values.

packet hashing resolution information

packet trace ingress process data

lookup result set bit map

packet trace lookup result enums

Entry type for retrieving temperature values.

Definition at line 244 of file switch.h.

Enumeration Type Documentation

Switch controls.

Enumerator:
opennslSwitchCpuSamplePrio 

Priority for sFlow sample to CPU.

opennslSwitchUnknownL3DestToCpu 

DIP not found in L3/LPM tables.

opennslSwitchSampleIngressRandomSeed 

SFlow ingress RNG seed.

opennslSwitchSampleEgressRandomSeed 

SFlow egress RNG seed.

opennslSwitchV6L3DstMissToCpu 

IPv6 unknown dest packets to CPU.

opennslSwitchV4L3DstMissToCpu 

IPv6 unknown dest packets to CPU.

opennslSwitchL3SlowpathToCpu 

Slowpath packets to CPU.

opennslSwitchArpReplyToCpu 

ARP replies to CPU.

opennslSwitchArpRequestToCpu 

ARP requests to CPU.

opennslSwitchNdPktToCpu 

ND packets to CPU.

opennslSwitchIgmpPktToCpu 

IGMP packets to CPU.

opennslSwitchIgmpToCPU 

Legacy support for IGMP packets to CPU.

opennslSwitchDhcpPktToCpu 

DHCP packets to CPU.

opennslSwitchDhcpPktDrop 

DHCP packets dropped.

opennslSwitchV4ResvdMcPktToCpu 

IPv4 reserved MC packets to CPU.

opennslSwitchDirectedMirroring 

Enable directed mirroring mode.

opennslSwitchHashControl 

Hash Control of fields.

opennslSwitchMirrorUnmarked 

Send mirror packets as simple unicast.

opennslSwitchColorSelect 

Choose color selection source.

opennslSwitchHashSeed0 

network switch hash seeds.

opennslSwitchHashSeed1 

For enhanced hashing algoithm.

opennslSwitchHashField0PreProcessEnable 

Enable pre-processing for enhanced hash mode 0.

opennslSwitchHashField1PreProcessEnable 

Enable pre-processing for enhanced hash mode 1.

opennslSwitchHashField0Config 

network switch enhanced hash mode 0 config.

opennslSwitchHashField0Config1 

network switch enhanced hash mode 0 config 1.

opennslSwitchHashField1Config 

network switch enhanced hash mode 1 config.

opennslSwitchHashField1Config1 

network switch enhanced hash mode 1 config 1.

opennslSwitchHashSelectControl 

network switch field selection control.

opennslSwitchHashIP4Field0 

network switch enhanced hash field.

opennslSwitchHashIP4Field1 

Selections for IPv4 packets.

opennslSwitchHashIP4TcpUdpField0 

network switch enhanced hash field.

opennslSwitchHashIP4TcpUdpField1 

Selections for IPv4 TCP/UDP packets.

opennslSwitchHashIP4TcpUdpPortsEqualField0 

network switch enhanced hash field.

opennslSwitchHashIP4TcpUdpPortsEqualField1 

Selections for IPv4 TCP/UDP packets with source L4 port equals to destination L4 port.

opennslSwitchHashIP6Field0 

network switch enhanced hash field.

opennslSwitchHashIP6Field1 

Selections for IPv6 packets.

opennslSwitchHashIP6TcpUdpField0 

network switch enhanced hash field.

opennslSwitchHashIP6TcpUdpField1 

Selections for IPv6 TCP/UDP packets.

opennslSwitchHashIP6TcpUdpPortsEqualField0 

network switch enhanced hash field.

opennslSwitchHashIP6TcpUdpPortsEqualField1 

Selections for IPv6 TCP/UDP packets with source L4 port equals to destination L4 port.

opennslSwitchHashL2Field0 

network switch enhanced hash field.

opennslSwitchHashL2Field1 

Selections for L2 packets.

opennslSwitchECMPHashSet0Offset 

network switch enhanced hash bits.

opennslSwitchECMPHashSet1Offset 

Selections for ECMP.

opennslSwitchMirrorInvalidVlanDrop 

Mirror-to-port packets are dropped upon invalid VLAN.

opennslSwitchMirrorPktChecksEnable 

Enable/Disable all packet checks for mirror packets.

opennslSwitchL3EgressMode 

Enable advanced egress management.

opennslSwitchL3IngressMode 

Enable advanced Ingress-interface management.

opennslSwitchWarmBoot 

Set Warm boot state.

opennslSwitchStableSelect 

Select the storage (or stable) location for Level 2 Warm Boot.

opennslSwitchStableSize 

Select the storage (or stable) size (bytes) for Level 2 Warm Boot.

opennslSwitchStableUsed 

Query the storage (or stable) usage (bytes) for Level 2 Warm Boot.

opennslSwitchStableConsistent 

Query the storage (or stable) for whether state is believed consistent with hardware (API completed prior to warmboot).

opennslSwitchControlSync 

Force a sync of the Level 2 warm boot state on demand.

opennslSwitchControlAutoSync 

Perform a sync of the Level 2 warm boot state after every API.

opennslSwitchIpmcTtl1ToCpu 

Copy L3 Mcast with TTL 1 to CPU.

opennslSwitchL3UcastTtl1ToCpu 

Copy L3 Ucast with TTL 1 to CPU.

opennslSwitchL3UrpfMode 

Port rpf mode for unicast packets.

opennslSwitchBstEnable 

Enable BST tracking.

opennslSwitchBstTrackingMode 

BST resource usage tracking mode.

opennslSwitchVxlanUdpDestPortSet 

Set UDP Destination port for VXLAN.

opennslSwitchVxlanEntropyEnable 

Set UDP Source port for VXLAN Tunnel Entropy(Value = TRUE/FALSE)

opennslSwitchVxlanVnIdMissToCpu 

Set VXLAN VN_ID lookup failure Copy to Cpu.

opennslSwitchVxlanTunnelMissToCpu 

If set, send a copy of VXLAN packet to CPU if VXLAN Tunnel lookup fails.

opennslSwitchFlexibleMirrorDestinations 

Enable configuration of the maximum number of mirror destinations.

opennslSwitchEcmpMacroFlowHashEnable 

Enable ECMP macro-flow hashing.

opennslSwitchMcQueueSchedMode 

Schedule mode select for multicast queues.

opennslSwitchBstSnapshotEnable 

BST resource usage SnapShot mode.

opennslSwitchMirrorExclusive 

Set Mirror exclusive behaviour between FP and Port.

Definition at line 35 of file switch.h.

Enumerator:
opennslSwitchObjectL2EntryCurrent 

Statistics of current L2 Entry.

opennslSwitchObjectVlanCurrent 

Statistics of current Vlan Entry.

opennslSwitchObjectL3HostCurrent 

Statistics of current L3 Hosts.

opennslSwitchObjectL3RouteCurrent 

Statistics of current L3 Routes.

opennslSwitchObjectL3EgressCurrent 

Statistics of current L3 Egress objects.

opennslSwitchObjectIpmcCurrent 

Statistics of current IP Multicast Objects.

opennslSwitchObjectEcmpCurrent 

Statistics of current ECMP objects.

opennslSwitchObjectL3RouteV4RoutesMax 

Maximum number of v4 routes possible.

opennslSwitchObjectL3RouteV4RoutesFree 

Maximum number of v4 routes that can be added in current state.

opennslSwitchObjectL3RouteV4RoutesUsed 

Used count of v4 routes.

opennslSwitchObjectL3RouteV6Routes64bMax 

Maximum number of 64bv6 routes possible.

opennslSwitchObjectL3RouteV6Routes64bFree 

Maximum number of 64bV6 routes that can be added in current state.

opennslSwitchObjectL3RouteV6Routes64bUsed 

Used count of 64bv6 routes.

opennslSwitchObjectL3RouteV6Routes128bMax 

Maximum number of 128bV6 routes possible.

opennslSwitchObjectL3RouteV6Routes128bFree 

Maximum number of 128bV6 routes that can be added in current state.

opennslSwitchObjectL3RouteV6Routes128bUsed 

Used count of 128bv6 routes.

opennslSwitchObjectL3RouteTotalUsedRoutes 

Sum of 44 + 64bv6 + 128bv6 routes.

opennslSwitchObjectIpmcHeadTableFree 

Number of free entries in the replication head table.

opennslSwitchObjectL3HostV4Used 

Statistics of L3 Hosts used by IPv4.

opennslSwitchObjectL3HostV6Used 

Statistics of L3 Hosts used by IPv6.

opennslSwitchObjectEcmpMax 

Maximum number of Ecmp groups possible.

opennslSwitchObjectPFCDeadlockCosMax 

Get the Max COS supported for PFC Deadlock detection and recovery.

opennslSwitchObjectL3HostV4Max 

Maximum number of IPv4 routes possible in L3 host table.

opennslSwitchObjectL3HostV6Max 

Maximum number of IPv6 routes possible in L3 host table.

opennslSwitchObjectL3RouteV4RoutesMinGuaranteed 

Guaranteed number of IPv4 routes in ALPM mode.

opennslSwitchObjectL3RouteV6Routes64bMinGuaranteed 

Guaranteed number of IPv6 64bits routes in ALPM mode.

opennslSwitchObjectL3RouteV6Routes128bMinGuaranteed 

Guaranteed number of IPv6 128bits routes in ALPM mode.

opennslSwitchObjectL3EgressMax 

Maximum number of L3 Egress objects possible.

opennslSwitchObjectIpmcV4Used 

Statistics of used IPv4 Multicast entries.

opennslSwitchObjectIpmcV6Used 

Statistics of used IPv6 Multicast entries.

opennslSwitchObjectIpmcV4Max 

Maximum number of IPv4 Multicast entries possible.

opennslSwitchObjectIpmcV6Max 

Maximum number of IPv6 Multicast entries possible.

opennslSwitchObjectL2EntryMax 

Maximum number of L2 entries possible.

opennslSwitchObjectCount 

Maximum object count.

This is not an object and should always be in the last

Definition at line 515 of file switch.h.

Packet forward reason for hash calculation.

Enumerator:
opennslSwitchPktHashInfoFwdReasonUnicast 

Known unicast packet.

opennslSwitchPktHashInfoFwdReasonIpmc 

L3 multicast packet.

opennslSwitchPktHashInfoFwdReasonL2mc 

L2 multicast packet.

opennslSwitchPktHashInfoFwdReasonBcast 

Broadcast packet.

opennslSwitchPktHashInfoFwdReasonDlf 

Destination lookup failed packet.

Definition at line 307 of file switch.h.

packet trace lookup result enums

Enumerator:
opennslSwitchPktTraceLookupCount 

Definition at line 601 of file switch.h.

Function Documentation

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.

Description
These APIs set parameters related to general device operation such as controlling whether certain types of packets should be sent to the local CPU, or setting the priority to be used when such packets are forwarded to the CPU. The port specific operations affect only the indicated port (where possible) while the general APIs affect all ports. Not all operations can be carried out on individual ports on all devices.
Parameters
unit[IN] Unit number.
type[IN] Switch control parameter (see =opennsl_switches)
arg[OUT] (for _set) Argument whose meaning is dependent on type
Return values
OPENNSL_E_UNAVAILFeature not available on this device
OPENNSL_E_XXXOther 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.

Description
These APIs set parameters related to general device operation such as controlling whether certain types of packets should be sent to the local CPU, or setting the priority to be used when such packets are forwarded to the CPU. The port specific operations affect only the indicated port (where possible) while the general APIs affect all ports. Not all operations can be carried out on individual ports on all devices.
Parameters
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
Return values
OPENNSL_E_UNAVAILFeature not available on this device
OPENNSL_E_XXXOther 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.

Description
These APIs set parameters related to general device operation such as controlling whether certain types of packets should be sent to the local CPU, or setting the priority to be used when such packets are forwarded to the CPU. The port specific operations affect only the indicated port (where possible) while the general APIs affect all ports. Not all operations can be carried out on individual ports on all devices.
Parameters
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
Return values
OPENNSL_E_UNAVAILFeature not available on this device
OPENNSL_E_XXXOther 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.

Description
These APIs set parameters related to general device operation such as controlling whether certain types of packets should be sent to the local CPU, or setting the priority to be used when such packets are forwarded to the CPU. The port specific operations affect only the indicated port (where possible) while the general APIs affect all ports. Not all operations can be carried out on individual ports on all devices.
Parameters
unit[IN] Unit number.
type[IN] Switch control parameter (see =opennsl_switches)
arg[IN] (for _set) Argument whose meaning is dependent on type
Return values
OPENNSL_E_UNAVAILFeature not available on this device
OPENNSL_E_XXXOther 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.

Description
These APIs allow to the application to register a callback function which will be called when critical event occurs on the switch. Applications which register for switch events will be notified about critical errors described in table below. The application call back function should log all the information provided in arg1, arg2 and arg3 in such a way that the system operator is made aware of the issue. The system operator may need to take additional actions, up to and include rebooting the switch. Call back function is defined as following .
Parameters
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
Return values
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.

Description
These APIs allow to the application to register a callback function which will be called when critical event occurs on the switch. Applications which register for switch events will be notified about critical errors described in table below. The application call back function should log all the information provided in arg1, arg2 and arg3 in such a way that the system operator is made aware of the issue. The system operator may need to take additional actions, up to and include rebooting the switch. Call back function is defined as following .
Parameters
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
Return values
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.

Description
This function is similar to opennsl_switch_object_count_get except for retrieving the count for multiple objects.
Parameters
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
Return values
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.

Description
This API will use provided packet information elements in conjunction with the current device configuration to determine either the destination system port for a LAG-directed packet or the egress object for a packet undergoing ECMP routing. Note that only unicast L2 or L3 single-tagged packets without tunnel encapsulation are supported. Always initialize a switch packet information structure using the.
Parameters
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.
Return values
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.

Description
Initializes a packet hashing parameters structure to default values. This function should be used to initialize any such structure prior to filling it out and passing it to an API function. This ensures that subsequent API releases may add new structure members to the opennsl_switch_pkt_info_t structure, and opennsl_switch_pkt_info_t_init will initialize the new members to correct default values.
Parameters
pkt_info[IN,OUT] Packet hashing parameters
Return values
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.

Description
Generate a visibility packet. Read visibility packet process data for chip and store the raw data into opennsl_pkt_trace_info_t* Last, convert the raw data into abstracted format and store into opennsl_pkt_trace_info_t* These profile options are used to set loopback headers cpu_pkt_profile field For Trident3 1. To read the raw data, API opennsl_switch_pkt_trace_raw_data_get should be used instead of raw data in opennsl_pkt_trace_info_t*. 2. network switch - Packet trace works when single debug visibility packet is being swicthed in the system.
Parameters
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
Return values
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.

Parameters
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.
Return values
OPENNSL_E_xxx