AM273x MCU+ SDK  09.02.00

Introduction

The CPSW ALE module provides low level access to switch configuration.

The following features are supported:

Data Structures

struct  CpswAle_MacAddrInfo
 MAC address and VLAN Id. More...
 
struct  CpswAle_UcastEntryInfo
 Unicast entry type info apart from MAC address that can be set. More...
 
struct  CpswAle_SetUcastEntryInArgs
 Input args for CPSW_ALE_IOCTL_ADD_UCAST command. More...
 
struct  CpswAle_GetUcastEntryOutArgs
 Output args for CPSW_ALE_IOCTL_LOOKUP_UCAST command. More...
 
struct  CpswAle_McastEntryInfo
 Multicast entry type info apart from MAC address. More...
 
struct  CpswAle_SetMcastEntryInArgs
 Input args for CPSW_ALE_IOCTL_ADD_MCAST command. More...
 
struct  CpswAle_GetMcastEntryInArgs
 Input args for CPSW_ALE_IOCTL_LOOKUP_MCAST command. More...
 
struct  CpswAle_GetMcastEntryOutArgs
 Output args for CPSW_ALE_IOCTL_LOOKUP_MCAST command. More...
 
struct  CpswAle_VlanIdInfo
 VLAN id info. More...
 
struct  CpswAle_VlanEntryInfo
 VLAN entry type info. More...
 
struct  CpswAle_GetVlanEntryOutArgs
 Output args for CPSW_ALE_IOCTL_LOOKUP_MCAST command. More...
 
struct  CpswAle_OuiEntryInfo
 OUI entry info. More...
 
struct  CpswAle_IPv4EntryInfo
 IPv4 entry info. More...
 
struct  CpswAle_IPv6EntryInfo
 IPv6 entry info. More...
 
struct  CpswAle_SetPortStateInArgs
 Input args for CPSW_ALE_IOCTL_SET_PORT_STATE command. More...
 
struct  CpswAle_GetPortMacAddrInArgs
 Input args for CPSW_ALE_IOCTL_GET_PORT_MACADDR command. More...
 
struct  CpswAle_GetPortMacAddrOutArgs
 Output args for CPSW_ALE_IOCTL_GET_PORT_MACADDR command. More...
 
struct  CpswAle_DfltThreadCfg
 Input args for CPSW_ALE_IOCTL_SET_DEFAULT_THREADCFG command and out args for CPSW_ALE_IOCTL_GET_DEFAULT_THREADCFG command. More...
 
struct  CpswAle_MacAddrClassifierInfo
 ALE classifier/policer match parameters for source or destination MAC address. More...
 
struct  CpswAle_MirrorMatchParams
 ALE port mirroring configuration for mirroring based on packet match. More...
 
struct  CpswAle_PortMirroringCfg
 Input args for CPSW_ALE_IOCTL_SET_PORT_MIRROR_CFG command. More...
 
struct  CpswAle_TrunkCfg
 Input args for CPSW_ALE_IOCTL_SET_TRUNK_CFG command. More...
 
struct  CpswAle_PortBcastMcastRateLimitParams
 Broadcast/multicast bandwidth limit configuration parameters. More...
 
struct  CpswAle_SetBcastMcastRateLimitInArgs
 Input args for CPSW_ALE_IOCTL_SET_BCAST_MCAST_LIMIT command. More...
 
struct  CpswAle_GetBcastMcastRateLimitOutArgs
 Output args for CPSW_ALE_IOCTL_GET_BCAST_MCAST_LIMIT IOCTL command. More...
 
struct  CpswAle_IpAddrClassifierInfo
 ALE IP address classifier info. More...
 
struct  CpswAle_PolicerMatchParams
 ALE classifier/policer match parameters. More...
 
struct  CpswAle_SetPolicerEntryInArgs
 Input args for CPSW_ALE_IOCTL_SET_POLICER command. More...
 
struct  CpswAle_SetPolicerEntryOutArgs
 Input args for CPSW_ALE_IOCTL_SET_POLICER command. More...
 
struct  CpswAle_PolicerEntryOutArgs
 Output args for CPSW_ALE_IOCTL_GET_POLICER, CPSW_ALE_IOCTL_SET_POLICER_THREADCFG, CPSW_ALE_IOCTL_BLOCK_CLASSIFIER_HOSTPORT and CPSW_ALE_IOCTL_SET_INTERVLAN_CFG commands. More...
 
struct  CpswAle_DelPolicerEntryInArgs
 Input args for CPSW_ALE_IOCTL_DEL_POLICER IOCTL command. More...
 
struct  CpswAle_GetPolicerStatsInArgs
 Input args for CPSW_ALE_IOCTL_GET_POLICER_STATS command. More...
 
struct  CpswAle_GetPolicerStatsOutArgs
 Output args for CPSW_ALE_IOCTL_GET_POLICER_STATS command. More...
 
struct  CpswAle_SetPolicerThreadCfgInArgs
 Input args for CPSW_ALE_IOCTL_SET_POLICER_THREADCFG command. More...
 
struct  CpswAle_UnregulatedTrafficPolicer
 Unregulated traffic (no classifier hit) policing params. More...
 
struct  CpswAle_PolicerGlobalCfg
 Policer global configuration parameters. More...
 
