Skip to content

Commit e16064c

Browse files
committed
Merge branch 'mlxsw-CFF-flood-mode'
Petr Machata says: ==================== mlxsw: CFF flood mode: NVE underlay configuration Recently, support for CFF flood mode (for Compressed FID Flooding) was added to the mlxsw driver. The most recent patchset has a detailed coverage of what CFF is and what has changed and how: https://lore.kernel.org/netdev/[email protected]/ In CFF flood mode, each FID allocates a handful (in our implementation two or three) consecutive PGT entries. One entry holds the flood vector for unknown-UC traffic, one for MC, one for BC. To determine how to look up flood vectors, the CFF flood mode uses a concept of flood profiles, which are IDs that reference mappings from traffic types to offsets. In the case of CFF flood mode, the offset in question is applied to the PGT address configured at a FID. The same mechanism is used by NVE underlay for flooding. Again the profile ID and the traffic type determine the offset to apply, this time to KVD address used to look up flooding entries. Since mlxsw configures NVE underlay flood the same regardless of traffic type, only one offset was ever needed: the zero, which is the default, and thus no explicit configuration was needed. Now that CFF uses profiles as well, it would be better to configure the profile used by NVE explicitly, to make the configuration visible in the source code. In this patchset, add the register support (in patch #1), add a new traffic type to refer to "any traffic at all" (in patch #2) and finally configure the NVE profile explicitly for FIDs (in patch #3). So far, the implicitly configured flood profile was the ID 0. With this patchset, it changes to 3, leaving the 0 free to allow us to spot missed configuration. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 523e1f5 + 6dab408 commit e16064c

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

drivers/net/ethernet/mellanox/mlxsw/reg.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,15 @@ MLXSW_ITEM32(reg, sfmr, irif, 0x14, 0, 16);
19541954
*/
19551955
MLXSW_ITEM32(reg, sfmr, cff_mid_base, 0x20, 0, 16);
19561956

1957+
/* reg_sfmr_nve_flood_prf_id
1958+
* FID flooding profile_id for NVE Encap
1959+
* Range 0..(max_cap_nve_flood_prf-1)
1960+
* Access: RW
1961+
*
1962+
* Note: Reserved when SwitchX/-2 and Spectrum-1
1963+
*/
1964+
MLXSW_ITEM32(reg, sfmr, nve_flood_prf_id, 0x24, 8, 2);
1965+
19571966
/* reg_sfmr_cff_prf_id
19581967
* Compressed Fid Flooding profile_id
19591968
* Range 0..(max_cap_nve_flood_prf-1)

drivers/net/ethernet/mellanox/mlxsw/spectrum.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ enum mlxsw_sp_flood_type {
515515
MLXSW_SP_FLOOD_TYPE_MC,
516516
/* For RSP FIDs in CFF mode. */
517517
MLXSW_SP_FLOOD_TYPE_NOT_UC,
518+
/* For NVE traffic. */
519+
MLXSW_SP_FLOOD_TYPE_ANY,
518520
};
519521

