|
@@ -99,6 +99,55 @@ static const struct mlxsw_reg_info mlxsw_reg_spad = {
|
|
*/
|
|
*/
|
|
MLXSW_ITEM_BUF(reg, spad, base_mac, 0x02, 6);
|
|
MLXSW_ITEM_BUF(reg, spad, base_mac, 0x02, 6);
|
|
|
|
|
|
|
|
+/* SMID - Switch Multicast ID
|
|
|
|
+ * --------------------------
|
|
|
|
+ * The MID record maps from a MID (Multicast ID), which is a unique identifier
|
|
|
|
+ * of the multicast group within the stacking domain, into a list of local
|
|
|
|
+ * ports into which the packet is replicated.
|
|
|
|
+ */
|
|
|
|
+#define MLXSW_REG_SMID_ID 0x2007
|
|
|
|
+#define MLXSW_REG_SMID_LEN 0x240
|
|
|
|
+
|
|
|
|
+static const struct mlxsw_reg_info mlxsw_reg_smid = {
|
|
|
|
+ .id = MLXSW_REG_SMID_ID,
|
|
|
|
+ .len = MLXSW_REG_SMID_LEN,
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+/* reg_smid_swid
|
|
|
|
+ * Switch partition ID.
|
|
|
|
+ * Access: Index
|
|
|
|
+ */
|
|
|
|
+MLXSW_ITEM32(reg, smid, swid, 0x00, 24, 8);
|
|
|
|
+
|
|
|
|
+/* reg_smid_mid
|
|
|
|
+ * Multicast identifier - global identifier that represents the multicast group
|
|
|
|
+ * across all devices.
|
|
|
|
+ * Access: Index
|
|
|
|
+ */
|
|
|
|
+MLXSW_ITEM32(reg, smid, mid, 0x00, 0, 16);
|
|
|
|
+
|
|
|
|
+/* reg_smid_port
|
|
|
|
+ * Local port memebership (1 bit per port).
|
|
|
|
+ * Access: RW
|
|
|
|
+ */
|
|
|
|
+MLXSW_ITEM_BIT_ARRAY(reg, smid, port, 0x20, 0x20, 1);
|
|
|
|
+
|
|
|
|
+/* reg_smid_port_mask
|
|
|
|
+ * Local port mask (1 bit per port).
|
|
|
|
+ * Access: W
|
|
|
|
+ */
|
|
|
|
+MLXSW_ITEM_BIT_ARRAY(reg, smid, port_mask, 0x220, 0x20, 1);
|
|
|
|
+
|
|
|
|
+static inline void mlxsw_reg_smid_pack(char *payload, u16 mid,
|
|
|
|
+ u8 port, bool set)
|
|
|
|
+{
|
|
|
|
+ MLXSW_REG_ZERO(smid, payload);
|
|
|
|
+ mlxsw_reg_smid_swid_set(payload, 0);
|
|
|
|
+ mlxsw_reg_smid_mid_set(payload, mid);
|
|
|
|
+ mlxsw_reg_smid_port_set(payload, port, set);
|
|
|
|
+ mlxsw_reg_smid_port_mask_set(payload, port, 1);
|
|
|
|
+}
|
|
|
|
+
|
|
/* SSPR - Switch System Port Record Register
|
|
/* SSPR - Switch System Port Record Register
|
|
* -----------------------------------------
|
|
* -----------------------------------------
|
|
* Configures the system port to local port mapping.
|
|
* Configures the system port to local port mapping.
|
|
@@ -287,6 +336,7 @@ MLXSW_ITEM32_INDEXED(reg, sfd, rec_swid, MLXSW_REG_SFD_BASE_LEN, 24, 8,
|
|
enum mlxsw_reg_sfd_rec_type {
|
|
enum mlxsw_reg_sfd_rec_type {
|
|
MLXSW_REG_SFD_REC_TYPE_UNICAST = 0x0,
|
|
MLXSW_REG_SFD_REC_TYPE_UNICAST = 0x0,
|
|
MLXSW_REG_SFD_REC_TYPE_UNICAST_LAG = 0x1,
|
|
MLXSW_REG_SFD_REC_TYPE_UNICAST_LAG = 0x1,
|
|
|
|
+ MLXSW_REG_SFD_REC_TYPE_MULTICAST = 0x2,
|
|
};
|
|
};
|
|
|
|
|
|
/* reg_sfd_rec_type
|
|
/* reg_sfd_rec_type
|
|
@@ -379,7 +429,6 @@ MLXSW_ITEM32_INDEXED(reg, sfd, uc_system_port, MLXSW_REG_SFD_BASE_LEN, 0, 16,
|
|
|
|
|
|
static inline void mlxsw_reg_sfd_rec_pack(char *payload, int rec_index,
|
|
static inline void mlxsw_reg_sfd_rec_pack(char *payload, int rec_index,
|
|
enum mlxsw_reg_sfd_rec_type rec_type,
|
|
enum mlxsw_reg_sfd_rec_type rec_type,
|
|
- enum mlxsw_reg_sfd_rec_policy policy,
|
|
|
|
const char *mac,
|
|
const char *mac,
|
|
enum mlxsw_reg_sfd_rec_action action)
|
|
enum mlxsw_reg_sfd_rec_action action)
|
|
{
|
|
{
|
|
@@ -389,7 +438,6 @@ static inline void mlxsw_reg_sfd_rec_pack(char *payload, int rec_index,
|
|
mlxsw_reg_sfd_num_rec_set(payload, rec_index + 1);
|
|
mlxsw_reg_sfd_num_rec_set(payload, rec_index + 1);
|
|
mlxsw_reg_sfd_rec_swid_set(payload, rec_index, 0);
|
|
mlxsw_reg_sfd_rec_swid_set(payload, rec_index, 0);
|
|
mlxsw_reg_sfd_rec_type_set(payload, rec_index, rec_type);
|
|
mlxsw_reg_sfd_rec_type_set(payload, rec_index, rec_type);
|
|
- mlxsw_reg_sfd_rec_policy_set(payload, rec_index, policy);
|
|
|
|
mlxsw_reg_sfd_rec_mac_memcpy_to(payload, rec_index, mac);
|
|
mlxsw_reg_sfd_rec_mac_memcpy_to(payload, rec_index, mac);
|
|
mlxsw_reg_sfd_rec_action_set(payload, rec_index, action);
|
|
mlxsw_reg_sfd_rec_action_set(payload, rec_index, action);
|
|
}
|
|
}
|
|
@@ -401,8 +449,8 @@ static inline void mlxsw_reg_sfd_uc_pack(char *payload, int rec_index,
|
|
u8 local_port)
|
|
u8 local_port)
|
|
{
|
|
{
|
|
mlxsw_reg_sfd_rec_pack(payload, rec_index,
|
|
mlxsw_reg_sfd_rec_pack(payload, rec_index,
|
|
- MLXSW_REG_SFD_REC_TYPE_UNICAST,
|
|
|
|
- policy, mac, action);
|
|
|
|
|
|
+ MLXSW_REG_SFD_REC_TYPE_UNICAST, mac, action);
|
|
|
|
+ mlxsw_reg_sfd_rec_policy_set(payload, rec_index, policy);
|
|
mlxsw_reg_sfd_uc_sub_port_set(payload, rec_index, 0);
|
|
mlxsw_reg_sfd_uc_sub_port_set(payload, rec_index, 0);
|
|
mlxsw_reg_sfd_uc_fid_vid_set(payload, rec_index, fid_vid);
|
|
mlxsw_reg_sfd_uc_fid_vid_set(payload, rec_index, fid_vid);
|
|
mlxsw_reg_sfd_uc_system_port_set(payload, rec_index, local_port);
|
|
mlxsw_reg_sfd_uc_system_port_set(payload, rec_index, local_port);
|
|
@@ -461,7 +509,8 @@ mlxsw_reg_sfd_uc_lag_pack(char *payload, int rec_index,
|
|
{
|
|
{
|
|
mlxsw_reg_sfd_rec_pack(payload, rec_index,
|
|
mlxsw_reg_sfd_rec_pack(payload, rec_index,
|
|
MLXSW_REG_SFD_REC_TYPE_UNICAST_LAG,
|
|
MLXSW_REG_SFD_REC_TYPE_UNICAST_LAG,
|
|
- policy, mac, action);
|
|
|
|
|
|
+ mac, action);
|
|
|
|
+ mlxsw_reg_sfd_rec_policy_set(payload, rec_index, policy);
|
|
mlxsw_reg_sfd_uc_lag_sub_port_set(payload, rec_index, 0);
|
|
mlxsw_reg_sfd_uc_lag_sub_port_set(payload, rec_index, 0);
|
|
mlxsw_reg_sfd_uc_lag_fid_vid_set(payload, rec_index, fid_vid);
|
|
mlxsw_reg_sfd_uc_lag_fid_vid_set(payload, rec_index, fid_vid);
|
|
mlxsw_reg_sfd_uc_lag_lag_vid_set(payload, rec_index, lag_vid);
|
|
mlxsw_reg_sfd_uc_lag_lag_vid_set(payload, rec_index, lag_vid);
|
|
@@ -477,6 +526,45 @@ static inline void mlxsw_reg_sfd_uc_lag_unpack(char *payload, int rec_index,
|
|
*p_lag_id = mlxsw_reg_sfd_uc_lag_lag_id_get(payload, rec_index);
|
|
*p_lag_id = mlxsw_reg_sfd_uc_lag_lag_id_get(payload, rec_index);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/* 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);
|
|
|
|
+
|
|
|
|
+static inline void
|
|
|
|
+mlxsw_reg_sfd_mc_pack(char *payload, int rec_index,
|
|
|
|
+ const char *mac, u16 fid_vid,
|
|
|
|
+ enum mlxsw_reg_sfd_rec_action action, u16 mid)
|
|
|
|
+{
|
|
|
|
+ mlxsw_reg_sfd_rec_pack(payload, rec_index,
|
|
|
|
+ MLXSW_REG_SFD_REC_TYPE_MULTICAST, mac, action);
|
|
|
|
+ mlxsw_reg_sfd_mc_pgi_set(payload, rec_index, 0x1FFF);
|
|
|
|
+ mlxsw_reg_sfd_mc_fid_vid_set(payload, rec_index, fid_vid);
|
|
|
|
+ mlxsw_reg_sfd_mc_mid_set(payload, rec_index, mid);
|
|
|
|
+}
|
|
|
|
+
|
|
/* SFN - Switch FDB Notification Register
|
|
/* SFN - Switch FDB Notification Register
|
|
* -------------------------------------------
|
|
* -------------------------------------------
|
|
* The switch provides notifications on newly learned FDB entries and
|
|
* The switch provides notifications on newly learned FDB entries and
|
|
@@ -3013,6 +3101,8 @@ static inline const char *mlxsw_reg_id_str(u16 reg_id)
|
|
return "SGCR";
|
|
return "SGCR";
|
|
case MLXSW_REG_SPAD_ID:
|
|
case MLXSW_REG_SPAD_ID:
|
|
return "SPAD";
|
|
return "SPAD";
|
|
|
|
+ case MLXSW_REG_SMID_ID:
|
|
|
|
+ return "SMID";
|
|
case MLXSW_REG_SSPR_ID:
|
|
case MLXSW_REG_SSPR_ID:
|
|
return "SSPR";
|
|
return "SSPR";
|
|
case MLXSW_REG_SFDAT_ID:
|
|
case MLXSW_REG_SFDAT_ID:
|