struct  CpswAle_SetInterVlanCfgInArgs
 Output args for CPSW_ALE_IOCTL_SET_DEFAULT_THREADCFG command. More...
 
struct  CpswAle_AgingCfg
 ALE aging time configuration. More...
 
struct  CpswAle_InitVlanCfg
 Init time VLAN configuration. More...
 
struct  CpswAle_MalformedPktSecurityCfg
 Malformed packet handling configuration. More...
 
struct  CpswAle_IPPktSecurityCfg
 IP packet security configuration. More...
 
struct  CpswAle_MacAuthCfg
 MAC authentication configuration. More...
 
struct  CpswAle_NetworkSecurityCfg
 High level structure with ALE network security configuration. More...
 
struct  CpswAle_PortLearningSecurityCfg
 Port specific auto learning security configuration. More...
 
struct  CpswAle_PortVlanSecurityCfg
 Port specific VLAN security configuration. More...
 
struct  CpswAle_PortMacModeCfg
 Port MAC mode configuration. More...
 
struct  CpswAle_PortCfg
 ALE init time port specific configuration params. More...
 
struct  CpswAle_Cfg
 ALE configuration. More...
 

Functions

void CpswAle_initCfg (CpswAle_Cfg *aleCfg)
 Initialize CPSW ALE configuration parameters. More...
 

Typedefs

typedef CpswAle_VlanEntryInfo CpswAle_PortVlanCfg
 Port default VLAN configuration. More...
 

Enumerations

enum  CpswAle_Ioctl {
  CPSW_ALE_IOCTL_DUMP_TABLE = CPSW_ALE_PUBLIC_IOCTL(0U), CPSW_ALE_IOCTL_ADD_UCAST = CPSW_ALE_PUBLIC_IOCTL(1U), CPSW_ALE_IOCTL_ADD_MCAST = CPSW_ALE_PUBLIC_IOCTL(2U), CPSW_ALE_IOCTL_ADD_VLAN = CPSW_ALE_PUBLIC_IOCTL(3U),
  CPSW_ALE_IOCTL_ADD_OUI = CPSW_ALE_PUBLIC_IOCTL(4U), CPSW_ALE_IOCTL_ADD_IPV4ADDR = CPSW_ALE_PUBLIC_IOCTL(5U), CPSW_ALE_IOCTL_ADD_IPV6ADDR = CPSW_ALE_PUBLIC_IOCTL(6U), CPSW_ALE_IOCTL_ADD_ETHERTYPE = CPSW_ALE_PUBLIC_IOCTL(7U),
  CPSW_ALE_IOCTL_LOOKUP_UCAST = CPSW_ALE_PUBLIC_IOCTL(8U), CPSW_ALE_IOCTL_LOOKUP_MCAST = CPSW_ALE_PUBLIC_IOCTL(9U), CPSW_ALE_IOCTL_LOOKUP_VLAN = CPSW_ALE_PUBLIC_IOCTL(10U), CPSW_ALE_IOCTL_REMOVE_ADDR = CPSW_ALE_PUBLIC_IOCTL(11U),
  CPSW_ALE_IOCTL_REMOVE_VLAN = CPSW_ALE_PUBLIC_IOCTL(12U), CPSW_ALE_IOCTL_REMOVE_OUI = CPSW_ALE_PUBLIC_IOCTL(13U), CPSW_ALE_IOCTL_REMOVE_IPV4ADDR = CPSW_ALE_PUBLIC_IOCTL(14U), CPSW_ALE_IOCTL_REMOVE_IPV6ADDR = CPSW_ALE_PUBLIC_IOCTL(15U),
  CPSW_ALE_IOCTL_REMOVE_ETHERTYPE = CPSW_ALE_PUBLIC_IOCTL(16U), CPSW_ALE_IOCTL_REMOVE_LEARNED_ENTRIES = CPSW_ALE_PUBLIC_IOCTL(17U), CPSW_ALE_IOCTL_REMOVE_ALL_ENTRIES = CPSW_ALE_PUBLIC_IOCTL(18U), CPSW_ALE_IOCTL_AGE_ALL_ENTRIES = CPSW_ALE_PUBLIC_IOCTL(19U),
  CPSW_ALE_IOCTL_SET_RX_FILTER = CPSW_ALE_PUBLIC_IOCTL(20U), CPSW_ALE_IOCTL_GET_RX_FILTER = CPSW_ALE_PUBLIC_IOCTL(21U), CPSW_ALE_IOCTL_SET_PORT_STATE = CPSW_ALE_PUBLIC_IOCTL(22U), CPSW_ALE_IOCTL_GET_PORT_STATE = CPSW_ALE_PUBLIC_IOCTL(23U),
  CPSW_ALE_IOCTL_GET_PORT_MACADDR = CPSW_ALE_PUBLIC_IOCTL(24U), CPSW_ALE_IOCTL_SET_DEFAULT_THREADCFG = CPSW_ALE_PUBLIC_IOCTL(25U), CPSW_ALE_IOCTL_GET_DEFAULT_THREADCFG = CPSW_ALE_PUBLIC_IOCTL(26U), CPSW_ALE_IOCTL_SET_PORT_MIRROR_CFG = CPSW_ALE_PUBLIC_IOCTL(27U),
  CPSW_ALE_IOCTL_DISABLE_PORT_MIRROR = CPSW_ALE_PUBLIC_IOCTL(28U), CPSW_ALE_IOCTL_SET_TRUNK_CFG = CPSW_ALE_PUBLIC_IOCTL(29U), CPSW_ALE_IOCTL_SET_OAMLPBK_CFG = CPSW_ALE_PUBLIC_IOCTL(30U), CPSW_ALE_IOCTL_SET_BCAST_MCAST_LIMIT = CPSW_ALE_PUBLIC_IOCTL(31U),
  CPSW_ALE_IOCTL_GET_BCAST_MCAST_LIMIT = CPSW_ALE_PUBLIC_IOCTL(32U), CPSW_ALE_IOCTL_DISABLE_BCAST_MCAST_LIMIT = CPSW_ALE_PUBLIC_IOCTL(33U), CPSW_ALE_IOCTL_SET_POLICER = CPSW_ALE_PUBLIC_IOCTL(34U), CPSW_ALE_IOCTL_GET_POLICER = CPSW_ALE_PUBLIC_IOCTL(35U),
  CPSW_ALE_IOCTL_DEL_POLICER = CPSW_ALE_PUBLIC_IOCTL(36U), CPSW_ALE_IOCTL_DUMP_POLICER_ENTRIES = CPSW_ALE_PUBLIC_IOCTL(37U), CPSW_ALE_IOCTL_GET_POLICER_STATS = CPSW_ALE_PUBLIC_IOCTL(38U), CPSW_ALE_IOCTL_SET_POLICER_THREADCFG = CPSW_ALE_PUBLIC_IOCTL(39U),
  CPSW_ALE_IOCTL_SET_POLICER_GLOBAL_CFG = CPSW_ALE_PUBLIC_IOCTL(40U), CPSW_ALE_IOCTL_GET_POLICER_GLOBAL_CFG = CPSW_ALE_PUBLIC_IOCTL(41U), CPSW_ALE_IOCTL_DEL_ALL_POLICER_THREADID = CPSW_ALE_PUBLIC_IOCTL(42U), CPSW_ALE_IOCTL_BLOCK_CLASSIFIER_HOSTPORT = CPSW_ALE_PUBLIC_IOCTL(43U),
  CPSW_ALE_IOCTL_SET_INTERVLAN_CFG = CPSW_ALE_PUBLIC_IOCTL(44U), CPSW_ALE_IOCTL_GET_INTERVLAN_CFG = CPSW_ALE_PUBLIC_IOCTL(45U)
}
 ALE IOCTL commands. More...
 
