]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
RDMA/mlx5: Save 4 bytes in CQ structure
authorLeon Romanovsky <leonro@nvidia.com>
Fri, 13 Feb 2026 10:57:46 +0000 (12:57 +0200)
committerLeon Romanovsky <leonro@nvidia.com>
Wed, 25 Feb 2026 13:15:30 +0000 (08:15 -0500)
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: Leon Romanovsky <leonro@nvidia.com>
drivers/infiniband/hw/mlx5/cq.c
drivers/infiniband/hw/mlx5/mlx5_ib.h
drivers/infiniband/hw/mlx5/qp.c

index d0cd3f805bcb9ec51952b405ef77cb1dbcb4904f..839958d15a83328ab19bee30200460aaa71ead3b 100644 (file)
@@ -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) {
index 4f4114d9513000e63b83554cf5903d57cc0d401d..ce3372aea48b1715f9e3ba1b5d0c2c03850d9b3b 100644 (file)
@@ -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;
index 47de8cc9937e9e70ba3e3ef3f806674db63286a8..59f9ddb35d4620737980b2bc2179e0a11e6be29f 100644 (file)
@@ -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");