520522
int mlxsw_sp_port_get_stats_raw(struct net_device *dev, int grp,

drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ struct mlxsw_sp_fid_ops {
117117
enum mlxsw_sp_fid_flood_profile_id {
118118
MLXSW_SP_FID_FLOOD_PROFILE_ID_BRIDGE = 1,
119119
MLXSW_SP_FID_FLOOD_PROFILE_ID_RSP,
120+
MLXSW_SP_FID_FLOOD_PROFILE_ID_NVE,
120121
};
121122

122123
struct mlxsw_sp_fid_flood_profile {
@@ -167,11 +168,22 @@ static const int mlxsw_sp_sfgc_not_uc_packet_types[MLXSW_REG_SFGC_TYPE_MAX] = {
167168
[MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_IPV4] = 1,
168169
};
169170

171+
static const int mlxsw_sp_sfgc_any_packet_types[MLXSW_REG_SFGC_TYPE_MAX] = {
172+
[MLXSW_REG_SFGC_TYPE_UNKNOWN_UNICAST] = 1,
173+
[MLXSW_REG_SFGC_TYPE_BROADCAST] = 1,
174+
[MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_NON_IP] = 1,
175+
[MLXSW_REG_SFGC_TYPE_IPV4_LINK_LOCAL] = 1,
176+
[MLXSW_REG_SFGC_TYPE_IPV6_ALL_HOST] = 1,
177+
[MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_IPV6] = 1,
178+
[MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_IPV4] = 1,
179+
};
180+
170181
static const int *mlxsw_sp_packet_type_sfgc_types[] = {
171182
[MLXSW_SP_FLOOD_TYPE_UC] = mlxsw_sp_sfgc_uc_packet_types,
172183
[MLXSW_SP_FLOOD_TYPE_BC] = mlxsw_sp_sfgc_bc_packet_types,
173184
[MLXSW_SP_FLOOD_TYPE_MC] = mlxsw_sp_sfgc_mc_packet_types,
174185
[MLXSW_SP_FLOOD_TYPE_NOT_UC] = mlxsw_sp_sfgc_not_uc_packet_types,
186+
[MLXSW_SP_FLOOD_TYPE_ANY] = mlxsw_sp_sfgc_any_packet_types,
175187
};
176188

177189
struct mlxsw_sp_fid *mlxsw_sp_fid_lookup_by_index(struct mlxsw_sp *mlxsw_sp,
@@ -549,6 +561,8 @@ static void mlxsw_sp_fid_fid_pack_cff(char *sfmr_pl,
549561
mlxsw_reg_sfmr_cff_mid_base_set(sfmr_pl, pgt_base);
550562
mlxsw_reg_sfmr_cff_prf_id_set(sfmr_pl,
551563
fid_family->flood_profile->profile_id);
564+
mlxsw_reg_sfmr_nve_flood_prf_id_set(sfmr_pl,
565+
MLXSW_SP_FID_FLOOD_PROFILE_ID_NVE);
552566
}
553567

554568
static u16 mlxsw_sp_fid_rfid_fid_offset_cff(struct mlxsw_sp *mlxsw_sp,
@@ -1310,6 +1324,20 @@ struct mlxsw_sp_fid_flood_profile mlxsw_sp_fid_rsp_flood_profile_cff = {
13101324
.profile_id = MLXSW_SP_FID_FLOOD_PROFILE_ID_RSP,
13111325
};
13121326

1327+
static const struct mlxsw_sp_flood_table mlxsw_sp_fid_nve_flood_tables_cff[] = {
1328+
{
1329+
.packet_type = MLXSW_SP_FLOOD_TYPE_ANY,
1330+
.table_index = 0,
1331+
},
1332+
};
1333+
1334+
static const
1335+
struct mlxsw_sp_fid_flood_profile mlxsw_sp_fid_nve_flood_profile_cff = {
1336+
.flood_tables = mlxsw_sp_fid_nve_flood_tables_cff,
1337+
.nr_flood_tables = ARRAY_SIZE(mlxsw_sp_fid_nve_flood_tables_cff),
1338+
.profile_id = MLXSW_SP_FID_FLOOD_PROFILE_ID_NVE,
1339+
};
1340+
13131341
static bool
13141342
mlxsw_sp_fid_8021q_compare(const struct mlxsw_sp_fid *fid, const void *arg)
13151343
{
@@ -2411,6 +2439,7 @@ static const
24112439
struct mlxsw_sp_fid_flood_profile *mlxsw_sp_fid_flood_profiles[] = {
24122440
&mlxsw_sp_fid_8021d_flood_profile,
24132441
&mlxsw_sp_fid_rsp_flood_profile_cff,
2442+
&mlxsw_sp_fid_nve_flood_profile_cff,
24142443
};
24152444

24162445
static int

0 commit comments

Comments
 (0)