enum  CpswAle_PortState { CPSW_ALE_PORTSTATE_DISABLED = 0U, CPSW_ALE_PORTSTATE_BLOCKED, CPSW_ALE_PORTSTATE_LEARN, CPSW_ALE_PORTSTATE_FORWARD }
 ALE port state. More...
 
enum  CpswAle_FwdStateLevel { CPSW_ALE_FWDSTLVL_FWD = 0U, CPSW_ALE_FWDSTLVL_BLK_FWD_LRN, CPSW_ALE_FWDSTLVL_FWD_LRN }
 Forward state level. More...
 
enum  CpswAle_RxFilter {
  CPSW_ALE_RXFILTER_NOTHING = 0U, CPSW_ALE_RXFILTER_DIRECT, CPSW_ALE_RXFILTER_BCAST, CPSW_ALE_RXFILTER_MCAST,
  CPSW_ALE_RXFILTER_ALLMCAST, CPSW_ALE_RXFILTER_ALL
}
 Packet filtering type (cumulative). More...
 
enum  CpswAle_TableEntryType {
  CPSW_ALE_TABLE_ENTRY_TYPE_ADDR, CPSW_ALE_TABLE_ENTRY_TYPE_VLAN, CPSW_ALE_TABLE_ENTRY_TYPE_ETHERTYPE, CPSW_ALE_TABLE_ENTRY_TYPE_OUI,
  CPSW_ALE_TABLE_ENTRY_TYPE_IPV4, CPSW_ALE_TABLE_ENTRY_TYPE_IPV6
}
 Defines ALE table entry type. More...
 
enum  CpswAle_IpAddrClassifierType { CPSW_ALE_IPADDR_CLASSIFIER_IPV4 = 0x00U, CPSW_ALE_IPADDR_CLASSIFIER_IPV6 = 0x01U }
 IP address classifier type. More...
 
enum  CpswAle_PolicerYellowThresh {
  CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_100, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_50, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_33, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_25,
  CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_20, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_17, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_14, CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_13
}
 Yellow threshold value. More...
 
enum  CpswAle_PolicerNoMatchMode { CPSW_ALE_POLICER_NOMATCH_MODE_GREEN, CPSW_ALE_POLICER_NOMATCH_MODE_YELLOW, CPSW_ALE_POLICER_NOMATCH_MODE_RED, CPSW_ALE_POLICER_NOMATCH_MODE_UNREGULATED_TRAFFIC_POLICER }
 Policing Match Mode. More...
 

Macros

#define CPSW_ALE_PUBLIC_IOCTL(x)
 Helper macro to create IOCTL commands for ALE module. More...
 
