Skip to content

Commit

Permalink
qedr: Add support for data path
Browse files Browse the repository at this point in the history
Implement fastpath verbs like ib_send_post, ib_post_recv and ib_poll_cq.

Signed-off-by: Rajesh Borundia <[email protected]>
Signed-off-by: Ram Amrani <[email protected]>
Signed-off-by: Doug Ledford <[email protected]>
  • Loading branch information
Ram Amrani authored and dledford committed Oct 14, 2016
1 parent e0290cc commit afa0e13
Show file tree
Hide file tree
Showing 5 changed files with 1,614 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/infiniband/hw/qedr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ static int qedr_register_device(struct qedr_dev *dev)
QEDR_UVERBS(QUERY_QP) |
QEDR_UVERBS(DESTROY_QP) |
QEDR_UVERBS(REG_MR) |
QEDR_UVERBS(DEREG_MR);
QEDR_UVERBS(DEREG_MR) |
QEDR_UVERBS(POLL_CQ) |
QEDR_UVERBS(POST_SEND) |
QEDR_UVERBS(POST_RECV);

dev->ibdev.phys_port_cnt = 1;
dev->ibdev.num_comp_vectors = dev->num_cnq;
Expand Down Expand Up @@ -141,6 +144,10 @@ static int qedr_register_device(struct qedr_dev *dev)
dev->ibdev.alloc_mr = qedr_alloc_mr;
dev->ibdev.map_mr_sg = qedr_map_mr_sg;

dev->ibdev.poll_cq = qedr_poll_cq;
dev->ibdev.post_send = qedr_post_send;
dev->ibdev.post_recv = qedr_post_recv;

dev->ibdev.dma_device = &dev->pdev->dev;

dev->ibdev.get_link_layer = qedr_link_layer;
Expand Down
19 changes: 19 additions & 0 deletions drivers/infiniband/hw/qedr/qedr.h
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,25 @@ struct qedr_mr {
u32 npages;
};

#define SET_FIELD2(value, name, flag) ((value) |= ((flag) << (name ## _SHIFT)))

#define QEDR_RESP_IMM (RDMA_CQE_RESPONDER_IMM_FLG_MASK << \
RDMA_CQE_RESPONDER_IMM_FLG_SHIFT)
#define QEDR_RESP_RDMA (RDMA_CQE_RESPONDER_RDMA_FLG_MASK << \
RDMA_CQE_RESPONDER_RDMA_FLG_SHIFT)
#define QEDR_RESP_RDMA_IMM (QEDR_RESP_IMM | QEDR_RESP_RDMA)

static inline void qedr_inc_sw_cons(struct qedr_qp_hwq_info *info)
{
info->cons = (info->cons + 1) % info->max_wr;
info->wqe_cons++;
}

static inline void qedr_inc_sw_prod(struct qedr_qp_hwq_info *info)
{
info->prod = (info->prod + 1) % info->max_wr;
}

static inline int qedr_get_dmac(struct qedr_dev *dev,
struct ib_ah_attr *ah_attr, u8 *mac_addr)
{
Expand Down
Loading

0 comments on commit afa0e13

Please sign in to comment.