qedr: Add GSI support
[cascardo/linux.git] / drivers / infiniband / hw / qedr / qedr.h
index 0b404d8..620badd 100644 (file)
@@ -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)
 
@@ -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)
@@ -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;
@@ -292,6 +300,7 @@ struct qedr_qp_hwq_info {
        u16 prod;
        u16 cons;
        u16 wqe_cons;
+       u16 gsi_cons;
        u16 max_wr;
 
        /* DB */
@@ -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;
@@ -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);