#define CPSW_ALE_PRIVATE_IOCTL(x)
 Helper macro to create IOCTL commands for ALE module. More...
 
#define CPSW_ALE_NUM_MAC_PORTS   (CPSW_ALE_NUM_PORTS - 1U)
 Number of external ports in the subsystem. More...
 
#define CPSW_ALE_MAX_WHITELIST_IP_NXT_HDR   (4U)
 Maximum IP next header whitelist. More...
 
#define CPSW_ALE_ALL_PORTS_MASK   ((uint32_t)((1U << CPSW_ALE_NUM_PORTS) - 1U))
 Mask value for the all the ports. More...
 
#define CPSW_ALE_ALL_MACPORTS_MASK   ((uint32_t)(((1U << CPSW_ALE_NUM_PORTS) - 1U) - 1U))
 Mask value for the all MAC ports. More...
 
#define CPSW_ALE_HOST_PORT_MASK   (ENET_BIT(0))
 Mask value for the host port. More...
 
#define CPSW_ALE_HOST_PORT_NUM   (0U)
 Port number for the host port. More...
 
#define CPSW_ALE_MACPORT_BASE   (1U)
 Base index for MAC ports in ALE context. More...
 
#define CPSW_ALE_MACPORT_TO_ALEPORT(macPortNum)   (ENET_MACPORT_NORM(macPortNum) + CPSW_ALE_MACPORT_BASE)
 Macro to convert MAC port (Enet_MacPort) to ALE port number. More...
 
#define CPSW_ALE_ALEPORT_TO_MACPORT(alePortNum)   (ENET_MACPORT_DENORM(alePortNum - CPSW_ALE_MACPORT_BASE))
 Macro to convert ALE port number to MAC port number(Enet_MacPort) More...
 
#define CPSW_ALE_MACPORT_TO_PORTMASK(macPort)   (ENET_BIT(CPSW_ALE_MACPORT_TO_ALEPORT(macPort)))
 Macro to convert MAC port (Enet_MacPort) to ALE port mask. More...
 
#define CPSW_ALE_MCAST_IGN_BITS_MAX   (10U)
 Maximum number of ignore bits in multicast address. More...
 
#define CPSW_ALE_PEAKBITRATE_DISABLE   (0U)
 Disable peak bit rate. More...
 
#define CPSW_ALE_COMMITBITRATE_DISABLE   (0U)
 Disable commit bit rate. More...
 
#define CPSW_ALE_THREADID_INVALID   (~0U)
 ALE invalid thread id. More...
 

ALE configuration definitions.

ALE mode of operation configuration options. Each configuration option is represented by a bit in a configuration bitmask.

#define CPSW_ALE_CFG_MODULE_EN   (ENET_BIT(0U))
 Enable ALE. More...
 
#define CPSW_ALE_CFG_BYPASS_EN   (ENET_BIT(1U))
 Enable ALE bypass. More...
 
#define CPSW_ALE_CFG_UNKNOWN_UCAST_FLOOD2HOST   (ENET_BIT(2U))
 Enable Unknown unicast packet flooding to host port. More...
 

ALE classifier match types.

Classifier match type supported by ALE. Each type is represented by a bit in a bitmask. To enable multiple classifiers in a single classifier entry, create bitmask ORing required classifier match type defines.

#define CPSW_ALE_POLICER_MATCH_PORT   (ENET_BIT(0U))
 Enable classifier match with port number. More...
 
#define CPSW_ALE_POLICER_MATCH_PRIORITY   (ENET_BIT(1U))
 Enable classifier match with received packet priority. More...
 
#define CPSW_ALE_POLICER_MATCH_OUI   (ENET_BIT(2U))
 Enable classifier match with OUI portion of source MAC address. More...
 
#define CPSW_ALE_POLICER_MATCH_MACDST   (ENET_BIT(3U))
 Enable classifier match with MAC destination address entry with/without VLAN. More...
 
#define CPSW_ALE_POLICER_MATCH_MACSRC   (ENET_BIT(4U))
 Enable classifier match with MAC source address entry with/without VLAN. More...
 
#define CPSW_ALE_POLICER_MATCH_OVLAN   (ENET_BIT(5U))
 Enable classifier match with outer VLAN entry. More...
 
#define CPSW_ALE_POLICER_MATCH_IVLAN   (ENET_BIT(6U))
 Enable classifier match with inner VLAN entry. More...
 
#define CPSW_ALE_POLICER_MATCH_ETHERTYPE   (ENET_BIT(7U))
 Enable classifier match with EtherType. More...
 
#define CPSW_ALE_POLICER_MATCH_IPSRC   (ENET_BIT(8U))
 Enable classifier match with IPv4/IPv6 source address. More...
 
#define CPSW_ALE_POLICER_MATCH_IPDST   (ENET_BIT(9U))
 Enable classifier match with IPv4/IPv6 destination address. More...
 

ALE classifier delete bitmask.

