On Sun, Dec 09, 2018 at 12:44:40PM +0200, Leon Romanovsky wrote: > From: Leon Romanovsky <leonro@xxxxxxxxxxxx> > > Handle atomic was left as unimplemented from 2013, > remove the code till this part will be developed. > > Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters") > Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> > Signed-off-by: Leon Romanovsky <leonro@xxxxxxxxxxxx> > --- > drivers/infiniband/hw/mlx5/cq.c | 62 ---------------------------- > drivers/infiniband/hw/mlx5/mlx5_ib.h | 1 - > 2 files changed, 63 deletions(-) > > diff --git a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c > index 0b99f7d0630d..38b9ecd65f71 100644 > --- a/drivers/infiniband/hw/mlx5/cq.c > +++ b/drivers/infiniband/hw/mlx5/cq.c > @@ -330,67 +330,6 @@ static void mlx5_handle_error_cqe(struct mlx5_ib_dev *dev, > dump_cqe(dev, cqe); > } > > -static int is_atomic_response(struct mlx5_ib_qp *qp, uint16_t idx) > -{ > - /* TBD: waiting decision > - */ > - return 0; > -} > - > -static void *mlx5_get_atomic_laddr(struct mlx5_ib_qp *qp, uint16_t idx) > -{ > - struct mlx5_wqe_data_seg *dpseg; > - void *addr; > - > - dpseg = mlx5_get_send_wqe(qp, idx) + sizeof(struct mlx5_wqe_ctrl_seg) + > - sizeof(struct mlx5_wqe_raddr_seg) + > - sizeof(struct mlx5_wqe_atomic_seg); > - addr = (void *)(unsigned long)be64_to_cpu(dpseg->addr); > - return addr; > -} > - > -static void handle_atomic(struct mlx5_ib_qp *qp, struct mlx5_cqe64 *cqe64, > - uint16_t idx) > -{ > - void *addr; > - int byte_count; > - int i; > - > - if (!is_atomic_response(qp, idx)) > - return; > - > - byte_count = be32_to_cpu(cqe64->byte_cnt); > - addr = mlx5_get_atomic_laddr(qp, idx); > - > - if (byte_count == 4) { > - *(uint32_t *)addr = be32_to_cpu(*((__be32 *)addr)); > - } else { > - for (i = 0; i < byte_count; i += 8) { > - *(uint64_t *)addr = be64_to_cpu(*((__be64 *)addr)); > - addr += 8; > - } > - } > - > - return; > -} > - > -static void handle_atomics(struct mlx5_ib_qp *qp, struct mlx5_cqe64 *cqe64, > - u16 tail, u16 head) > -{ > - u16 idx; > - > - do { > - idx = tail & (qp->sq.wqe_cnt - 1); > - handle_atomic(qp, cqe64, idx); > - if (idx == head) > - break; > - > - tail = qp->sq.w_list[idx].next; > - } while (1); > - tail = qp->sq.w_list[idx].next; > - qp->sq.last_poll = tail; > -} > - > static void free_cq_buf(struct mlx5_ib_dev *dev, struct mlx5_ib_cq_buf *buf) > { > mlx5_frag_buf_free(dev->mdev, &buf->frag_buf); > @@ -567,7 +506,6 @@ static int mlx5_poll_one(struct mlx5_ib_cq *cq, > wqe_ctr = be16_to_cpu(cqe64->wqe_counter); > idx = wqe_ctr & (wq->wqe_cnt - 1); > handle_good_req(wc, cqe64, wq, idx); > - handle_atomics(*cur_qp, cqe64, wq->last_poll, idx); > wc->wr_id = wq->wrid[idx]; > wq->tail = wq->wqe_head[idx] + 1; > wc->status = IB_WC_SUCCESS; > diff --git a/drivers/infiniband/hw/mlx5/mlx5_ib.h b/drivers/infiniband/hw/mlx5/mlx5_ib.h > index 0c96d2993f41..a98a36273a18 100644 > --- a/drivers/infiniband/hw/mlx5/mlx5_ib.h > +++ b/drivers/infiniband/hw/mlx5/mlx5_ib.h > @@ -1071,7 +1071,6 @@ int mlx5_ib_post_send(struct ib_qp *ibqp, const struct ib_send_wr *wr, > const struct ib_send_wr **bad_wr); > int mlx5_ib_post_recv(struct ib_qp *ibqp, const struct ib_recv_wr *wr, > const struct ib_recv_wr **bad_wr); > -void *mlx5_get_send_wqe(struct mlx5_ib_qp *qp, int n); > int mlx5_ib_read_user_wqe(struct mlx5_ib_qp *qp, int send, int wqe_index, > void *buffer, u32 length, > struct mlx5_ib_qp_base *base); > -- Reviewed-by: Yuval Shaia <yuval.shaia@xxxxxxxxxx> > 2.19.1 >