/* SGCR - Switch General Configuration Register * -------------------------------------------- * This register is used for configuration of the switch capabilities.
*/ #define MLXSW_REG_SGCR_ID 0x2000 #define MLXSW_REG_SGCR_LEN 0x10
/* reg_sgcr_lag_lookup_pgt_base * Base address used for lookup in PGT table * Supported when CONFIG_PROFILE.lag_mode = 1 * Note: when IGCR.ddd_lag_mode=0, the address shall be aligned to 8 entries. * Access: RW
*/
MLXSW_ITEM32(reg, sgcr, lag_lookup_pgt_base, 0x0C, 0, 16);
/* reg_spad_base_mac * Base MAC address for the switch partitions. * Per switch partition MAC address is equal to: * base_mac + swid * Access: RW
*/
MLXSW_ITEM_BUF(reg, spad, base_mac, 0x02, 6);
/* SSPR - Switch System Port Record Register * ----------------------------------------- * Configures the system port to local port mapping.
*/ #define MLXSW_REG_SSPR_ID 0x2008 #define MLXSW_REG_SSPR_LEN 0x8
/* reg_sspr_m * Master - if set, then the record describes the master system port. * This is needed in case a local port is mapped into several system ports * (for multipathing). That number will be reported as the source system * port when packets are forwarded to the CPU. Only one master port is allowed * per local port. * * Note: Must be set for Spectrum. * Access: RW
*/
MLXSW_ITEM32(reg, sspr, m, 0x00, 31, 1);
/* reg_sspr_local_port * Local port number. * * Access: RW
*/
MLXSW_ITEM32_LP(reg, sspr, 0x00, 16, 0x00, 12);
/* reg_sspr_system_port * Unique identifier within the stacking domain that represents all the ports * that are available in the system (external ports). * * Currently, only single-ASIC configurations are supported, so we default to * 1:1 mapping between system ports and local ports. * Access: Index
*/
MLXSW_ITEM32(reg, sspr, system_port, 0x04, 0, 16);
/* SFDAT - Switch Filtering Database Aging Time * -------------------------------------------- * Controls the Switch aging time. Aging time is able to be set per Switch * Partition.
*/ #define MLXSW_REG_SFDAT_ID 0x2009 #define MLXSW_REG_SFDAT_LEN 0x8
/* SFD - Switch Filtering Database * ------------------------------- * The following register defines the access to the filtering database. * The register supports querying, adding, removing and modifying the database. * The access is optimized for bulk updates in which case more than one * FDB record is present in the same command.
*/ #define MLXSW_REG_SFD_ID 0x200A #define MLXSW_REG_SFD_BASE_LEN 0x10 /* base length, without records */ #define MLXSW_REG_SFD_REC_LEN 0x10 /* record length */ #define MLXSW_REG_SFD_REC_MAX_COUNT 64 #define MLXSW_REG_SFD_LEN (MLXSW_REG_SFD_BASE_LEN + \
MLXSW_REG_SFD_REC_LEN * MLXSW_REG_SFD_REC_MAX_COUNT)
/* reg_sfd_swid * Switch partition ID for queries. Reserved on Write. * Access: Index
*/
MLXSW_ITEM32(reg, sfd, swid, 0x00, 24, 8);
enum mlxsw_reg_sfd_op { /* Dump entire FDB a (process according to record_locator) */
MLXSW_REG_SFD_OP_QUERY_DUMP = 0, /* Query records by {MAC, VID/FID} value */
MLXSW_REG_SFD_OP_QUERY_QUERY = 1, /* Query and clear activity. Query records by {MAC, VID/FID} value */
MLXSW_REG_SFD_OP_QUERY_QUERY_AND_CLEAR_ACTIVITY = 2, /* Test. Response indicates if each of the records could be * added to the FDB.
*/
MLXSW_REG_SFD_OP_WRITE_TEST = 0, /* Add/modify. Aged-out records cannot be added. This command removes * the learning notification of the {MAC, VID/FID}. Response includes * the entries that were added to the FDB.
*/
MLXSW_REG_SFD_OP_WRITE_EDIT = 1, /* Remove record by {MAC, VID/FID}. This command also removes * the learning notification and aged-out notifications * of the {MAC, VID/FID}. The response provides current (pre-removal) * entries as non-aged-out.
*/
MLXSW_REG_SFD_OP_WRITE_REMOVE = 2, /* Remove learned notification by {MAC, VID/FID}. The response provides * the removed learning notification.
*/
MLXSW_REG_SFD_OP_WRITE_REMOVE_NOTIFICATION = 2,
};
/* reg_sfd_record_locator * Used for querying the FDB. Use record_locator=0 to initiate the * query. When a record is returned, a new record_locator is * returned to be used in the subsequent query. * Reserved for database update. * Access: Index
*/
MLXSW_ITEM32(reg, sfd, record_locator, 0x04, 0, 30);
/* reg_sfd_num_rec * Request: Number of records to read/add/modify/remove * Response: Number of records read/added/replaced/removed * See above description for more details. * Ranges 0..64 * Access: RW
*/
MLXSW_ITEM32(reg, sfd, num_rec, 0x08, 0, 8);
/* reg_sfd_rec_a * Activity. Set for new static entries. Set for static entries if a frame SMAC * lookup hits on the entry. * To clear the a bit, use "query and clear activity" op. * Access: RO
*/
MLXSW_ITEM32_INDEXED(reg, sfd, rec_a, MLXSW_REG_SFD_BASE_LEN, 16, 1,
MLXSW_REG_SFD_REC_LEN, 0x00, false);
/* reg_sfd_rec_mac * MAC address. * Access: Index
*/
MLXSW_ITEM_BUF_INDEXED(reg, sfd, rec_mac, MLXSW_REG_SFD_BASE_LEN, 6,
MLXSW_REG_SFD_REC_LEN, 0x02);
enum mlxsw_reg_sfd_rec_action { /* forward */
MLXSW_REG_SFD_REC_ACTION_NOP = 0, /* forward and trap, trap_id is FDB_TRAP */
MLXSW_REG_SFD_REC_ACTION_MIRROR_TO_CPU = 1, /* trap and do not forward, trap_id is FDB_TRAP */
MLXSW_REG_SFD_REC_ACTION_TRAP = 2, /* forward to IP router */
MLXSW_REG_SFD_REC_ACTION_FORWARD_IP_ROUTER = 3,
MLXSW_REG_SFD_REC_ACTION_DISCARD_ERROR = 15,
};
/* reg_sfd_rec_action * Action to apply on the packet. * Note: Dynamic entries can only be configured with NOP action. * Access: RW
*/
MLXSW_ITEM32_INDEXED(reg, sfd, rec_action, MLXSW_REG_SFD_BASE_LEN, 28, 4,
MLXSW_REG_SFD_REC_LEN, 0x0C, false);
/* reg_sfd_uc_sub_port * VEPA channel on local port. * Valid only if local port is a non-stacking port. Must be 0 if multichannel * VEPA is not enabled. * Access: RW
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_sub_port, MLXSW_REG_SFD_BASE_LEN, 16, 8,
MLXSW_REG_SFD_REC_LEN, 0x08, false);
/* reg_sfd_uc_set_vid * Set VID. * 0 - Do not update VID. * 1 - Set VID. * For Spectrum-2 when set_vid=0 and smpe_valid=1, the smpe will modify the vid. * Access: RW * * Note: Reserved when legacy bridge model is used.
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_set_vid, MLXSW_REG_SFD_BASE_LEN, 31, 1,
MLXSW_REG_SFD_REC_LEN, 0x08, false);
/* reg_sfd_uc_fid_vid * Filtering ID or VLAN ID * For SwitchX and SwitchX-2: * - Dynamic entries (policy 2,3) use FID * - Static entries (policy 0) use VID * - When independent learning is configured, VID=FID * For Spectrum: use FID for both Dynamic and Static entries. * VID should not be used. * Access: Index
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_fid_vid, MLXSW_REG_SFD_BASE_LEN, 0, 16,
MLXSW_REG_SFD_REC_LEN, 0x08, false);
/* reg_sfd_uc_vid * New VID when set_vid=1. * Access: RW * * Note: Reserved when legacy bridge model is used and when set_vid=0.
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_vid, MLXSW_REG_SFD_BASE_LEN, 16, 12,
MLXSW_REG_SFD_REC_LEN, 0x0C, false);
/* reg_sfd_uc_system_port * Unique port identifier for the final destination of the packet. * Access: RW
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_system_port, MLXSW_REG_SFD_BASE_LEN, 0, 16,
MLXSW_REG_SFD_REC_LEN, 0x0C, false);
/* reg_sfd_uc_lag_sub_port * LAG sub port. * Must be 0 if multichannel VEPA is not enabled. * Access: RW
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_lag_sub_port, MLXSW_REG_SFD_BASE_LEN, 16, 8,
MLXSW_REG_SFD_REC_LEN, 0x08, false);
/* reg_sfd_uc_lag_set_vid * Set VID. * 0 - Do not update VID. * 1 - Set VID. * For Spectrum-2 when set_vid=0 and smpe_valid=1, the smpe will modify the vid. * Access: RW * * Note: Reserved when legacy bridge model is used.
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_lag_set_vid, MLXSW_REG_SFD_BASE_LEN, 31, 1,
MLXSW_REG_SFD_REC_LEN, 0x08, false);
/* reg_sfd_uc_lag_fid_vid * Filtering ID or VLAN ID * For SwitchX and SwitchX-2: * - Dynamic entries (policy 2,3) use FID * - Static entries (policy 0) use VID * - When independent learning is configured, VID=FID * For Spectrum: use FID for both Dynamic and Static entries. * VID should not be used. * Access: Index
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_lag_fid_vid, MLXSW_REG_SFD_BASE_LEN, 0, 16,
MLXSW_REG_SFD_REC_LEN, 0x08, false);
/* reg_sfd_uc_lag_lag_vid * New vlan ID. * Access: RW * * Note: Reserved when legacy bridge model is used and set_vid=0.
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_lag_lag_vid, MLXSW_REG_SFD_BASE_LEN, 16, 12,
MLXSW_REG_SFD_REC_LEN, 0x0C, false);
/* reg_sfd_uc_lag_lag_id * LAG Identifier - pointer into the LAG descriptor table. * Access: RW
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_lag_lag_id, MLXSW_REG_SFD_BASE_LEN, 0, 10,
MLXSW_REG_SFD_REC_LEN, 0x0C, false);
/* reg_sfd_mc_pgi * * Multicast port group index - index into the port group table. * Value 0x1FFF indicates the pgi should point to the MID entry. * For Spectrum this value must be set to 0x1FFF * Access: RW
*/
MLXSW_ITEM32_INDEXED(reg, sfd, mc_pgi, MLXSW_REG_SFD_BASE_LEN, 16, 13,
MLXSW_REG_SFD_REC_LEN, 0x08, false);
/* reg_sfd_mc_fid_vid * * Filtering ID or VLAN ID * Access: Index
*/
MLXSW_ITEM32_INDEXED(reg, sfd, mc_fid_vid, MLXSW_REG_SFD_BASE_LEN, 0, 16,
MLXSW_REG_SFD_REC_LEN, 0x08, false);
/* reg_sfd_mc_mid * * Multicast identifier - global identifier that represents the multicast * group across all devices. * Access: RW
*/
MLXSW_ITEM32_INDEXED(reg, sfd, mc_mid, MLXSW_REG_SFD_BASE_LEN, 0, 16,
MLXSW_REG_SFD_REC_LEN, 0x0C, false);
/* reg_sfd_uc_tunnel_uip_msb * When protocol is IPv4, the most significant byte of the underlay IPv4 * destination IP. * When protocol is IPv6, reserved. * Access: RW
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_tunnel_uip_msb, MLXSW_REG_SFD_BASE_LEN, 24,
8, MLXSW_REG_SFD_REC_LEN, 0x08, false);
/* reg_sfd_uc_tunnel_uip_lsb * When protocol is IPv4, the least significant bytes of the underlay * IPv4 destination IP. * When protocol is IPv6, pointer to the underlay IPv6 destination IP * which is configured by RIPS. * Access: RW
*/
MLXSW_ITEM32_INDEXED(reg, sfd, uc_tunnel_uip_lsb, MLXSW_REG_SFD_BASE_LEN, 0,
24, MLXSW_REG_SFD_REC_LEN, 0x0C, false);
/* reg_sfn_end * Forces the current session to end. * Access: OP
*/
MLXSW_ITEM32(reg, sfn, end, 0x04, 20, 1);
/* reg_sfn_num_rec * Request: Number of learned notifications and aged-out notification * records requested. * Response: Number of notification records returned (must be smaller * than or equal to the value requested) * Ranges 0..64 * Access: OP
*/
MLXSW_ITEM32(reg, sfn, num_rec, 0x04, 0, 8);
enum mlxsw_reg_sfn_rec_type { /* MAC addresses learned on a regular port. */
MLXSW_REG_SFN_REC_TYPE_LEARNED_MAC = 0x5, /* MAC addresses learned on a LAG port. */
MLXSW_REG_SFN_REC_TYPE_LEARNED_MAC_LAG = 0x6, /* Aged-out MAC address on a regular port. */
MLXSW_REG_SFN_REC_TYPE_AGED_OUT_MAC = 0x7, /* Aged-out MAC address on a LAG port. */
MLXSW_REG_SFN_REC_TYPE_AGED_OUT_MAC_LAG = 0x8, /* Learned unicast tunnel record. */
MLXSW_REG_SFN_REC_TYPE_LEARNED_UNICAST_TUNNEL = 0xD, /* Aged-out unicast tunnel record. */
MLXSW_REG_SFN_REC_TYPE_AGED_OUT_UNICAST_TUNNEL = 0xE,
};
/* reg_sfn_mac_sub_port * VEPA channel on the local port. * 0 if multichannel VEPA is not enabled. * Access: RO
*/
MLXSW_ITEM32_INDEXED(reg, sfn, mac_sub_port, MLXSW_REG_SFN_BASE_LEN, 16, 8,
MLXSW_REG_SFN_REC_LEN, 0x08, false);
/* reg_sfn_mac_system_port * Unique port identifier for the final destination of the packet. * Access: RO
*/
MLXSW_ITEM32_INDEXED(reg, sfn, mac_system_port, MLXSW_REG_SFN_BASE_LEN, 0, 16,
MLXSW_REG_SFN_REC_LEN, 0x0C, false);
/* reg_sfn_mac_lag_lag_id * LAG ID (pointer into the LAG descriptor table). * Access: RO
*/
MLXSW_ITEM32_INDEXED(reg, sfn, mac_lag_lag_id, MLXSW_REG_SFN_BASE_LEN, 0, 10,
MLXSW_REG_SFN_REC_LEN, 0x0C, false);
/* reg_sfn_uc_tunnel_uip_msb * When protocol is IPv4, the most significant byte of the underlay IPv4 * address of the remote VTEP. * When protocol is IPv6, reserved. * Access: RO
*/
MLXSW_ITEM32_INDEXED(reg, sfn, uc_tunnel_uip_msb, MLXSW_REG_SFN_BASE_LEN, 24,
8, MLXSW_REG_SFN_REC_LEN, 0x08, false);
/* reg_sfn_uc_tunnel_uip_lsb * When protocol is IPv4, the least significant bytes of the underlay * IPv4 address of the remote VTEP. * When protocol is IPv6, ipv6_id to be queried from TNIPSD. * Access: RO
*/
MLXSW_ITEM32_INDEXED(reg, sfn, uc_tunnel_uip_lsb, MLXSW_REG_SFN_BASE_LEN, 0,
24, MLXSW_REG_SFN_REC_LEN, 0x0C, false);
/* SPMS - Switch Port MSTP/RSTP State Register * ------------------------------------------- * Configures the spanning tree state of a physical port.
*/ #define MLXSW_REG_SPMS_ID 0x200D #define MLXSW_REG_SPMS_LEN 0x404
/* reg_spms_state * Spanning tree state of each VLAN ID (VID) of the local port. * 0 - Do not change spanning tree state (used only when writing). * 1 - Discarding. No learning or forwarding to/from this port (default). * 2 - Learning. Port is learning, but not forwarding. * 3 - Forwarding. Port is learning and forwarding. * Access: RW
*/
MLXSW_ITEM_BIT_ARRAY(reg, spms, state, 0x04, 0x400, 2);
/* SPVID - Switch Port VID * ----------------------- * The switch port VID configures the default VID for a port.
*/ #define MLXSW_REG_SPVID_ID 0x200E #define MLXSW_REG_SPVID_LEN 0x08
/* reg_spvid_tport * Port is tunnel port. * Reserved when SwitchX/-2 or Spectrum-1. * Access: Index
*/
MLXSW_ITEM32(reg, spvid, tport, 0x00, 24, 1);
/* reg_spvid_local_port * When tport = 0: Local port number. Not supported for CPU port. * When tport = 1: Tunnel port. * Access: Index
*/
MLXSW_ITEM32_LP(reg, spvid, 0x00, 16, 0x00, 12);
/* reg_spvid_sub_port * Virtual port within the physical port. * Should be set to 0 when virtual ports are not enabled on the port. * Access: Index
*/
MLXSW_ITEM32(reg, spvid, sub_port, 0x00, 8, 8);
/* reg_spvid_egr_et_set * When VLAN is pushed at ingress (for untagged packets or for * QinQ push mode) then the EtherType is decided at the egress port. * Reserved when Spectrum-1. * Access: RW
*/
MLXSW_ITEM32(reg, spvid, egr_et_set, 0x04, 24, 1);
/* reg_spvid_et_vlan * EtherType used for when VLAN is pushed at ingress (for untagged * packets or for QinQ push mode). * 0: ether_type0 - (default) * 1: ether_type1 * 2: ether_type2 - Reserved when Spectrum-1, supported by Spectrum-2 * Ethertype IDs are configured by SVER. * Reserved when egr_et_set = 1. * Access: RW
*/
MLXSW_ITEM32(reg, spvid, et_vlan, 0x04, 16, 2);
/* reg_spvid_pvid * Port default VID * Access: RW
*/
MLXSW_ITEM32(reg, spvid, pvid, 0x04, 0, 12);
/* SPVM - Switch Port VLAN Membership * ---------------------------------- * The Switch Port VLAN Membership register configures the VLAN membership * of a port in a VLAN denoted by VID. VLAN membership is managed per * virtual port. The register can be used to add and remove VID(s) from a port.
*/ #define MLXSW_REG_SPVM_ID 0x200F #define MLXSW_REG_SPVM_BASE_LEN 0x04 /* base length, without records */ #define MLXSW_REG_SPVM_REC_LEN 0x04 /* record length */ #define MLXSW_REG_SPVM_REC_MAX_COUNT 255 #define MLXSW_REG_SPVM_LEN (MLXSW_REG_SPVM_BASE_LEN + \
MLXSW_REG_SPVM_REC_LEN * MLXSW_REG_SPVM_REC_MAX_COUNT)
/* reg_spvm_pt * Priority tagged. If this bit is set, packets forwarded to the port with * untagged VLAN membership (u bit is set) will be tagged with priority tag * (VID=0) * Access: RW
*/
MLXSW_ITEM32(reg, spvm, pt, 0x00, 31, 1);
/* reg_spvm_pte * Priority Tagged Update Enable. On Write operations, if this bit is cleared, * the pt bit will NOT be updated. To update the pt bit, pte must be set. * Access: WO
*/
MLXSW_ITEM32(reg, spvm, pte, 0x00, 30, 1);
/* reg_spvm_local_port * Local port number. * Access: Index
*/
MLXSW_ITEM32_LP(reg, spvm, 0x00, 16, 0x00, 12);
/* reg_spvm_sub_port * Virtual port within the physical port. * Should be set to 0 when virtual ports are not enabled on the port. * Access: Index
*/
MLXSW_ITEM32(reg, spvm, sub_port, 0x00, 8, 8);
/* reg_spvm_num_rec * Number of records to update. Each record contains: i, e, u, vid. * Access: OP
*/
MLXSW_ITEM32(reg, spvm, num_rec, 0x00, 0, 8);
for (i = 0; i < size; i++) {
mlxsw_reg_spvm_rec_i_set(payload, i, is_member);
mlxsw_reg_spvm_rec_e_set(payload, i, is_member);
mlxsw_reg_spvm_rec_u_set(payload, i, untagged);
mlxsw_reg_spvm_rec_vid_set(payload, i, vid_begin + i);
}
}
/* SPAFT - Switch Port Acceptable Frame Types * ------------------------------------------ * The Switch Port Acceptable Frame Types register configures the frame * admittance of the port.
*/ #define MLXSW_REG_SPAFT_ID 0x2010 #define MLXSW_REG_SPAFT_LEN 0x08
/* reg_spaft_local_port * Local port number. * Access: Index * * Note: CPU port is not supported (all tag types are allowed).
*/
MLXSW_ITEM32_LP(reg, spaft, 0x00, 16, 0x00, 12);
/* reg_spaft_sub_port * Virtual port within the physical port. * Should be set to 0 when virtual ports are not enabled on the port. * Access: RW
*/
MLXSW_ITEM32(reg, spaft, sub_port, 0x00, 8, 8);
/* reg_spaft_allow_untagged * When set, untagged frames on the ingress are allowed (default). * Access: RW
*/
MLXSW_ITEM32(reg, spaft, allow_untagged, 0x04, 31, 1);
/* reg_spaft_allow_prio_tagged * When set, priority tagged frames on the ingress are allowed (default). * Access: RW
*/
MLXSW_ITEM32(reg, spaft, allow_prio_tagged, 0x04, 30, 1);
/* reg_spaft_allow_tagged * When set, tagged frames on the ingress are allowed (default). * Access: RW
*/
MLXSW_ITEM32(reg, spaft, allow_tagged, 0x04, 29, 1);
/* SFGC - Switch Flooding Group Configuration * ------------------------------------------ * The following register controls the association of flooding tables and MIDs * to packet types used for flooding. * * Reserved when CONFIG_PROFILE.flood_mode = CFF.
*/ #define MLXSW_REG_SFGC_ID 0x2011 #define MLXSW_REG_SFGC_LEN 0x14
/* reg_sfgc_type * The traffic type to reach the flooding table. * Access: Index
*/
MLXSW_ITEM32(reg, sfgc, type, 0x00, 0, 4);
/* bridge_type is used in SFGC and SFMR. */ enum mlxsw_reg_bridge_type {
MLXSW_REG_BRIDGE_TYPE_0 = 0, /* Used for .1q FIDs. */
MLXSW_REG_BRIDGE_TYPE_1 = 1, /* Used for .1d FIDs. */
};
/* reg_sfgc_bridge_type * Access: Index * * Note: SwitchX-2 only supports 802.1Q mode.
*/
MLXSW_ITEM32(reg, sfgc, bridge_type, 0x04, 24, 3);
/* reg_sfgc_table_type * See mlxsw_flood_table_type * Access: RW * * Note: FID offset and FID types are not supported in SwitchX-2.
*/
MLXSW_ITEM32(reg, sfgc, table_type, 0x04, 16, 3);
/* reg_sfgc_flood_table * Flooding table index to associate with the specific type on the specific * switch partition. * Access: RW
*/
MLXSW_ITEM32(reg, sfgc, flood_table, 0x04, 0, 6);
/* reg_sfgc_counter_set_type * Counter Set Type for flow counters. * Access: RW
*/
MLXSW_ITEM32(reg, sfgc, counter_set_type, 0x0C, 24, 8);
/* reg_sfgc_counter_index * Counter Index for flow counters. * Access: RW
*/
MLXSW_ITEM32(reg, sfgc, counter_index, 0x0C, 0, 24);
/* reg_sfgc_mid_base * MID Base. * Access: RW * * Note: Reserved when legacy bridge model is used.
*/
MLXSW_ITEM32(reg, sfgc, mid_base, 0x10, 0, 16);
/* SFDF - Switch Filtering DB Flush * -------------------------------- * The switch filtering DB flush register is used to flush the FDB. * Note that FDB notifications are flushed as well.
*/ #define MLXSW_REG_SFDF_ID 0x2013 #define MLXSW_REG_SFDF_LEN 0x14
/* reg_sfdf_flush_type * Flush type. * 0 - All SWID dynamic entries are flushed. * 1 - All FID dynamic entries are flushed. * 2 - All dynamic entries pointing to port are flushed. * 3 - All FID dynamic entries pointing to port are flushed. * 4 - All dynamic entries pointing to LAG are flushed. * 5 - All FID dynamic entries pointing to LAG are flushed. * 6 - All entries of type "Unicast Tunnel" or "Multicast Tunnel" are * flushed. * 7 - All entries of type "Unicast Tunnel" or "Multicast Tunnel" are * flushed, per FID. * Access: RW
*/
MLXSW_ITEM32(reg, sfdf, flush_type, 0x04, 28, 4);
/* reg_sfdf_flush_static * Static. * 0 - Flush only dynamic entries. * 1 - Flush both dynamic and static entries. * Access: RW
*/
MLXSW_ITEM32(reg, sfdf, flush_static, 0x04, 24, 1);
/* reg_sfdf_system_port * Port to flush. * Access: RW
*/
MLXSW_ITEM32(reg, sfdf, system_port, 0x0C, 0, 16);
/* reg_sfdf_port_fid_system_port * Port to flush, pointed to by FID. * Access: RW
*/
MLXSW_ITEM32(reg, sfdf, port_fid_system_port, 0x08, 0, 16);
/* reg_sfdf_lag_id * LAG ID to flush. * Access: RW
*/
MLXSW_ITEM32(reg, sfdf, lag_id, 0x0C, 0, 10);
/* reg_sfdf_lag_fid_lag_id * LAG ID to flush, pointed to by FID. * Access: RW
*/
MLXSW_ITEM32(reg, sfdf, lag_fid_lag_id, 0x08, 0, 10);
/* SLDR - Switch LAG Descriptor Register * ----------------------------------------- * The switch LAG descriptor register is populated by LAG descriptors. * Each LAG descriptor is indexed by lag_id. The LAG ID runs from 0 to * max_lag-1.
*/ #define MLXSW_REG_SLDR_ID 0x2014 #define MLXSW_REG_SLDR_LEN 0x0C /* counting in only one port in list */
enum mlxsw_reg_sldr_op { /* Indicates a creation of a new LAG-ID, lag_id must be valid */
MLXSW_REG_SLDR_OP_LAG_CREATE,
MLXSW_REG_SLDR_OP_LAG_DESTROY, /* Ports that appear in the list have the Distributor enabled */
MLXSW_REG_SLDR_OP_LAG_ADD_PORT_LIST, /* Removes ports from the disributor list */
MLXSW_REG_SLDR_OP_LAG_REMOVE_PORT_LIST,
};
/* reg_sldr_lag_id * LAG identifier. The lag_id is the index into the LAG descriptor table. * Access: Index
*/
MLXSW_ITEM32(reg, sldr, lag_id, 0x00, 0, 10);
/* reg_sldr_num_ports * The number of member ports of the LAG. * Reserved for Create / Destroy operations * For Add / Remove operations - indicates the number of ports in the list. * Access: RW
*/
MLXSW_ITEM32(reg, sldr, num_ports, 0x04, 24, 8);
/* SLCR - Switch LAG Configuration 2 Register * ------------------------------------------- * The Switch LAG Configuration register is used for configuring the * LAG properties of the switch.
*/ #define MLXSW_REG_SLCR_ID 0x2015 #define MLXSW_REG_SLCR_LEN 0x10
enum mlxsw_reg_slcr_pp { /* Global Configuration (for all ports) */
MLXSW_REG_SLCR_PP_GLOBAL, /* Per port configuration, based on local_port field */
MLXSW_REG_SLCR_PP_PER_PORT,
};
/* reg_slcr_pp * Per Port Configuration * Note: Reading at Global mode results in reading port 1 configuration. * Access: Index
*/
MLXSW_ITEM32(reg, slcr, pp, 0x00, 24, 1);
/* reg_slcr_local_port * Local port number * Supported from CPU port * Not supported from router port * Reserved when pp = Global Configuration * Access: Index
*/
MLXSW_ITEM32_LP(reg, slcr, 0x00, 16, 0x00, 12);
/* Ingress port */ #define MLXSW_REG_SLCR_LAG_HASH_IN_PORT BIT(0) /* SMAC - for IPv4 and IPv6 packets */ #define MLXSW_REG_SLCR_LAG_HASH_SMAC_IP BIT(1) /* SMAC - for non-IP packets */ #define MLXSW_REG_SLCR_LAG_HASH_SMAC_NONIP BIT(2) #define MLXSW_REG_SLCR_LAG_HASH_SMAC \
(MLXSW_REG_SLCR_LAG_HASH_SMAC_IP | \
MLXSW_REG_SLCR_LAG_HASH_SMAC_NONIP) /* DMAC - for IPv4 and IPv6 packets */ #define MLXSW_REG_SLCR_LAG_HASH_DMAC_IP BIT(3) /* DMAC - for non-IP packets */ #define MLXSW_REG_SLCR_LAG_HASH_DMAC_NONIP BIT(4) #define MLXSW_REG_SLCR_LAG_HASH_DMAC \
(MLXSW_REG_SLCR_LAG_HASH_DMAC_IP | \
MLXSW_REG_SLCR_LAG_HASH_DMAC_NONIP) /* Ethertype - for IPv4 and IPv6 packets */ #define MLXSW_REG_SLCR_LAG_HASH_ETHERTYPE_IP BIT(5) /* Ethertype - for non-IP packets */ #define MLXSW_REG_SLCR_LAG_HASH_ETHERTYPE_NONIP BIT(6) #define MLXSW_REG_SLCR_LAG_HASH_ETHERTYPE \
(MLXSW_REG_SLCR_LAG_HASH_ETHERTYPE_IP | \
MLXSW_REG_SLCR_LAG_HASH_ETHERTYPE_NONIP) /* VLAN ID - for IPv4 and IPv6 packets */ #define MLXSW_REG_SLCR_LAG_HASH_VLANID_IP BIT(7) /* VLAN ID - for non-IP packets */ #define MLXSW_REG_SLCR_LAG_HASH_VLANID_NONIP BIT(8) #define MLXSW_REG_SLCR_LAG_HASH_VLANID \
(MLXSW_REG_SLCR_LAG_HASH_VLANID_IP | \
MLXSW_REG_SLCR_LAG_HASH_VLANID_NONIP) /* Source IP address (can be IPv4 or IPv6) */ #define MLXSW_REG_SLCR_LAG_HASH_SIP BIT(9) /* Destination IP address (can be IPv4 or IPv6) */ #define MLXSW_REG_SLCR_LAG_HASH_DIP BIT(10) /* TCP/UDP source port */ #define MLXSW_REG_SLCR_LAG_HASH_SPORT BIT(11) /* TCP/UDP destination port*/ #define MLXSW_REG_SLCR_LAG_HASH_DPORT BIT(12) /* IPv4 Protocol/IPv6 Next Header */ #define MLXSW_REG_SLCR_LAG_HASH_IPPROTO BIT(13) /* IPv6 Flow label */ #define MLXSW_REG_SLCR_LAG_HASH_FLOWLABEL BIT(14) /* SID - FCoE source ID */ #define MLXSW_REG_SLCR_LAG_HASH_FCOE_SID BIT(15) /* DID - FCoE destination ID */ #define MLXSW_REG_SLCR_LAG_HASH_FCOE_DID BIT(16) /* OXID - FCoE originator exchange ID */ #define MLXSW_REG_SLCR_LAG_HASH_FCOE_OXID BIT(17) /* Destination QP number - for RoCE packets */ #define MLXSW_REG_SLCR_LAG_HASH_ROCE_DQP BIT(19)
/* reg_slcr_lag_hash * LAG hashing configuration. This is a bitmask, in which each set * bit includes the corresponding item in the LAG hash calculation. * The default lag_hash contains SMAC, DMAC, VLANID and * Ethertype (for all packet types). * Access: RW
*/
MLXSW_ITEM32(reg, slcr, lag_hash, 0x04, 0, 20);
/* reg_slcr_seed * LAG seed value. The seed is the same for all ports. * Access: RW
*/
MLXSW_ITEM32(reg, slcr, seed, 0x08, 0, 32);
/* SLCOR - Switch LAG Collector Register * ------------------------------------- * The Switch LAG Collector register controls the Local Port membership * in a LAG and enablement of the collector.
*/ #define MLXSW_REG_SLCOR_ID 0x2016 #define MLXSW_REG_SLCOR_LEN 0x10
/* reg_slcor_local_port * Local port number * Not supported for CPU port * Access: Index
*/
MLXSW_ITEM32_LP(reg, slcor, 0x00, 16, 0x00, 12);
/* reg_slcor_lag_id * LAG Identifier. Index into the LAG descriptor table. * Access: Index
*/
MLXSW_ITEM32(reg, slcor, lag_id, 0x00, 0, 10);
/* reg_slcor_port_index * Port index in the LAG list. Only valid on Add Port to LAG col. * Valid range is from 0 to cap_max_lag_members-1 * Access: RW
*/
MLXSW_ITEM32(reg, slcor, port_index, 0x04, 0, 10);
/* reg_spmlr_local_port * Local port number. * Access: Index
*/
MLXSW_ITEM32_LP(reg, spmlr, 0x00, 16, 0x00, 12);
/* reg_spmlr_sub_port * Virtual port within the physical port. * Should be set to 0 when virtual ports are not enabled on the port. * Access: Index
*/
MLXSW_ITEM32(reg, spmlr, sub_port, 0x00, 8, 8);
/* reg_spmlr_learn_mode * Learning mode on the port. * 0 - Learning disabled. * 2 - Learning enabled. * 3 - Security mode. * * In security mode the switch does not learn MACs on the port, but uses the * SMAC to see if it exists on another ingress port. If so, the packet is * classified as a bad packet and is discarded unless the software registers * to receive port security error packets usign HPKT.
*/
MLXSW_ITEM32(reg, spmlr, learn_mode, 0x04, 30, 2);
/* SVFA - Switch VID to FID Allocation Register * -------------------------------------------- * Controls the VID to FID mapping and {Port, VID} to FID mapping for * virtualized ports.
*/ #define MLXSW_REG_SVFA_ID 0x201C #define MLXSW_REG_SVFA_LEN 0x18
/* reg_svfa_counter_set_type * Counter set type for flow counters. * Access: RW * * Note: Reserved for SwitchX-2.
*/
MLXSW_ITEM32(reg, svfa, counter_set_type, 0x08, 24, 8);
/* reg_svfa_counter_index * Counter index for flow counters. * Access: RW * * Note: Reserved for SwitchX-2.
*/
MLXSW_ITEM32(reg, svfa, counter_index, 0x08, 0, 24);
/* reg_svfa_vni * Virtual Network Identifier. * Access: Index * * Note: Reserved when mapping_table is not 2 (VNI mapping table).
*/
MLXSW_ITEM32(reg, svfa, vni, 0x10, 0, 24);
/* reg_svfa_irif_v * Ingress RIF valid. * 0 - Ingress RIF is not valid, no ingress RIF assigned. * 1 - Ingress RIF valid. * Must not be set for a non enabled RIF. * Access: RW * * Note: Reserved when legacy bridge model is used.
*/
MLXSW_ITEM32(reg, svfa, irif_v, 0x14, 24, 1);
/* reg_svfa_irif * Ingress RIF (Router Interface). * Range is 0..cap_max_router_interfaces-1. * Access: RW * * Note: Reserved when legacy bridge model is used and when irif_v=0.
*/
MLXSW_ITEM32(reg, svfa, irif, 0x14, 0, 16);
/* SPVTR - Switch Port VLAN Stacking Register * ------------------------------------------ * The Switch Port VLAN Stacking register configures the VLAN mode of the port * to enable VLAN stacking.
*/ #define MLXSW_REG_SPVTR_ID 0x201D #define MLXSW_REG_SPVTR_LEN 0x10
/* reg_spvtr_tport * Port is tunnel port. * Access: Index * * Note: Reserved when SwitchX/-2 or Spectrum-1.
*/
MLXSW_ITEM32(reg, spvtr, tport, 0x00, 24, 1);
/* reg_spvtr_local_port * When tport = 0: local port number (Not supported from/to CPU). * When tport = 1: tunnel port. * Access: Index
*/
MLXSW_ITEM32_LP(reg, spvtr, 0x00, 16, 0x00, 12);
/* reg_spvtr_ippe * Ingress Port Prio Mode Update Enable. * When set, the Port Prio Mode is updated with the provided ipprio_mode field. * Reserved on Get operations. * Access: OP
*/
MLXSW_ITEM32(reg, spvtr, ippe, 0x04, 31, 1);
/* reg_spvtr_ipve * Ingress Port VID Mode Update Enable. * When set, the Ingress Port VID Mode is updated with the provided ipvid_mode * field. * Reserved on Get operations. * Access: OP
*/
MLXSW_ITEM32(reg, spvtr, ipve, 0x04, 30, 1);
/* reg_spvtr_epve * Egress Port VID Mode Update Enable. * When set, the Egress Port VID Mode is updated with the provided epvid_mode * field. * Access: OP
*/
MLXSW_ITEM32(reg, spvtr, epve, 0x04, 29, 1);
/* reg_spvtr_ipprio_mode * Ingress Port Priority Mode. * This controls the PCP and DEI of the new outer VLAN * Note: for SwitchX/-2 the DEI is not affected. * 0: use port default PCP and DEI (configured by QPDPC). * 1: use C-VLAN PCP and DEI. * Has no effect when ipvid_mode = 0. * Reserved when tport = 1. * Access: RW
*/
MLXSW_ITEM32(reg, spvtr, ipprio_mode, 0x04, 20, 4);
/* reg_spvtr_epvid_mode * Egress Port VLAN-ID Mode. * For Spectrum family, this affects the values of SPVM.e,u,pt. * Access: WO
*/
MLXSW_ITEM32(reg, spvtr, epvid_mode, 0x04, 0, 4);
/* reg_svpe_local_port * Local port number * Access: Index * * Note: CPU port is not supported (uses VLAN mode only).
*/
MLXSW_ITEM32_LP(reg, svpe, 0x00, 16, 0x00, 12);
/* reg_svpe_vp_en * Virtual port enable. * 0 - Disable, VLAN mode (VID to FID). * 1 - Enable, Virtual port mode ({Port, VID} to FID). * Access: RW
*/
MLXSW_ITEM32(reg, svpe, vp_en, 0x00, 8, 1);
/* reg_sfmr_flood_rsp * Router sub-port flooding table. * 0 - Regular flooding table. * 1 - Router sub-port flooding table. For this FID the flooding is per * router-sub-port local_port. Must not be set for a FID which is not a * router-sub-port and must be set prior to enabling the relevant RIF. * Access: RW * * Note: Reserved when legacy bridge model is used. * Reserved when CONFIG_PROFILE.flood_mode = CFF.
*/
MLXSW_ITEM32(reg, sfmr, flood_rsp, 0x08, 31, 1);
/* reg_sfmr_flood_bridge_type * Flood bridge type (see SFGC.bridge_type). * 0 - type_0. * 1 - type_1. * Access: RW * * Note: Reserved when legacy bridge model is used and when flood_rsp=1. * Reserved when CONFIG_PROFILE.flood_mode = CFF
*/
MLXSW_ITEM32(reg, sfmr, flood_bridge_type, 0x08, 28, 1);
/* reg_sfmr_fid_offset * FID offset. * Used to point into the flooding table selected by SFGC register if * the table is of type FID-Offset. Otherwise, this field is reserved. * Access: RW * * Note: Reserved when CONFIG_PROFILE.flood_mode = CFF
*/
MLXSW_ITEM32(reg, sfmr, fid_offset, 0x08, 0, 16);
/* reg_sfmr_vtfp * Valid Tunnel Flood Pointer. * If not set, then nve_tunnel_flood_ptr is reserved and considered NULL. * Access: RW * * Note: Reserved for 802.1Q FIDs.
*/
MLXSW_ITEM32(reg, sfmr, vtfp, 0x0C, 31, 1);
/* reg_sfmr_nve_tunnel_flood_ptr * Underlay Flooding and BC Pointer. * Used as a pointer to the first entry of the group based link lists of * flooding or BC entries (for NVE tunnels). * Access: RW
*/
MLXSW_ITEM32(reg, sfmr, nve_tunnel_flood_ptr, 0x0C, 0, 24);
/* reg_sfmr_vv * VNI Valid. * If not set, then vni is reserved. * Access: RW * * Note: Reserved for 802.1Q FIDs.
*/
MLXSW_ITEM32(reg, sfmr, vv, 0x10, 31, 1);
/* reg_sfmr_vni * Virtual Network Identifier. * When legacy bridge model is used, a given VNI can only be assigned to one * FID. When unified bridge model is used, it configures only the FID->VNI, * the VNI->FID is done by SVFA. * Access: RW
*/
MLXSW_ITEM32(reg, sfmr, vni, 0x10, 0, 24);
/* reg_sfmr_irif_v * Ingress RIF valid. * 0 - Ingress RIF is not valid, no ingress RIF assigned. * 1 - Ingress RIF valid. * Must not be set for a non valid RIF. * Access: RW * * Note: Reserved when legacy bridge model is used.
*/
MLXSW_ITEM32(reg, sfmr, irif_v, 0x14, 24, 1);
/* reg_sfmr_irif * Ingress RIF (Router Interface). * Range is 0..cap_max_router_interfaces-1. * Access: RW * * Note: Reserved when legacy bridge model is used and when irif_v=0.
*/
MLXSW_ITEM32(reg, sfmr, irif, 0x14, 0, 16);
/* reg_sfmr_cff_mid_base * Pointer to PGT table. * Range: 0..(cap_max_pgt-1) * Access: RW * * Note: Reserved when SwitchX/-2 and Spectrum-1. * Supported when CONFIG_PROFILE.flood_mode = CFF.
*/
MLXSW_ITEM32(reg, sfmr, cff_mid_base, 0x20, 0, 16);
/* reg_sfmr_nve_flood_prf_id * FID flooding profile_id for NVE Encap * Range 0..(max_cap_nve_flood_prf-1) * Access: RW * * Note: Reserved when SwitchX/-2 and Spectrum-1
*/
MLXSW_ITEM32(reg, sfmr, nve_flood_prf_id, 0x24, 8, 2);
/* reg_sfmr_cff_prf_id * Compressed Fid Flooding profile_id * Range 0..(max_cap_nve_flood_prf-1) * Access: RW * * Note: Reserved when SwitchX/-2 and Spectrum-1 * Supported only when CONFIG_PROFLE.flood_mode = CFF.
*/
MLXSW_ITEM32(reg, sfmr, cff_prf_id, 0x24, 0, 2);
/* reg_sfmr_smpe_valid * SMPE is valid. * Access: RW * * Note: Reserved when legacy bridge model is used, when flood_rsp=1 and on * Spectrum-1.
*/
MLXSW_ITEM32(reg, sfmr, smpe_valid, 0x28, 20, 1);
/* reg_sfmr_smpe * Switch multicast port to egress VID. * Range is 0..cap_max_rmpe-1 * Access: RW * * Note: Reserved when legacy bridge model is used, when flood_rsp=1 and on * Spectrum-1.
*/
MLXSW_ITEM32(reg, sfmr, smpe, 0x28, 0, 16);
/* reg_spvmlr_local_port * Local ingress port. * Access: Index * * Note: CPU port is not supported.
*/
MLXSW_ITEM32_LP(reg, spvmlr, 0x00, 16, 0x00, 12);
/* reg_spvmlr_num_rec * Number of records to update. * Access: OP
*/
MLXSW_ITEM32(reg, spvmlr, num_rec, 0x00, 0, 8);
/* reg_spvmlr_rec_vid * VLAN ID to be added/removed from port or for querying. * Access: Index
*/
MLXSW_ITEM32_INDEXED(reg, spvmlr, rec_vid, MLXSW_REG_SPVMLR_BASE_LEN, 0, 12,
MLXSW_REG_SPVMLR_REC_LEN, 0x00, false);
for (i = 0; i < num_rec; i++) {
mlxsw_reg_spvmlr_rec_learn_enable_set(payload, i, learn_enable);
mlxsw_reg_spvmlr_rec_vid_set(payload, i, vid_begin + i);
}
}
/* SPFSR - Switch Port FDB Security Register * ----------------------------------------- * Configures the security mode per port.
*/ #define MLXSW_REG_SPFSR_ID 0x2023 #define MLXSW_REG_SPFSR_LEN 0x08
/* SPVC - Switch Port VLAN Classification Register * ----------------------------------------------- * Configures the port to identify packets as untagged / single tagged / * double packets based on the packet EtherTypes. * Ethertype IDs are configured by SVER.
*/ #define MLXSW_REG_SPVC_ID 0x2026 #define MLXSW_REG_SPVC_LEN 0x0C
/* reg_spvc_local_port * Local port. * Access: Index * * Note: applies both to Rx port and Tx port, so if a packet traverses * through Rx port i and a Tx port j then port i and port j must have the * same configuration.
*/
MLXSW_ITEM32_LP(reg, spvc, 0x00, 16, 0x00, 12);
/* reg_spvc_inner_et2 * Vlan Tag1 EtherType2 enable. * Packet is initially classified as double VLAN Tag if in addition to * being classified with a tag0 VLAN Tag its tag1 EtherType value is * equal to ether_type2. * 0: disable (default) * 1: enable * Access: RW
*/
MLXSW_ITEM32(reg, spvc, inner_et2, 0x08, 17, 1);
/* reg_spvc_et2 * Vlan Tag0 EtherType2 enable. * Packet is initially classified as VLAN Tag if its tag0 EtherType is * equal to ether_type2. * 0: disable (default) * 1: enable * Access: RW
*/
MLXSW_ITEM32(reg, spvc, et2, 0x08, 16, 1);
/* reg_spvc_inner_et1 * Vlan Tag1 EtherType1 enable. * Packet is initially classified as double VLAN Tag if in addition to * being classified with a tag0 VLAN Tag its tag1 EtherType value is * equal to ether_type1. * 0: disable * 1: enable (default) * Access: RW
*/
MLXSW_ITEM32(reg, spvc, inner_et1, 0x08, 9, 1);
/* reg_spvc_et1 * Vlan Tag0 EtherType1 enable. * Packet is initially classified as VLAN Tag if its tag0 EtherType is * equal to ether_type1. * 0: disable * 1: enable (default) * Access: RW
*/
MLXSW_ITEM32(reg, spvc, et1, 0x08, 8, 1);
/* reg_inner_et0 * Vlan Tag1 EtherType0 enable. * Packet is initially classified as double VLAN Tag if in addition to * being classified with a tag0 VLAN Tag its tag1 EtherType value is * equal to ether_type0. * 0: disable * 1: enable (default) * Access: RW
*/
MLXSW_ITEM32(reg, spvc, inner_et0, 0x08, 1, 1);
/* reg_et0 * Vlan Tag0 EtherType0 enable. * Packet is initially classified as VLAN Tag if its tag0 EtherType is * equal to ether_type0. * 0: disable * 1: enable (default) * Access: RW
*/
MLXSW_ITEM32(reg, spvc, et0, 0x08, 0, 1);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.