Associated with some classifier types are ALE table entries. When deleting the classifier entry application needs to specify by means of below bitmask if the ALE entry associated with the classifier should also be deleted. If not set the ALE entry will remain.

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_OUI   (CPSW_ALE_POLICER_MATCH_PRIORITY)
 Delete OUI ALE table entry. More...
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACSRC   (CPSW_ALE_POLICER_MATCH_MACSRC)
 Delete MAC source address ALE table entry. More...
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACDST   (CPSW_ALE_POLICER_MATCH_MACDST)
 Delete MAC destination address ALE table entry. More...
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_IVLAN   (CPSW_ALE_POLICER_MATCH_IVLAN)
 Delete InnerVLAN classifier associated ALE table entry. More...
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_OVLAN   (CPSW_ALE_POLICER_MATCH_OVLAN)
 Delete OuterVLAN classifier associated ALE table entry. More...
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_ETHERTYPE   (CPSW_ALE_POLICER_MATCH_ETHERTYPE)
 Delete EtherType classifier associated ALE table entry. More...
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPSRC   (CPSW_ALE_POLICER_MATCH_IPSRC)
 Delete IPv4/IPv6 source address classifier associated ALE table entry. More...
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPDST   (CPSW_ALE_POLICER_MATCH_IPDST)
 Delete IPv4/IPv6 destination address classifier associated ALE table entry. More...
 
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_ALL
 Delete all ale entries associated with classifier entries. More...
 

Macro Definition Documentation

◆ CPSW_ALE_PUBLIC_IOCTL

#define CPSW_ALE_PUBLIC_IOCTL (   x)
Value:
ENET_IOCTL_FDB_BASE | \
ENET_IOCTL_PER_CPSW | \
ENET_IOCTL_MIN(x))

Helper macro to create IOCTL commands for ALE module.

◆ CPSW_ALE_PRIVATE_IOCTL

#define CPSW_ALE_PRIVATE_IOCTL (   x)
Value:
ENET_IOCTL_FDB_BASE | \
ENET_IOCTL_PER_CPSW | \
ENET_IOCTL_MIN(x))

Helper macro to create IOCTL commands for ALE module.

◆ CPSW_ALE_NUM_MAC_PORTS

#define CPSW_ALE_NUM_MAC_PORTS   (CPSW_ALE_NUM_PORTS - 1U)

Number of external ports in the subsystem.

◆ CPSW_ALE_MAX_WHITELIST_IP_NXT_HDR

#define CPSW_ALE_MAX_WHITELIST_IP_NXT_HDR   (4U)

Maximum IP next header whitelist.

◆ CPSW_ALE_ALL_PORTS_MASK

#define CPSW_ALE_ALL_PORTS_MASK   ((uint32_t)((1U << CPSW_ALE_NUM_PORTS) - 1U))

Mask value for the all the ports.

◆ CPSW_ALE_ALL_MACPORTS_MASK

#define CPSW_ALE_ALL_MACPORTS_MASK   ((uint32_t)(((1U << CPSW_ALE_NUM_PORTS) - 1U) - 1U))

Mask value for the all MAC ports.

◆ CPSW_ALE_HOST_PORT_MASK

#define CPSW_ALE_HOST_PORT_MASK   (ENET_BIT(0))

Mask value for the host port.

◆ CPSW_ALE_HOST_PORT_NUM

#define CPSW_ALE_HOST_PORT_NUM   (0U)

Port number for the host port.

◆ CPSW_ALE_MACPORT_BASE

#define CPSW_ALE_MACPORT_BASE   (1U)

Base index for MAC ports in ALE context.

◆ CPSW_ALE_MACPORT_TO_ALEPORT

#define CPSW_ALE_MACPORT_TO_ALEPORT (   macPortNum)    (ENET_MACPORT_NORM(macPortNum) + CPSW_ALE_MACPORT_BASE)

Macro to convert MAC port (Enet_MacPort) to ALE port number.

◆ CPSW_ALE_ALEPORT_TO_MACPORT

#define CPSW_ALE_ALEPORT_TO_MACPORT (   alePortNum)    (ENET_MACPORT_DENORM(alePortNum - CPSW_ALE_MACPORT_BASE))

Macro to convert ALE port number to MAC port number(Enet_MacPort)

◆ CPSW_ALE_MACPORT_TO_PORTMASK

#define CPSW_ALE_MACPORT_TO_PORTMASK (   macPort)    (ENET_BIT(CPSW_ALE_MACPORT_TO_ALEPORT(macPort)))

Macro to convert MAC port (Enet_MacPort) to ALE port mask.

◆ CPSW_ALE_MCAST_IGN_BITS_MAX

#define CPSW_ALE_MCAST_IGN_BITS_MAX   (10U)

Maximum number of ignore bits in multicast address.

◆ CPSW_ALE_PEAKBITRATE_DISABLE

#define CPSW_ALE_PEAKBITRATE_DISABLE   (0U)

Disable peak bit rate.

◆ CPSW_ALE_COMMITBITRATE_DISABLE

#define CPSW_ALE_COMMITBITRATE_DISABLE   (0U)

Disable commit bit rate.

◆ CPSW_ALE_THREADID_INVALID

#define CPSW_ALE_THREADID_INVALID   (~0U)

ALE invalid thread id.

◆ CPSW_ALE_CFG_MODULE_EN

#define CPSW_ALE_CFG_MODULE_EN   (ENET_BIT(0U))

Enable ALE.

◆ CPSW_ALE_CFG_BYPASS_EN

#define CPSW_ALE_CFG_BYPASS_EN   (ENET_BIT(1U))

