Skip to content

Commit 7425813

Browse files
Jiri Pirkokubalewski
authored andcommitted
mlx5: Implement SyncE support using DPLL infrastructure
Implement SyncE support using newly introduced DPLL support. Make sure that each PFs/VFs/SFs probed with appropriate capability will spawn a dpll auxiliary device and register appropriate dpll device and pin instances. Signed-off-by: Jiri Pirko <jiri@nvidia.com> Signed-off-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
1 parent 0747752 commit 7425813

6 files changed

Lines changed: 520 additions & 1 deletion

File tree

drivers/net/ethernet/mellanox/mlx5/core/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,11 @@ config MLX5_SF_MANAGER
188188
port is managed through devlink. A subfunction supports RDMA, netdevice
189189
and vdpa device. It is similar to a SRIOV VF but it doesn't require
190190
SRIOV support.
191+
192+
config MLX5_DPLL
193+
tristate "Mellanox 5th generation network adapters (ConnectX series) DPLL support"
194+
depends on NETDEVICES && ETHERNET && PCI && MLX5_CORE
195+
select DPLL
196+
help
197+
DPLL support in Mellanox Technologies ConnectX NICs.
198+

drivers/net/ethernet/mellanox/mlx5/core/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,6 @@ mlx5_core-$(CONFIG_MLX5_SF) += sf/vhca_event.o sf/dev/dev.o sf/dev/driver.o irq_
124124
# SF manager
125125
#
126126
mlx5_core-$(CONFIG_MLX5_SF_MANAGER) += sf/cmd.o sf/hw_table.o sf/devlink.o
127+
128+
obj-$(CONFIG_MLX5_DPLL) += mlx5_dpll.o
129+
mlx5_dpll-y := dpll.o

drivers/net/ethernet/mellanox/mlx5/core/dev.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,19 @@ static bool is_ib_enabled(struct mlx5_core_dev *dev)
206206
return err ? false : val.vbool;
207207
}
208208

209+
static bool is_dpll_supported(struct mlx5_core_dev *dev)
210+
{
211+
if (!IS_ENABLED(CONFIG_MLX5_DPLL))
212+
return false;
213+
214+
if (!MLX5_CAP_MCAM_REG2(dev, synce_registers)) {
215+
mlx5_core_warn(dev, "Missing SyncE capability\n");
216+
return false;
217+
}
218+
219+
return true;
220+
}
221+
209222
enum {
210223
MLX5_INTERFACE_PROTOCOL_ETH,
211224
MLX5_INTERFACE_PROTOCOL_ETH_REP,
@@ -215,6 +228,8 @@ enum {
215228
MLX5_INTERFACE_PROTOCOL_MPIB,
216229

217230
MLX5_INTERFACE_PROTOCOL_VNET,
231+
232+
MLX5_INTERFACE_PROTOCOL_DPLL,
218233
};
219234

220235
static const struct mlx5_adev_device {
@@ -237,6 +252,8 @@ static const struct mlx5_adev_device {
237252
.is_supported = &is_ib_rep_supported },
238253
[MLX5_INTERFACE_PROTOCOL_MPIB] = { .suffix = "multiport",
239254
.is_supported = &is_mp_supported },
255+
[MLX5_INTERFACE_PROTOCOL_DPLL] = { .suffix = "dpll",
256+
.is_supported = &is_dpll_supported },
240257
};
241258

242259
int mlx5_adev_idx_alloc(void)

0 commit comments

Comments
 (0)