diff options
author | Saeed Mahameed <saeedm@mellanox.com> | 2018-11-19 10:52:41 -0800 |
---|---|---|
committer | Leon Romanovsky <leonro@mellanox.com> | 2018-11-20 20:07:33 +0200 |
commit | d5d284b829a6eb7127df24d1bd3896a698981e62 (patch) | |
tree | bdd05210c3d1b5633e416cee882d3d2455d8568a /include/linux/mlx5/eq.h | |
parent | 7701707cb94ed4d1e63ae4fa5ef62a2345ef9db7 (diff) | |
download | linux-stable-d5d284b829a6eb7127df24d1bd3896a698981e62.tar.gz linux-stable-d5d284b829a6eb7127df24d1bd3896a698981e62.tar.bz2 linux-stable-d5d284b829a6eb7127df24d1bd3896a698981e62.zip |
{net,IB}/mlx5: Move Page fault EQ and ODP logic to RDMA
Use the new generic EQ API to move all ODP RDMA data structures and logic
form mlx5 core driver into mlx5_ib driver.
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
Reviewed-by: Tariq Toukan <tariqt@mellanox.com>
Acked-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Diffstat (limited to 'include/linux/mlx5/eq.h')
-rw-r--r-- | include/linux/mlx5/eq.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/mlx5/eq.h b/include/linux/mlx5/eq.h index c733673ba5f6..71d82c5a1a02 100644 --- a/include/linux/mlx5/eq.h +++ b/include/linux/mlx5/eq.h @@ -17,6 +17,10 @@ enum { MLX5_EQ_VEC_COMP_BASE = MLX5_EQ_MAX_ASYNC_EQS, }; +#define MLX5_NUM_CMD_EQE (32) +#define MLX5_NUM_ASYNC_EQE (0x1000) +#define MLX5_NUM_SPARE_EQE (0x80) + struct mlx5_eq; struct mlx5_eq_param { @@ -36,4 +40,21 @@ mlx5_eq_destroy_generic(struct mlx5_core_dev *dev, struct mlx5_eq *eq); struct mlx5_eqe *mlx5_eq_get_eqe(struct mlx5_eq *eq, u32 cc); void mlx5_eq_update_ci(struct mlx5_eq *eq, u32 cc, bool arm); +/* The HCA will think the queue has overflowed if we + * don't tell it we've been processing events. We + * create EQs with MLX5_NUM_SPARE_EQE extra entries, + * so we must update our consumer index at + * least that often. + * + * mlx5_eq_update_cc must be called on every EQE @EQ irq handler + */ +static inline u32 mlx5_eq_update_cc(struct mlx5_eq *eq, u32 cc) +{ + if (unlikely(cc >= MLX5_NUM_SPARE_EQE)) { + mlx5_eq_update_ci(eq, cc, 0); + cc = 0; + } + return cc; +} + #endif /* MLX5_CORE_EQ_H */ |