Enable ALE bypass.

◆ CPSW_ALE_CFG_UNKNOWN_UCAST_FLOOD2HOST

#define CPSW_ALE_CFG_UNKNOWN_UCAST_FLOOD2HOST   (ENET_BIT(2U))

Enable Unknown unicast packet flooding to host port.

◆ CPSW_ALE_POLICER_MATCH_PORT

#define CPSW_ALE_POLICER_MATCH_PORT   (ENET_BIT(0U))

Enable classifier match with port number.

◆ CPSW_ALE_POLICER_MATCH_PRIORITY

#define CPSW_ALE_POLICER_MATCH_PRIORITY   (ENET_BIT(1U))

Enable classifier match with received packet priority.

◆ CPSW_ALE_POLICER_MATCH_OUI

#define CPSW_ALE_POLICER_MATCH_OUI   (ENET_BIT(2U))

Enable classifier match with OUI portion of source MAC address.

◆ CPSW_ALE_POLICER_MATCH_MACDST

#define CPSW_ALE_POLICER_MATCH_MACDST   (ENET_BIT(3U))

Enable classifier match with MAC destination address entry with/without VLAN.

◆ CPSW_ALE_POLICER_MATCH_MACSRC

#define CPSW_ALE_POLICER_MATCH_MACSRC   (ENET_BIT(4U))

Enable classifier match with MAC source address entry with/without VLAN.

◆ CPSW_ALE_POLICER_MATCH_OVLAN

#define CPSW_ALE_POLICER_MATCH_OVLAN   (ENET_BIT(5U))

Enable classifier match with outer VLAN entry.

◆ CPSW_ALE_POLICER_MATCH_IVLAN

#define CPSW_ALE_POLICER_MATCH_IVLAN   (ENET_BIT(6U))

Enable classifier match with inner VLAN entry.

◆ CPSW_ALE_POLICER_MATCH_ETHERTYPE

#define CPSW_ALE_POLICER_MATCH_ETHERTYPE   (ENET_BIT(7U))

Enable classifier match with EtherType.

◆ CPSW_ALE_POLICER_MATCH_IPSRC

#define CPSW_ALE_POLICER_MATCH_IPSRC   (ENET_BIT(8U))

Enable classifier match with IPv4/IPv6 source address.

◆ CPSW_ALE_POLICER_MATCH_IPDST

#define CPSW_ALE_POLICER_MATCH_IPDST   (ENET_BIT(9U))

Enable classifier match with IPv4/IPv6 destination address.

◆ CPSW_ALE_POLICER_TABLEENTRY_DELETE_OUI

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_OUI   (CPSW_ALE_POLICER_MATCH_PRIORITY)

Delete OUI ALE table entry.

◆ CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACSRC

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACSRC   (CPSW_ALE_POLICER_MATCH_MACSRC)

Delete MAC source address ALE table entry.

◆ CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACDST

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACDST   (CPSW_ALE_POLICER_MATCH_MACDST)

Delete MAC destination address ALE table entry.

◆ CPSW_ALE_POLICER_TABLEENTRY_DELETE_IVLAN

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_IVLAN   (CPSW_ALE_POLICER_MATCH_IVLAN)

Delete InnerVLAN classifier associated ALE table entry.

◆ CPSW_ALE_POLICER_TABLEENTRY_DELETE_OVLAN

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_OVLAN   (CPSW_ALE_POLICER_MATCH_OVLAN)

Delete OuterVLAN classifier associated ALE table entry.

◆ CPSW_ALE_POLICER_TABLEENTRY_DELETE_ETHERTYPE

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_ETHERTYPE   (CPSW_ALE_POLICER_MATCH_ETHERTYPE)

Delete EtherType classifier associated ALE table entry.

◆ CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPSRC

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPSRC   (CPSW_ALE_POLICER_MATCH_IPSRC)

Delete IPv4/IPv6 source address classifier associated ALE table entry.

◆ CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPDST

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPDST   (CPSW_ALE_POLICER_MATCH_IPDST)

Delete IPv4/IPv6 destination address classifier associated ALE table entry.

◆ CPSW_ALE_POLICER_TABLEENTRY_DELETE_ALL

#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_ALL
Value:
CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACSRC | \
CPSW_ALE_POLICER_TABLEENTRY_DELETE_MACDST | \
CPSW_ALE_POLICER_TABLEENTRY_DELETE_IVLAN | \
CPSW_ALE_POLICER_TABLEENTRY_DELETE_OVLAN | \
CPSW_ALE_POLICER_TABLEENTRY_DELETE_ETHERTYPE | \
CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPSRC | \
CPSW_ALE_POLICER_TABLEENTRY_DELETE_IPDST)

Delete all ale entries associated with classifier entries.

Typedef Documentation

◆ CpswAle_PortVlanCfg

Port default VLAN configuration.

Enumeration Type Documentation

◆ CpswAle_Ioctl

ALE IOCTL commands.

Enumerator
CPSW_ALE_IOCTL_DUMP_TABLE 

Dump ALE table entries.

Print current entries in the ALE table.

IOCTL params:

  • inArgs: None
  • outArgs: None

Calling context: Task

CPSW_ALE_IOCTL_ADD_UCAST 

