* [PATCH net-next 1/3] mlxsw: reg: Add nve_flood_prf_id field to SFMR
2023-12-14 13:19 [PATCH net-next 0/3] mlxsw: CFF flood mode: NVE underlay configuration Petr Machata
@ 2023-12-14 13:19 ` Petr Machata
2023-12-14 13:19 ` [PATCH net-next 2/3] mlxsw: spectrum_fid: Add an "any" packet type Petr Machata
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Petr Machata @ 2023-12-14 13:19 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
Cc: Ido Schimmel, Petr Machata, Amit Cohen, mlxsw
The field is used for setting a flood profile for lookup of KVD entry for
NVE underlay. As the other uses of flood profile, this references a traffic
type-to-offset mapping, except here it is not applied to PGT offsets, but
KVD offsets.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
drivers/net/ethernet/mellanox/mlxsw/reg.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index 3aae4467e431..8892654c685f 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -1954,6 +1954,15 @@ MLXSW_ITEM32(reg, sfmr, irif, 0x14, 0, 16);
*/
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)
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net-next 2/3] mlxsw: spectrum_fid: Add an "any" packet type
2023-12-14 13:19 [PATCH net-next 0/3] mlxsw: CFF flood mode: NVE underlay configuration Petr Machata
2023-12-14 13:19 ` [PATCH net-next 1/3] mlxsw: reg: Add nve_flood_prf_id field to SFMR Petr Machata
@ 2023-12-14 13:19 ` Petr Machata
2023-12-14 13:19 ` [PATCH net-next 3/3] mlxsw: spectrum_fid: Set NVE flood profile as part of FID configuration Petr Machata
2023-12-15 11:00 ` [PATCH net-next 0/3] mlxsw: CFF flood mode: NVE underlay configuration patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Petr Machata @ 2023-12-14 13:19 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
Cc: Ido Schimmel, Petr Machata, Amit Cohen, mlxsw
Flood profiles have been used prior to CFF support for NVE underlay. Like
is the case with FID flooding, an NVE profile describes at which offset a
datum is located given traffic type. mlxsw currently only ever uses one KVD
entry for NVE lookup, i.e. regardless of traffic type, the offset is always
zero. To be able to describe this, add a traffic type enumerator describing
"any traffic type".
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
drivers/net/ethernet/mellanox/mlxsw/spectrum.h | 2 ++
drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c | 11 +++++++++++
2 files changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index 61612c413310..a0c9775fa955 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -515,6 +515,8 @@ enum mlxsw_sp_flood_type {
MLXSW_SP_FLOOD_TYPE_MC,
/* For RSP FIDs in CFF mode. */
MLXSW_SP_FLOOD_TYPE_NOT_UC,
+ /* For NVE traffic. */
+ MLXSW_SP_FLOOD_TYPE_ANY,
};
int mlxsw_sp_port_get_stats_raw(struct net_device *dev, int grp,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c
index 401117086235..379a911f463f 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c
@@ -167,11 +167,22 @@ static const int mlxsw_sp_sfgc_not_uc_packet_types[MLXSW_REG_SFGC_TYPE_MAX] = {
[MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_IPV4] = 1,
};
+static const int mlxsw_sp_sfgc_any_packet_types[MLXSW_REG_SFGC_TYPE_MAX] = {
+ [MLXSW_REG_SFGC_TYPE_UNKNOWN_UNICAST] = 1,
+ [MLXSW_REG_SFGC_TYPE_BROADCAST] = 1,
+ [MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_NON_IP] = 1,
+ [MLXSW_REG_SFGC_TYPE_IPV4_LINK_LOCAL] = 1,
+ [MLXSW_REG_SFGC_TYPE_IPV6_ALL_HOST] = 1,
+ [MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_IPV6] = 1,
+ [MLXSW_REG_SFGC_TYPE_UNREGISTERED_MULTICAST_IPV4] = 1,
+};
+
static const int *mlxsw_sp_packet_type_sfgc_types[] = {
[MLXSW_SP_FLOOD_TYPE_UC] = mlxsw_sp_sfgc_uc_packet_types,
[MLXSW_SP_FLOOD_TYPE_BC] = mlxsw_sp_sfgc_bc_packet_types,
[MLXSW_SP_FLOOD_TYPE_MC] = mlxsw_sp_sfgc_mc_packet_types,
[MLXSW_SP_FLOOD_TYPE_NOT_UC] = mlxsw_sp_sfgc_not_uc_packet_types,
+ [MLXSW_SP_FLOOD_TYPE_ANY] = mlxsw_sp_sfgc_any_packet_types,
};
struct mlxsw_sp_fid *mlxsw_sp_fid_lookup_by_index(struct mlxsw_sp *mlxsw_sp,
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* [PATCH net-next 3/3] mlxsw: spectrum_fid: Set NVE flood profile as part of FID configuration
2023-12-14 13:19 [PATCH net-next 0/3] mlxsw: CFF flood mode: NVE underlay configuration Petr Machata
2023-12-14 13:19 ` [PATCH net-next 1/3] mlxsw: reg: Add nve_flood_prf_id field to SFMR Petr Machata
2023-12-14 13:19 ` [PATCH net-next 2/3] mlxsw: spectrum_fid: Add an "any" packet type Petr Machata
@ 2023-12-14 13:19 ` Petr Machata
2023-12-15 11:00 ` [PATCH net-next 0/3] mlxsw: CFF flood mode: NVE underlay configuration patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: Petr Machata @ 2023-12-14 13:19 UTC (permalink / raw)
To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev
Cc: Ido Schimmel, Petr Machata, Amit Cohen, mlxsw
The NVE flood profile is used for determining of offset applied to KVD
address for NVE flood. We currently do not set it, leaving it at the
default value of 0. That is not an issue: all the traffic-type-to-offset
mappings (as configured by SFFP) default to offset of 0. This is what we
need anyway, as mlxsw only allocates a single KVD entry for NVE underlay.
The field is only relevant on Spectrum-2 and above. So to be fully
consistent, we should split the existing controlled ops to Spectrum-1 and
Spectrum>1 variants, with only the latter setting the field. But that seems
like a lot of overhead for a single field whose meaning is "everything is
the default". So instead pretend that the NVE flood profile does not exist
in the controlled flood mode, like we have so far, and only set it when
flood mode is CFF.
Setting this at all serves dual purpose. First, it is now clear which
profile belongs to NVE, because in the CFF mode, we have multiple users.
This should prevent bugs in flood profile management. Second, using
specifically non-zero value means there will be no valid uses of the
profile 0, which we can therefore use as a sentinel.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
.../net/ethernet/mellanox/mlxsw/spectrum_fid.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c
index 379a911f463f..65562ab208b3 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_fid.c
@@ -117,6 +117,7 @@ struct mlxsw_sp_fid_ops {
enum mlxsw_sp_fid_flood_profile_id {
MLXSW_SP_FID_FLOOD_PROFILE_ID_BRIDGE = 1,
MLXSW_SP_FID_FLOOD_PROFILE_ID_RSP,
+ MLXSW_SP_FID_FLOOD_PROFILE_ID_NVE,
};
struct mlxsw_sp_fid_flood_profile {
@@ -560,6 +561,8 @@ static void mlxsw_sp_fid_fid_pack_cff(char *sfmr_pl,
mlxsw_reg_sfmr_cff_mid_base_set(sfmr_pl, pgt_base);
mlxsw_reg_sfmr_cff_prf_id_set(sfmr_pl,
fid_family->flood_profile->profile_id);
+ mlxsw_reg_sfmr_nve_flood_prf_id_set(sfmr_pl,
+ MLXSW_SP_FID_FLOOD_PROFILE_ID_NVE);
}
static u16 mlxsw_sp_fid_rfid_fid_offset_cff(struct mlxsw_sp *mlxsw_sp,
@@ -1321,6 +1324,20 @@ struct mlxsw_sp_fid_flood_profile mlxsw_sp_fid_rsp_flood_profile_cff = {
.profile_id = MLXSW_SP_FID_FLOOD_PROFILE_ID_RSP,
};
+static const struct mlxsw_sp_flood_table mlxsw_sp_fid_nve_flood_tables_cff[] = {
+ {
+ .packet_type = MLXSW_SP_FLOOD_TYPE_ANY,
+ .table_index = 0,
+ },
+};
+
+static const
+struct mlxsw_sp_fid_flood_profile mlxsw_sp_fid_nve_flood_profile_cff = {
+ .flood_tables = mlxsw_sp_fid_nve_flood_tables_cff,
+ .nr_flood_tables = ARRAY_SIZE(mlxsw_sp_fid_nve_flood_tables_cff),
+ .profile_id = MLXSW_SP_FID_FLOOD_PROFILE_ID_NVE,
+};
+
static bool
mlxsw_sp_fid_8021q_compare(const struct mlxsw_sp_fid *fid, const void *arg)
{
@@ -2422,6 +2439,7 @@ static const
struct mlxsw_sp_fid_flood_profile *mlxsw_sp_fid_flood_profiles[] = {
&mlxsw_sp_fid_8021d_flood_profile,
&mlxsw_sp_fid_rsp_flood_profile_cff,
+ &mlxsw_sp_fid_nve_flood_profile_cff,
};
static int
--
2.41.0
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH net-next 0/3] mlxsw: CFF flood mode: NVE underlay configuration
2023-12-14 13:19 [PATCH net-next 0/3] mlxsw: CFF flood mode: NVE underlay configuration Petr Machata
` (2 preceding siblings ...)
2023-12-14 13:19 ` [PATCH net-next 3/3] mlxsw: spectrum_fid: Set NVE flood profile as part of FID configuration Petr Machata
@ 2023-12-15 11:00 ` patchwork-bot+netdevbpf
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-12-15 11:00 UTC (permalink / raw)
To: Petr Machata
Cc: davem, edumazet, kuba, pabeni, netdev, idosch, amcohen, mlxsw
Hello:
This series was applied to netdev/net-next.git (main)
by David S. Miller <davem@davemloft.net>:
On Thu, 14 Dec 2023 14:19:04 +0100 you wrote:
> 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/cover.1701183891.git.petrm@nvidia.com/
>
> 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.
>
> [...]
Here is the summary with links:
- [net-next,1/3] mlxsw: reg: Add nve_flood_prf_id field to SFMR
https://git.kernel.org/netdev/net-next/c/d9d441e8e89d
- [net-next,2/3] mlxsw: spectrum_fid: Add an "any" packet type
https://git.kernel.org/netdev/net-next/c/b2f5eb5a6509
- [net-next,3/3] mlxsw: spectrum_fid: Set NVE flood profile as part of FID configuration
https://git.kernel.org/netdev/net-next/c/6dab4083260b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread