Lines Matching refs:dev

12 static bool mlx5_crdump_enabled(struct mlx5_core_dev *dev)  in mlx5_crdump_enabled()  argument
14 return !!dev->priv.health.crdump_size; in mlx5_crdump_enabled()
17 static int mlx5_crdump_fill(struct mlx5_core_dev *dev, u32 *cr_data) in mlx5_crdump_fill() argument
19 u32 crdump_size = dev->priv.health.crdump_size; in mlx5_crdump_fill()
25 ret = mlx5_vsc_gw_read_block_fast(dev, cr_data, crdump_size); in mlx5_crdump_fill()
33 mlx5_core_warn(dev, "failed to read full dump, read %d out of %u\n", in mlx5_crdump_fill()
41 int mlx5_crdump_collect(struct mlx5_core_dev *dev, u32 *cr_data) in mlx5_crdump_collect() argument
45 if (!mlx5_crdump_enabled(dev)) in mlx5_crdump_collect()
48 ret = mlx5_vsc_gw_lock(dev); in mlx5_crdump_collect()
50 mlx5_core_warn(dev, "crdump: failed to lock vsc gw err %d\n", in mlx5_crdump_collect()
55 ret = mlx5_vsc_sem_set_space(dev, MLX5_SEMAPHORE_SW_RESET, in mlx5_crdump_collect()
58 mlx5_core_warn(dev, "Failed to lock SW reset semaphore\n"); in mlx5_crdump_collect()
62 ret = mlx5_vsc_gw_set_space(dev, MLX5_VSC_SPACE_SCAN_CRSPACE, NULL); in mlx5_crdump_collect()
66 ret = mlx5_crdump_fill(dev, cr_data); in mlx5_crdump_collect()
69 mlx5_vsc_sem_set_space(dev, MLX5_SEMAPHORE_SW_RESET, MLX5_VSC_UNLOCK); in mlx5_crdump_collect()
71 mlx5_vsc_gw_unlock(dev); in mlx5_crdump_collect()
75 int mlx5_crdump_enable(struct mlx5_core_dev *dev) in mlx5_crdump_enable() argument
77 struct mlx5_priv *priv = &dev->priv; in mlx5_crdump_enable()
81 if (!mlx5_core_is_pf(dev) || !mlx5_vsc_accessible(dev) || in mlx5_crdump_enable()
82 mlx5_crdump_enabled(dev)) in mlx5_crdump_enable()
85 ret = mlx5_vsc_gw_lock(dev); in mlx5_crdump_enable()
90 ret = mlx5_vsc_gw_set_space(dev, MLX5_VSC_SPACE_SCAN_CRSPACE, in mlx5_crdump_enable()
94 mlx5_vsc_gw_unlock(dev); in mlx5_crdump_enable()
99 mlx5_core_warn(dev, "Invalid Crspace size, zero\n"); in mlx5_crdump_enable()
100 mlx5_vsc_gw_unlock(dev); in mlx5_crdump_enable()
104 ret = mlx5_vsc_gw_unlock(dev); in mlx5_crdump_enable()
112 void mlx5_crdump_disable(struct mlx5_core_dev *dev) in mlx5_crdump_disable() argument
114 dev->priv.health.crdump_size = 0; in mlx5_crdump_disable()