Add unicast address entry.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_ADD_MCAST 

Add multicast address entry.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_ADD_VLAN 

Add inner/outer VLAN entry.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_ADD_OUI 

Add OUI address entry. IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_ADD_IPV4ADDR 

Add IPv4 address.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_ADD_IPV6ADDR 

Add IPv6 address.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_ADD_ETHERTYPE 

Add EtherType entry.

IOCTL params:

  • inArgs: uint16_t
  • outArgs: uint32_t

Calling context: Task

CPSW_ALE_IOCTL_LOOKUP_UCAST 

Return entry info for given unicast address.

IOCTL params:

CPSW_ALE_IOCTL_LOOKUP_MCAST 

Return entry info for given multicast address.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_LOOKUP_VLAN 

Return entry info for given VLAN id.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_REMOVE_ADDR 

Delete entry info for given unicast/multicast address.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_REMOVE_VLAN 

Delete entry info for given VLAN id.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_REMOVE_OUI 

Delete entry info for given OUI address.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_REMOVE_IPV4ADDR 

Delete entry info for given IPv4 address.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_REMOVE_IPV6ADDR 

Delete entry info for given IPv6 address.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_REMOVE_ETHERTYPE 

Delete entry info for given EtherType.

IOCTL params:

  • inArgs: uint16_t
  • outArgs: None

Calling context: Task

CPSW_ALE_IOCTL_REMOVE_LEARNED_ENTRIES 

Delete all learned entries for a given port.

Returns the number of learned entries that were successfully removed.

IOCTL params:

  • inArgs: uint32_t
  • outArgs: uint32_t

Calling context: Task

CPSW_ALE_IOCTL_REMOVE_ALL_ENTRIES 

Delete all entries.

IOCTL params:

  • inArgs: None
  • outArgs: None

Calling context: Task

CPSW_ALE_IOCTL_AGE_ALL_ENTRIES 

Age all entries now.

IOCTL params:

  • inArgs: None
  • outArgs: None

Calling context:ISR/SWI/Task

CPSW_ALE_IOCTL_SET_RX_FILTER 

Set host port RX filter.

IOCTL params:

  • inArgs: CpswAle_RxFilter
  • outArgs: None

Calling context: Task

CPSW_ALE_IOCTL_GET_RX_FILTER 

Get current host port Rx filter.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_SET_PORT_STATE 

Set port state.

IOCTL params:

CPSW_ALE_IOCTL_GET_PORT_STATE 

Get port state.

IOCTL params:

  • inArgs: uint32_t
  • outArgs: CpswAle_PortState

Calling context: ISR/SWI/Task

CPSW_ALE_IOCTL_GET_PORT_MACADDR 

Get MAC addresses reachable on given port.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_SET_DEFAULT_THREADCFG 

Set default thread configuration.

IOCTL params:

Calling context:Task

CPSW_ALE_IOCTL_GET_DEFAULT_THREADCFG 

Get default thread configuration.

IOCTL params:

Calling context:Task

CPSW_ALE_IOCTL_SET_PORT_MIRROR_CFG 

Set port mirroring configuration.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_DISABLE_PORT_MIRROR 

Disable port mirror (match mirror, destination port mirror and source port mirror).

IOCTL params:

  • inArgs: None
  • outArgs: None

Calling context: Task

CPSW_ALE_IOCTL_SET_TRUNK_CFG 

Set port trunking configuration.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_SET_OAMLPBK_CFG 

Enable OAM loopback for ports in the given port mask.

IOCTL params:

  • inArgs: uint32_t
  • outArgs: None

Calling context: Task

CPSW_ALE_IOCTL_SET_BCAST_MCAST_LIMIT 

Set broadcast/multicast rate limit configuration.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_GET_BCAST_MCAST_LIMIT 

Get configured broadcast/multicast rate limit configuration.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_DISABLE_BCAST_MCAST_LIMIT 

Disable broadcast/multicast rate limit.

IOCTL params:

  • inArgs: None
  • outArgs: None

Calling context: Task

CPSW_ALE_IOCTL_SET_POLICER 

Set policer/classifier entry.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_GET_POLICER 

Get policer/classifier entry info.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_DEL_POLICER 

Delete policer/classifier entry.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_DUMP_POLICER_ENTRIES 

Dump ALE policer entries.

Print ALE policy entries.

IOCTL params:

  • inArgs: None
  • outArgs: None

Calling context: Task

CPSW_ALE_IOCTL_GET_POLICER_STATS 

Get ALE policer statistics.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_SET_POLICER_THREADCFG 

Set thread id for given classifier/policer.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_SET_POLICER_GLOBAL_CFG 

Configure policer global settings. IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_GET_POLICER_GLOBAL_CFG 

Configure policer global settings.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_DEL_ALL_POLICER_THREADID 

Delete all policer entries and associated ALE entry with the given thread id.

IOCTL params:

  • inArgs: uint32_t
  • outArgs: None

Calling context: Task

CPSW_ALE_IOCTL_BLOCK_CLASSIFIER_HOSTPORT 

Blacklist classifier to host port.

ALE supports feature to allow packets matching policer match criteria that is destined for host port to be dropped.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_SET_INTERVLAN_CFG 

Set InterVLAN routing configuration.

IOCTL params:

