summaryrefslogtreecommitdiffstats
path: root/include/linux/mlx5/eq.h
diff options
context:
space:
mode:
authorSaeed Mahameed2018-11-19 19:52:41 +0100
committerLeon Romanovsky2018-11-20 19:07:33 +0100
commitd5d284b829a6eb7127df24d1bd3896a698981e62 (patch)
treebdd05210c3d1b5633e416cee882d3d2455d8568a /include/linux/mlx5/eq.h
parentnet/mlx5: EQ, Generic EQ (diff)
downloadkernel-qcow2-linux-d5d284b829a6eb7127df24d1bd3896a698981e62.tar.gz
kernel-qcow2-linux-d5d284b829a6eb7127df24d1bd3896a698981e62.tar.xz
kernel-qcow2-linux-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.h21
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 */