aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSaeed Mahameed <saeedm@mellanox.com>2015-04-02 10:07:23 -0400
committerDavid S. Miller <davem@davemloft.net>2015-04-02 16:33:41 -0400
commitb812b5441e359adb9bd44108f7f91e5b0ba4a768 (patch)
tree197ac2eb4755eaad7c0b1de118a1f97eaf1a5fb9 /drivers
parent9ef9baa2acda077f3831f6e7cdf751bc8691f78f (diff)
net/mlx5_core: Clear doorbell record inside mlx5_db_alloc()
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/mlx5/cq.c2
-rw-r--r--drivers/infiniband/hw/mlx5/qp.c3
-rw-r--r--drivers/infiniband/hw/mlx5/srq.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx5/core/alloc.c3
4 files changed, 3 insertions, 7 deletions
diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
index c463e7bba5f4..f78249c48173 100644
--- a/drivers/infiniband/hw/mlx5/cq.c
+++ b/drivers/infiniband/hw/mlx5/cq.c
@@ -697,8 +697,6 @@ static int create_cq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *cq,
697 697
698 cq->mcq.set_ci_db = cq->db.db; 698 cq->mcq.set_ci_db = cq->db.db;
699 cq->mcq.arm_db = cq->db.db + 1; 699 cq->mcq.arm_db = cq->db.db + 1;
700 *cq->mcq.set_ci_db = 0;
701 *cq->mcq.arm_db = 0;
702 cq->mcq.cqe_sz = cqe_size; 700 cq->mcq.cqe_sz = cqe_size;
703 701
704 err = alloc_cq_buf(dev, &cq->buf, entries, cqe_size); 702 err = alloc_cq_buf(dev, &cq->buf, entries, cqe_size);
diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
index 859c136911e0..c2f43d378cb5 100644
--- a/drivers/infiniband/hw/mlx5/qp.c
+++ b/drivers/infiniband/hw/mlx5/qp.c
@@ -796,9 +796,6 @@ static int create_kernel_qp(struct mlx5_ib_dev *dev,
796 goto err_free; 796 goto err_free;
797 } 797 }
798 798
799 qp->db.db[0] = 0;
800 qp->db.db[1] = 0;
801
802 qp->sq.wrid = kmalloc(qp->sq.wqe_cnt * sizeof(*qp->sq.wrid), GFP_KERNEL); 799 qp->sq.wrid = kmalloc(qp->sq.wqe_cnt * sizeof(*qp->sq.wrid), GFP_KERNEL);
803 qp->sq.wr_data = kmalloc(qp->sq.wqe_cnt * sizeof(*qp->sq.wr_data), GFP_KERNEL); 800 qp->sq.wr_data = kmalloc(qp->sq.wqe_cnt * sizeof(*qp->sq.wr_data), GFP_KERNEL);
804 qp->rq.wrid = kmalloc(qp->rq.wqe_cnt * sizeof(*qp->rq.wrid), GFP_KERNEL); 801 qp->rq.wrid = kmalloc(qp->rq.wqe_cnt * sizeof(*qp->rq.wrid), GFP_KERNEL);
diff --git a/drivers/infiniband/hw/mlx5/srq.c b/drivers/infiniband/hw/mlx5/srq.c
index 41fec66217dd..90bc9ff62fe7 100644
--- a/drivers/infiniband/hw/mlx5/srq.c
+++ b/drivers/infiniband/hw/mlx5/srq.c
@@ -165,8 +165,6 @@ static int create_srq_kernel(struct mlx5_ib_dev *dev, struct mlx5_ib_srq *srq,
165 return err; 165 return err;
166 } 166 }
167 167
168 *srq->db.db = 0;
169
170 if (mlx5_buf_alloc(dev->mdev, buf_size, PAGE_SIZE * 2, &srq->buf)) { 168 if (mlx5_buf_alloc(dev->mdev, buf_size, PAGE_SIZE * 2, &srq->buf)) {
171 mlx5_ib_dbg(dev, "buf alloc failed\n"); 169 mlx5_ib_dbg(dev, "buf alloc failed\n");
172 err = -ENOMEM; 170 err = -ENOMEM;
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
index 201ca6d76ce5..63dd75485204 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
@@ -171,6 +171,9 @@ static int mlx5_alloc_db_from_pgdir(struct mlx5_db_pgdir *pgdir,
171 db->db = pgdir->db_page + offset / sizeof(*pgdir->db_page); 171 db->db = pgdir->db_page + offset / sizeof(*pgdir->db_page);
172 db->dma = pgdir->db_dma + offset; 172 db->dma = pgdir->db_dma + offset;
173 173
174 db->db[0] = 0;
175 db->db[1] = 0;
176
174 return 0; 177 return 0;
175} 178}
176 179