Calling context: Task

CPSW_ALE_IOCTL_GET_INTERVLAN_CFG 

Get InterVLAN routing configuration.

IOCTL params:

  • inArgs: None
  • outArgs: None

Calling context: Task

◆ CpswAle_PortState

ALE port state.

Enumerator
CPSW_ALE_PORTSTATE_DISABLED 

Discard all packets

CPSW_ALE_PORTSTATE_BLOCKED 

Discard all packets except supervisory packets (BPDUs)

CPSW_ALE_PORTSTATE_LEARN 

Discard all packets except supervisory packets (BPDUs). Also add packet MAC SA as learned entries in table

CPSW_ALE_PORTSTATE_FORWARD 

Forward all packets. Learning also enabled

◆ CpswAle_FwdStateLevel

Forward state level.

Indicates the port state(s) required for the received port on a destination address lookup in order for the multicast packet to be forwarded to the transmit port(s).

A transmit port must be in the Forwarding state in order to forward the packet. If the transmit port mask has multiple set bits then each forward decision is independent of the other transmit port(s) forward decision.

Enumerator
CPSW_ALE_FWDSTLVL_FWD 

Forwarding

CPSW_ALE_FWDSTLVL_BLK_FWD_LRN 

Blocking/Forwarding/Learning

CPSW_ALE_FWDSTLVL_FWD_LRN 

Forwarding/Learning

◆ CpswAle_RxFilter

Packet filtering type (cumulative).

Enumerator
CPSW_ALE_RXFILTER_NOTHING 

Receive filter set to Nothing

CPSW_ALE_RXFILTER_DIRECT 

Receive filter set to Direct

CPSW_ALE_RXFILTER_BCAST 

Receive filter set to Broadcast

CPSW_ALE_RXFILTER_MCAST 

Receive filter set to Multicast

CPSW_ALE_RXFILTER_ALLMCAST 

Receive filter set to All Multicast

CPSW_ALE_RXFILTER_ALL 

Receive filter set to All

◆ CpswAle_TableEntryType

Defines ALE table entry type.

Enumerator
CPSW_ALE_TABLE_ENTRY_TYPE_ADDR 

Unicast/multicast address entry type

CPSW_ALE_TABLE_ENTRY_TYPE_VLAN 

Inner/outer VLAN entry type

CPSW_ALE_TABLE_ENTRY_TYPE_ETHERTYPE 

EtherType entry type

CPSW_ALE_TABLE_ENTRY_TYPE_OUI 

OUI entry type

CPSW_ALE_TABLE_ENTRY_TYPE_IPV4 

IPv4 entry type

CPSW_ALE_TABLE_ENTRY_TYPE_IPV6 

IPv6 entry type

◆ CpswAle_IpAddrClassifierType

IP address classifier type.

Enumerator
CPSW_ALE_IPADDR_CLASSIFIER_IPV4 

Classifier entry is IPv4 address

CPSW_ALE_IPADDR_CLASSIFIER_IPV6 

Classifier entry is IPv6 address

◆ CpswAle_PolicerYellowThresh

Yellow threshold value.

When set, enables a portion of the yellow packets to be dropped based on the "yellow_drop_en" enable.

Enumerator
CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_100 

Drop 100% of packets colored yellow by policer

CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_50 

Drop 50% of packets colored yellow by policer

CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_33 

Drop 33% of packets colored yellow by policer

CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_25 

Drop 25% of packets colored yellow by policer

CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_20 

Drop 20% of packets colored yellow by policer

CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_17 

Drop 17% of packets colored yellow by policer

CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_14 

Drop 14% of packets colored yellow by policer

CPSW_ALE_POLICER_YELLOWTHRESH_DROP_PERCENT_13 

Drop 13% of packets colored yellow by policer

◆ CpswAle_PolicerNoMatchMode

Policing Match Mode.

This field determines what happens to packets that fail to hit any policing/classifier entry.

Enumerator
CPSW_ALE_POLICER_NOMATCH_MODE_GREEN 

Color packets not matching any classifier entry as GREEN

CPSW_ALE_POLICER_NOMATCH_MODE_YELLOW 

Color packets not matching any classifier entry as YELLOW

CPSW_ALE_POLICER_NOMATCH_MODE_RED 

Color packets not matching any classifier entry as RED

CPSW_ALE_POLICER_NOMATCH_MODE_UNREGULATED_TRAFFIC_POLICER 

No Hit packets are marked based on policing for unregulated traffic

Function Documentation

◆ CpswAle_initCfg()

void CpswAle_initCfg ( CpswAle_Cfg aleCfg)

Initialize CPSW ALE configuration parameters.

Parameters
aleCfgConfiguration parameters to be initialized
ENET_IOCTL_TYPE_PUBLIC
@ ENET_IOCTL_TYPE_PUBLIC
Definition: enet_ioctl.h:209
ENET_IOCTL_TYPE_PRIVATE
@ ENET_IOCTL_TYPE_PRIVATE
Definition: enet_ioctl.h:212
CPSW_ALE_POLICER_TABLEENTRY_DELETE_OUI
#define CPSW_ALE_POLICER_TABLEENTRY_DELETE_OUI
Delete OUI ALE table entry.
Definition: cpsw_ale.h:211