AM64x MCU+ SDK  08.02.00
cpsw_ale.h File Reference

Introduction

This file contains the type definitions and helper macros for the CPSW Address Lookup Engine (ALE) module interface.

Go to the source code of this file.

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...
 

Macros

#define CPSW_ALE_PUBLIC_IOCTL(x)
 Helper macro to create IOCTL commands for ALE module. More...
 
#define CPSW_ALE_NUM_PORTS   (9U)
 Number of switch ports in the subsystem. 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...
 

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...
 

Functions

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