Skip to content

Commit

Permalink
qedr: Add GSI support
Browse files Browse the repository at this point in the history
Add support for GSI over light L2.

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 1d1424c commit 0488677
Show file tree
Hide file tree
Showing 7 changed files with 706 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/infiniband/hw/qedr/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
obj-$(CONFIG_INFINIBAND_QEDR) := qedr.o

qedr-y := main.o verbs.o
qedr-y := main.o verbs.o qedr_cm.o
3 changes: 3 additions & 0 deletions drivers/infiniband/hw/qedr/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,9 @@ static int qedr_register_device(struct qedr_dev *dev)

dev->ibdev.query_pkey = qedr_query_pkey;

dev->ibdev.create_ah = qedr_create_ah;
dev->ibdev.destroy_ah = qedr_destroy_ah;

dev->ibdev.get_dma_mr = qedr_get_dma_mr;
dev->ibdev.dereg_mr = qedr_dereg_mr;
dev->ibdev.reg_user_mr = qedr_reg_user_mr;
Expand Down
15 changes: 15 additions & 0 deletions drivers/infiniband/hw/qedr/qedr.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
#define QEDR_MSG_RQ " RQ"
#define QEDR_MSG_SQ " SQ"
#define QEDR_MSG_QP " QP"
#define QEDR_MSG_GSI " GSI"

#define QEDR_CQ_MAGIC_NUMBER (0x11223344)

Expand Down Expand Up @@ -148,6 +149,10 @@ struct qedr_dev {
u8 num_hwfns;
uint wq_multiplier;
u8 gsi_ll2_mac_address[ETH_ALEN];
int gsi_qp_created;
struct qedr_cq *gsi_sqcq;
struct qedr_cq *gsi_rqcq;
struct qedr_qp *gsi_qp;
};

#define QEDR_MAX_SQ_PBL (0x8000)
Expand Down Expand Up @@ -246,6 +251,9 @@ struct qedr_cq {

u16 icid;

/* Lock to protect completion handler */
spinlock_t comp_handler_lock;

/* Lock to protect multiplem CQ's */
spinlock_t cq_lock;
u8 arm_flags;
Expand Down Expand Up @@ -292,6 +300,7 @@ struct qedr_qp_hwq_info {
u16 prod;
u16 cons;
u16 wqe_cons;
u16 gsi_cons;
u16 max_wr;

/* DB */
Expand Down Expand Up @@ -366,6 +375,7 @@ struct qedr_qp {
struct ib_sge sg_list[RDMA_MAX_SGE_PER_RQ_WQE];
u8 wqe_size;

u8 smac[ETH_ALEN];
u16 vlan_id;
int rc;
} *rqe_wr_id;
Expand Down Expand Up @@ -473,6 +483,11 @@ static inline struct qedr_qp *get_qedr_qp(struct ib_qp *ibqp)
return container_of(ibqp, struct qedr_qp, ibqp);
}

static inline struct qedr_ah *get_qedr_ah(struct ib_ah *ibah)
{
return container_of(ibah, struct qedr_ah, ibah);
}

static inline struct qedr_mr *get_qedr_mr(struct ib_mr *ibmr)
{
return container_of(ibmr, struct qedr_mr, ibmr);
Expand Down
Loading

0 comments on commit 0488677

Please sign in to comment.