net/mlx5_core: Clear doorbell record inside mlx5_db_alloc()
authorSaeed Mahameed <saeedm@mellanox.com>
Thu, 2 Apr 2015 14:07:23 +0000 (17:07 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 2 Apr 2015 20:33:41 +0000 (16:33 -0400)
Do it in one place instead of every where the function is invoked

Signed-off-by: Achiad Shochat <achiad@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
Signed-off-by: Eli Cohen <eli@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/infiniband/hw/mlx5/cq.c
drivers/infiniband/hw/mlx5/qp.c
drivers/infiniband/hw/mlx5/srq.c
drivers/net/ethernet/mellanox/mlx5/core/alloc.c

index c463e7bba5f453f0303a74b88ec96275c796ee0f..f78249c481732505a64b9810c198995490a9362c 100644 (file)
@@ -697,8 +697,6 @@ static int create_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
 
        cq->mcq.set_ci_db  = cq->db.db;
        cq->mcq.arm_db     = cq->db.db + 1;
-       *cq->mcq.set_ci_db = 0;
-       *cq->mcq.arm_db    = 0;
        cq->mcq.cqe_sz = cqe_size;
 
        err = alloc_cq_buf(dev, &cq->buf, entries, cqe_size);
index 859c136911e0702938da14c0bf95836f39e5a694..c2f43d378cb50ba18c7ca86999aab2bc2c385f54 100644 (file)
@@ -796,9 +796,6 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev,
                goto err_free;
        }
 
-       qp->db.db[0] = 0;
-       qp->db.db[1] = 0;
-
        qp->sq.wrid = kmalloc(qp->sq.wqe_cnt * sizeof(*qp->sq.wrid), GFP_KERNEL);
        qp->sq.wr_data = kmalloc(qp->sq.wqe_cnt * sizeof(*qp->sq.wr_data), GFP_KERNEL);
        qp->rq.wrid = kmalloc(qp->rq.wqe_cnt * sizeof(*qp->rq.wrid), GFP_KERNEL);
index 41fec66217dd3b2b7f61fcff7068f01a06493933..90bc9ff62fe72bd262b285aee8e56f14041dfde1 100644 (file)
@@ -165,8 +165,6 @@ static int create_srq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_srq *srq,
                return err;
        }
 
-       *srq->db.db = 0;
-
        if (mlx5_buf_alloc(dev->mdev, buf_size, PAGE_SIZE * 2, &srq->buf)) {
                mlx5_ib_dbg(dev, "buf alloc failed\n");
                err = -ENOMEM;
index 201ca6d76ce563862b6f2d620b68c69e3e58002a..63dd75485204a2fa7cb4fc92f4d8a33c5b8a6212 100644 (file)
@@ -171,6 +171,9 @@ static int mlx5_alloc_db_from_pgdir(struct mlx5_db_pgdir *pgdir,
        db->db      = pgdir->db_page + offset / sizeof(*pgdir->db_page);
        db->dma     = pgdir->db_dma  + offset;
 
+       db->db[0] = 0;
+       db->db[1] = 0;
+
        return 0;
 }