]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/infiniband/hw/hfi1/rc.c
IB/core: Use rdma_ah_attr accessor functions
[karo-tx-linux.git] / drivers / infiniband / hw / hfi1 / rc.c
index 9b3333fd9dc0bf31271d9c8f7e834114fb87451a..75a729cd0c3dfbd4639561e4a3b0161ff75b2573 100644 (file)
@@ -274,7 +274,7 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps)
                goto bail_no_tx;
 
        ohdr = &ps->s_txreq->phdr.hdr.u.oth;
-       if (qp->remote_ah_attr.ah_flags & IB_AH_GRH)
+       if (rdma_ah_get_ah_flags(&qp->remote_ah_attr) & IB_AH_GRH)
                ohdr = &ps->s_txreq->phdr.hdr.u.l.oth;
 
        /* Sending responses has higher priority over sending requests. */
@@ -744,9 +744,10 @@ void hfi1_send_rc_ack(struct hfi1_ctxtdata *rcd, struct rvt_qp *qp,
        /* Construct the header */
        /* header size in 32-bit words LRH+BTH+AETH = (8+12+4)/4 */
        hwords = 6;
-       if (unlikely(qp->remote_ah_attr.ah_flags & IB_AH_GRH)) {
+       if (unlikely(rdma_ah_get_ah_flags(&qp->remote_ah_attr) & IB_AH_GRH)) {
                hwords += hfi1_make_grh(ibp, &hdr.u.l.grh,
-                                      &qp->remote_ah_attr.grh, hwords, 0);
+                                       rdma_ah_read_grh(&qp->remote_ah_attr),
+                                       hwords, 0);
                ohdr = &hdr.u.l.oth;
                lrh0 = HFI1_LRH_GRH;
        } else {
@@ -763,14 +764,16 @@ void hfi1_send_rc_ack(struct hfi1_ctxtdata *rcd, struct rvt_qp *qp,
                                             IB_AETH_CREDIT_SHIFT));
        else
                ohdr->u.aeth = rvt_compute_aeth(qp);
-       sc5 = ibp->sl_to_sc[qp->remote_ah_attr.sl];
+       sc5 = ibp->sl_to_sc[rdma_ah_get_sl(&qp->remote_ah_attr)];
        /* set PBC_DC_INFO bit (aka SC[4]) in pbc_flags */
        pbc_flags |= ((!!(sc5 & 0x10)) << PBC_DC_INFO_SHIFT);
-       lrh0 |= (sc5 & 0xf) << 12 | (qp->remote_ah_attr.sl & 0xf) << 4;
+       lrh0 |= (sc5 & 0xf) << 12 | (rdma_ah_get_sl(&qp->remote_ah_attr)
+                                    & 0xf) << 4;
        hdr.lrh[0] = cpu_to_be16(lrh0);
-       hdr.lrh[1] = cpu_to_be16(qp->remote_ah_attr.dlid);
+       hdr.lrh[1] = cpu_to_be16(rdma_ah_get_dlid(&qp->remote_ah_attr));
        hdr.lrh[2] = cpu_to_be16(hwords + SIZE_OF_CRC);
-       hdr.lrh[3] = cpu_to_be16(ppd->lid | qp->remote_ah_attr.src_path_bits);
+       hdr.lrh[3] = cpu_to_be16(ppd->lid |
+                                rdma_ah_get_path_bits(&qp->remote_ah_attr));
        ohdr->bth[0] = cpu_to_be32(bth0);
        ohdr->bth[1] = cpu_to_be32(qp->remote_qpn);
        ohdr->bth[1] |= cpu_to_be32((!!is_fecn) << IB_BECN_SHIFT);
@@ -1100,10 +1103,11 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp,
                 */
                if (ppd->dd->flags & HFI1_HAS_SEND_DMA) {
                        struct sdma_engine *engine;
+                       u8 sl = rdma_ah_get_sl(&qp->remote_ah_attr);
                        u8 sc5;
 
                        /* For now use sc to find engine */
-                       sc5 = ibp->sl_to_sc[qp->remote_ah_attr.sl];
+                       sc5 = ibp->sl_to_sc[sl];
                        engine = qp_to_sdma_engine(qp, sc5);
                        sdma_engine_progress_schedule(engine);
                }
@@ -2098,7 +2102,7 @@ send_last:
                        wc.opcode = IB_WC_RECV;
                wc.qp = &qp->ibqp;
                wc.src_qp = qp->remote_qpn;
-               wc.slid = qp->remote_ah_attr.dlid;
+               wc.slid = rdma_ah_get_dlid(&qp->remote_ah_attr);
                /*
                 * It seems that IB mandates the presence of an SL in a
                 * work completion only for the UD transport (see section
@@ -2110,7 +2114,7 @@ send_last:
                 *
                 * See also OPA Vol. 1, section 9.7.6, and table 9-17.
                 */
-               wc.sl = qp->remote_ah_attr.sl;
+               wc.sl = rdma_ah_get_sl(&qp->remote_ah_attr);
                /* zero fields that are N/A */
                wc.vendor_err = 0;
                wc.pkey_index = 0;