Commit eebea464 authored by Leon Romanovsky's avatar Leon Romanovsky
Browse files

RDMA/mlx5: Save 4 bytes in CQ structure

There is no need to maintain separate, nearly empty create_flags and
private_flags fields. Unifying them reduces memory usage.

Link: https://patch.msgid.link/20260213-refactor-umem-v1-10-f3be85847922@nvidia.com


Signed-off-by: default avatarLeon Romanovsky <leonro@nvidia.com>
parent 66011c1b
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -983,7 +983,8 @@ int mlx5_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
	spin_lock_init(&cq->lock);
	cq->resize_buf = NULL;
	cq->resize_umem = NULL;
	cq->create_flags = attr->flags;
	if (attr->flags & IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION)
		cq->private_flags |= MLX5_IB_CQ_PR_TIMESTAMP_COMPLETION;
	INIT_LIST_HEAD(&cq->list_send_qp);
	INIT_LIST_HEAD(&cq->list_recv_qp);

@@ -1017,7 +1018,7 @@ int mlx5_ib_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr,
	MLX5_SET(cqc, cqc, uar_page, index);
	MLX5_SET(cqc, cqc, c_eqn_or_apu_element, eqn);
	MLX5_SET64(cqc, cqc, dbr_addr, cq->db.dma);
	if (cq->create_flags & IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN)
	if (attr->flags & IB_UVERBS_CQ_FLAGS_IGNORE_OVERRUN)
		MLX5_SET(cqc, cqc, oi, 1);

	if (udata) {
+1 −1
Original line number Diff line number Diff line
@@ -561,6 +561,7 @@ struct mlx5_ib_cq_buf {
enum mlx5_ib_cq_pr_flags {
	MLX5_IB_CQ_PR_FLAGS_CQE_128_PAD	= 1 << 0,
	MLX5_IB_CQ_PR_FLAGS_REAL_TIME_TS = 1 << 1,
	MLX5_IB_CQ_PR_TIMESTAMP_COMPLETION = 1 << 2,
};

struct mlx5_ib_cq {
@@ -581,7 +582,6 @@ struct mlx5_ib_cq {
	int			cqe_size;
	struct list_head	list_send_qp;
	struct list_head	list_recv_qp;
	u32			create_flags;
	struct list_head	wc_list;
	enum ib_cq_notify_flags notify_flags;
	struct work_struct	notify_work;
+1 −1
Original line number Diff line number Diff line
@@ -1273,7 +1273,7 @@ static int get_ts_format(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
		}
		return MLX5_TIMESTAMP_FORMAT_REAL_TIME;
	}
	if (cq->create_flags & IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION) {
	if (cq->private_flags & MLX5_IB_CQ_PR_TIMESTAMP_COMPLETION) {
		if (!fr_sup) {
			mlx5_ib_dbg(dev,
				    "Free running TS format is not supported\n");