/* Data Path L2-Switch API * Contains API for handling DPSW topology and functionality
*/
struct fsl_mc_io;
/* DPSW general definitions */
#define DPSW_MAX_PRIORITIES 8
#define DPSW_MAX_IF 64
int dpsw_open(struct fsl_mc_io *mc_io, u32 cmd_flags, int dpsw_id, u16 *token);
int dpsw_close(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
/* DPSW options */
/** * DPSW_OPT_FLOODING_DIS - Flooding was disabled at device create
*/ #define DPSW_OPT_FLOODING_DIS 0x0000000000000001ULL /** * DPSW_OPT_MULTICAST_DIS - Multicast was disabled at device create
*/ #define DPSW_OPT_MULTICAST_DIS 0x0000000000000004ULL /** * DPSW_OPT_CTRL_IF_DIS - Control interface support is disabled
*/ #define DPSW_OPT_CTRL_IF_DIS 0x0000000000000010ULL
/** * enum dpsw_component_type - component type of a bridge * @DPSW_COMPONENT_TYPE_C_VLAN: A C-VLAN component of an * enterprise VLAN bridge or of a Provider Bridge used * to process C-tagged frames * @DPSW_COMPONENT_TYPE_S_VLAN: An S-VLAN component of a * Provider Bridge *
*/ enum dpsw_component_type {
DPSW_COMPONENT_TYPE_C_VLAN = 0,
DPSW_COMPONENT_TYPE_S_VLAN
};
/** * enum dpsw_flooding_cfg - flooding configuration requested * @DPSW_FLOODING_PER_VLAN: Flooding replicators are allocated per VLAN and * interfaces present in each of them can be configured using * dpsw_vlan_add_if_flooding()/dpsw_vlan_remove_if_flooding(). * This is the default configuration. * * @DPSW_FLOODING_PER_FDB: Flooding replicators are allocated per FDB and * interfaces present in each of them can be configured using * dpsw_set_egress_flood().
*/ enum dpsw_flooding_cfg {
DPSW_FLOODING_PER_VLAN = 0,
DPSW_FLOODING_PER_FDB,
};
/** * enum dpsw_broadcast_cfg - broadcast configuration requested * @DPSW_BROADCAST_PER_OBJECT: There is only one broadcast replicator per DPSW * object. This is the default configuration. * @DPSW_BROADCAST_PER_FDB: Broadcast replicators are allocated per FDB and * interfaces present in each of them can be configured using * dpsw_set_egress_flood().
*/ enum dpsw_broadcast_cfg {
DPSW_BROADCAST_PER_OBJECT = 0,
DPSW_BROADCAST_PER_FDB,
};
int dpsw_enable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
int dpsw_disable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
int dpsw_reset(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token);
/** * DPSW_IRQ_EVENT_LINK_CHANGED - Indicates that the link state changed
*/ #define DPSW_IRQ_EVENT_LINK_CHANGED 0x0001
/** * DPSW_IRQ_EVENT_ENDPOINT_CHANGED - Indicates a change in endpoint
*/ #define DPSW_IRQ_EVENT_ENDPOINT_CHANGED 0x0002
/** * struct dpsw_irq_cfg - IRQ configuration * @addr: Address that must be written to signal a message-based interrupt * @val: Value to write into irq_addr address * @irq_num: A user defined number associated with this IRQ
*/ struct dpsw_irq_cfg {
u64 addr;
u32 val; int irq_num;
};
/** * struct dpsw_ctrl_if_pools_cfg - Control interface buffer pools configuration * @num_dpbp: Number of DPBPs * @pools: Array of buffer pools parameters; The number of valid entries * must match 'num_dpbp' value * @pools.dpbp_id: DPBP object ID * @pools.buffer_size: Buffer size * @pools.backup_pool: Backup pool
*/ struct dpsw_ctrl_if_pools_cfg {
u8 num_dpbp; struct { int dpbp_id;
u16 buffer_size; int backup_pool;
} pools[DPSW_MAX_DPBP];
};
/** * struct dpsw_tci_cfg - Tag Control Information (TCI) configuration * @pcp: Priority Code Point (PCP): a 3-bit field which refers * to the IEEE 802.1p priority * @dei: Drop Eligible Indicator (DEI): a 1-bit field. May be used * separately or in conjunction with PCP to indicate frames * eligible to be dropped in the presence of congestion * @vlan_id: VLAN Identifier (VID): a 12-bit field specifying the VLAN * to which the frame belongs. The hexadecimal values * of 0x000 and 0xFFF are reserved; * all other values may be used as VLAN identifiers, * allowing up to 4,094 VLANs
*/ struct dpsw_tci_cfg {
u8 pcp;
u8 dei;
u16 vlan_id;
};
int dpsw_if_enable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, u16 if_id);
int dpsw_if_disable(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token, u16 if_id);
/** * struct dpsw_if_attr - Structure representing DPSW interface attributes * @num_tcs: Number of traffic classes * @rate: Transmit rate in bits per second * @options: Interface configuration options (bitmap) * @enabled: Indicates if interface is enabled * @accept_all_vlan: The device discards/accepts incoming frames * for VLANs that do not include this interface * @admit_untagged: When set to 'DPSW_ADMIT_ONLY_VLAN_TAGGED', the device * discards untagged frames or priority-tagged frames received on * this interface; * When set to 'DPSW_ADMIT_ALL', untagged frames or priority- * tagged frames received on this interface are accepted * @qdid: control frames transmit qdid
*/ struct dpsw_if_attr {
u8 num_tcs;
u32 rate;
u32 options; int enabled; int accept_all_vlan; enum dpsw_accepted_frames admit_untagged;
u16 qdid;
};
/** * struct dpsw_vlan_if_cfg - Set of VLAN Interfaces * @num_ifs: The number of interfaces that are assigned to the egress * list for this VLAN * @if_id: The set of interfaces that are * assigned to the egress list for this VLAN * @options: Options map for this command (DPSW_VLAN_ADD_IF_OPT_FDB_ID) * @fdb_id: FDB id to be used by this VLAN on these specific interfaces * (taken into account only if the DPSW_VLAN_ADD_IF_OPT_FDB_ID is * specified in the options field)
*/ struct dpsw_vlan_if_cfg {
u16 num_ifs;
u16 options;
u16 if_id[DPSW_MAX_IF];
u16 fdb_id;
};
/** * enum dpsw_learning_mode - Auto-learning modes * @DPSW_LEARNING_MODE_DIS: Disable Auto-learning * @DPSW_LEARNING_MODE_HW: Enable HW auto-Learning * @DPSW_LEARNING_MODE_NON_SECURE: Enable None secure learning by CPU * @DPSW_LEARNING_MODE_SECURE: Enable secure learning by CPU * * NONE - SECURE LEARNING * SMAC found DMAC found CTLU Action * v v Forward frame to * 1. DMAC destination * - v Forward frame to * 1. DMAC destination * 2. Control interface * v - Forward frame to * 1. Flooding list of interfaces * - - Forward frame to * 1. Flooding list of interfaces * 2. Control interface * SECURE LEARING * SMAC found DMAC found CTLU Action * v v Forward frame to * 1. DMAC destination * - v Forward frame to * 1. Control interface * v - Forward frame to * 1. Flooding list of interfaces * - - Forward frame to * 1. Control interface
*/ enum dpsw_learning_mode {
DPSW_LEARNING_MODE_DIS = 0,
DPSW_LEARNING_MODE_HW = 1,
DPSW_LEARNING_MODE_NON_SECURE = 2,
DPSW_LEARNING_MODE_SECURE = 3
};
/** * struct dpsw_fdb_attr - FDB Attributes * @max_fdb_entries: Number of FDB entries * @fdb_ageing_time: Ageing time in seconds * @learning_mode: Learning mode * @num_fdb_mc_groups: Current number of multicast groups * @max_fdb_mc_groups: Maximum number of multicast groups
*/ struct dpsw_fdb_attr {
u16 max_fdb_entries;
u16 fdb_ageing_time; enum dpsw_learning_mode learning_mode;
u16 num_fdb_mc_groups;
u16 max_fdb_mc_groups;
};
int dpsw_get_api_version(struct fsl_mc_io *mc_io, u32 cmd_flags,
u16 *major_ver, u16 *minor_ver);
int dpsw_acl_remove(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
u16 acl_id);
/** * struct dpsw_acl_if_cfg - List of interfaces to associate with an ACL table * @num_ifs: Number of interfaces * @if_id: List of interfaces
*/ struct dpsw_acl_if_cfg {
u16 num_ifs;
u16 if_id[DPSW_MAX_IF];
};
/** * enum dpsw_acl_action - action to be run on the ACL rule match * @DPSW_ACL_ACTION_DROP: Drop frame * @DPSW_ACL_ACTION_REDIRECT: Redirect to certain port * @DPSW_ACL_ACTION_ACCEPT: Accept frame * @DPSW_ACL_ACTION_REDIRECT_TO_CTRL_IF: Redirect to control interface
*/ enum dpsw_acl_action {
DPSW_ACL_ACTION_DROP,
DPSW_ACL_ACTION_REDIRECT,
DPSW_ACL_ACTION_ACCEPT,
DPSW_ACL_ACTION_REDIRECT_TO_CTRL_IF
};
/** * struct dpsw_acl_result - ACL action * @action: Action should be taken when ACL entry hit * @if_id: Interface IDs to redirect frame. Valid only if redirect selected for * action
*/ struct dpsw_acl_result { enum dpsw_acl_action action;
u16 if_id;
};
/** * struct dpsw_acl_entry_cfg - ACL entry * @key_iova: I/O virtual address of DMA-able memory filled with key after call * to dpsw_acl_prepare_entry_cfg() * @result: Required action when entry hit occurs * @precedence: Precedence inside ACL 0 is lowest; This priority can not change * during the lifetime of a Policy. It is user responsibility to * space the priorities according to consequent rule additions.
*/ struct dpsw_acl_entry_cfg {
u64 key_iova; struct dpsw_acl_result result; int precedence;
};
/** * enum dpsw_reflection_filter - Filter type for frames to be reflected * @DPSW_REFLECTION_FILTER_INGRESS_ALL: Reflect all frames * @DPSW_REFLECTION_FILTER_INGRESS_VLAN: Reflect only frames that belong to * the particular VLAN defined by vid parameter *
*/ enum dpsw_reflection_filter {
DPSW_REFLECTION_FILTER_INGRESS_ALL = 0,
DPSW_REFLECTION_FILTER_INGRESS_VLAN = 1
};
/** * struct dpsw_reflection_cfg - Structure representing the mirroring config * @filter: Filter type for frames to be mirrored * @vlan_id: VLAN ID to mirror; valid only when the type is DPSW_INGRESS_VLAN
*/ struct dpsw_reflection_cfg { enum dpsw_reflection_filter filter;
u16 vlan_id;
};
int dpsw_set_reflection_if(struct fsl_mc_io *mc_io, u32 cmd_flags, u16 token,
u16 if_id);
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.