IB/hfi1: Use defines from common headers
authorDon Hiatt <don.hiatt@intel.com>
Sun, 9 Apr 2017 17:16:28 +0000 (10:16 -0700)
committerDoug Ledford <dledford@redhat.com>
Fri, 28 Apr 2017 17:48:01 +0000 (13:48 -0400)
Move FECN and BECN related defines to common header files

Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Don Hiatt <don.hiatt@intel.com>
Signed-off-by: Dasaratharaman Chandramouli <dasaratharaman.chandramouli@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/common.h
drivers/infiniband/hw/hfi1/driver.c
drivers/infiniband/hw/hfi1/hfi.h
drivers/infiniband/hw/hfi1/rc.c
drivers/infiniband/hw/hfi1/ruc.c
drivers/infiniband/hw/hfi1/trace_ibhdrs.h
drivers/infiniband/hw/hfi1/ud.c
include/rdma/ib_hdrs.h

index 804150febec624850c26fa36218ebf0df342c54d..995d62c7f9a7d6f2d1c7c2a7b86f8044837e95fe 100644 (file)
@@ -331,12 +331,6 @@ struct diag_pkt {
 #define FULL_MGMT_P_KEY      0xFFFF
 
 #define DEFAULT_P_KEY LIM_MGMT_P_KEY
-#define HFI1_FECN_SHIFT 31
-#define HFI1_FECN_MASK 1
-#define HFI1_FECN_SMASK BIT(HFI1_FECN_SHIFT)
-#define HFI1_BECN_SHIFT 30
-#define HFI1_BECN_MASK 1
-#define HFI1_BECN_SMASK BIT(HFI1_BECN_SHIFT)
 
 /**
  * 0xF8 - 4 bits of multicast range and 1 bit for collective range
index 51db53b11d6c5df551fb9320c0f53ecdd3a8e049..500b129ed5654b26b404f4fa3bde89557e6ce4f1 100644 (file)
@@ -496,13 +496,13 @@ void hfi1_process_ecn_slowpath(struct rvt_qp *qp, struct hfi1_packet *pkt,
        sc = hfi1_9B_get_sc5(hdr, pkt->rhf);
 
        bth1 = be32_to_cpu(ohdr->bth[1]);
-       if (do_cnp && (bth1 & HFI1_FECN_SMASK)) {
+       if (do_cnp && (bth1 & IB_FECN_SMASK)) {
                u16 pkey = (u16)be32_to_cpu(ohdr->bth[0]);
 
                return_cnp(ibp, qp, rqpn, pkey, dlid, rlid, sc, grh);
        }
 
-       if (!is_mcast && (bth1 & HFI1_BECN_SMASK)) {
+       if (!is_mcast && (bth1 & IB_BECN_SMASK)) {
                struct hfi1_pportdata *ppd = ppd_from_ibp(ibp);
                u32 lqpn = bth1 & RVT_QPN_MASK;
                u8 sl = ibp->sc_to_sl[sc];
@@ -635,7 +635,7 @@ static void __prescan_rxq(struct hfi1_packet *packet)
                }
 
                bth1 = be32_to_cpu(packet->ohdr->bth[1]);
-               is_ecn = !!(bth1 & (HFI1_FECN_SMASK | HFI1_BECN_SMASK));
+               is_ecn = !!(bth1 & (IB_FECN_SMASK | IB_BECN_SMASK));
 
                if (!is_ecn)
                        goto next;
@@ -653,7 +653,7 @@ static void __prescan_rxq(struct hfi1_packet *packet)
                rcu_read_unlock();
 
                /* turn off BECN, FECN */
-               bth1 &= ~(HFI1_FECN_SMASK | HFI1_BECN_SMASK);
+               bth1 &= ~(IB_FECN_SMASK | IB_BECN_SMASK);
                packet->ohdr->bth[1] = cpu_to_be32(bth1);
 next:
                update_ps_mdata(&mdata, rcd);
index c32bc49cc0cbd62d2e102eea865ca708c1c5fcd4..550116fd9d48dd3a8071b02e59d8c53977d93c09 100644 (file)
@@ -1648,9 +1648,9 @@ static inline bool process_ecn(struct rvt_qp *qp, struct hfi1_packet *pkt,
        u32 bth1;
 
        bth1 = be32_to_cpu(ohdr->bth[1]);
-       if (unlikely(bth1 & (HFI1_BECN_SMASK | HFI1_FECN_SMASK))) {
+       if (unlikely(bth1 & (IB_BECN_SMASK | IB_FECN_SMASK))) {
                hfi1_process_ecn_slowpath(qp, pkt, do_cnp);
-               return bth1 & HFI1_FECN_SMASK;
+               return bth1 & IB_FECN_SMASK;
        }
        return false;
 }
index 623209a21927f8f6e09d47f60d160deb9eb3b9f5..da968b76ba62e67fd1d9e1ba079b047dd37b31b8 100644 (file)
@@ -773,7 +773,7 @@ void hfi1_send_rc_ack(struct hfi1_ctxtdata *rcd, struct rvt_qp *qp,
        hdr.lrh[3] = cpu_to_be16(ppd->lid | qp->remote_ah_attr.src_path_bits);
        ohdr->bth[0] = cpu_to_be32(bth0);
        ohdr->bth[1] = cpu_to_be32(qp->remote_qpn);
-       ohdr->bth[1] |= cpu_to_be32((!!is_fecn) << HFI1_BECN_SHIFT);
+       ohdr->bth[1] |= cpu_to_be32((!!is_fecn) << IB_BECN_SHIFT);
        ohdr->bth[2] = cpu_to_be32(mask_psn(qp->r_ack_psn));
 
        /* Don't try to send ACKs if the link isn't ACTIVE */
index 27309157cef5613d88bd9e4faa15d765e630e8db..879eb9b31954e4c5f7075750fed3d8aef956a6aa 100644 (file)
@@ -775,7 +775,7 @@ void hfi1_make_ruc_header(struct rvt_qp *qp, struct ib_other_headers *ohdr,
        if (qp->s_flags & RVT_S_ECN) {
                qp->s_flags &= ~RVT_S_ECN;
                /* we recently received a FECN, so return a BECN */
-               bth1 |= (HFI1_BECN_MASK << HFI1_BECN_SHIFT);
+               bth1 |= (IB_BECN_MASK << IB_BECN_SHIFT);
        }
        ohdr->bth[1] = cpu_to_be32(bth1);
        ohdr->bth[2] = cpu_to_be32(bth2);
index 382fcda3a5f673a87e42bef61d5f6a0911d315f6..090f6b506953128d17f1aa32e61710122777b47b 100644 (file)
@@ -139,11 +139,11 @@ DECLARE_EVENT_CLASS(hfi1_ibhdr_template,
                        __entry->pkey =
                        be32_to_cpu(ohdr->bth[0]) & 0xffff;
                        __entry->f =
-                       (be32_to_cpu(ohdr->bth[1]) >> HFI1_FECN_SHIFT) &
-                       HFI1_FECN_MASK;
+                       (be32_to_cpu(ohdr->bth[1]) >> IB_FECN_SHIFT) &
+                       IB_FECN_MASK;
                        __entry->b =
-                       (be32_to_cpu(ohdr->bth[1]) >> HFI1_BECN_SHIFT) &
-                       HFI1_BECN_MASK;
+                       (be32_to_cpu(ohdr->bth[1]) >> IB_BECN_SHIFT) &
+                       IB_BECN_MASK;
                        __entry->qpn =
                        be32_to_cpu(ohdr->bth[1]) & RVT_QPN_MASK;
                        __entry->a =
index 8b3403a1f19942c3064524946597589c3be894a3..45bc3f04793e79ffd399b46b5dd36945a7da34d2 100644 (file)
@@ -537,7 +537,7 @@ void return_cnp(struct hfi1_ibport *ibp, struct rvt_qp *qp, u32 remote_qpn,
        bth0 = pkey | (IB_OPCODE_CNP << 24);
        ohdr->bth[0] = cpu_to_be32(bth0);
 
-       ohdr->bth[1] = cpu_to_be32(remote_qpn | (1 << HFI1_BECN_SHIFT));
+       ohdr->bth[1] = cpu_to_be32(remote_qpn | (1 << IB_BECN_SHIFT));
        ohdr->bth[2] = 0; /* PSN 0 */
 
        hdr.lrh[0] = cpu_to_be16(lrh0);
index 9cf42bcc8317c9dab9ee67b13183327bbd6b8e27..5519f31f043a45b086e098407c4a15a2a7d02ca4 100644 (file)
 #define IB_GRH_FLOW_MASK       0xFFFFF
 #define IB_GRH_FLOW_SHIFT      0
 #define IB_GRH_NEXT_HDR                0x1B
+#define IB_FECN_SHIFT 31
+#define IB_FECN_MASK 1
+#define IB_FECN_SMASK BIT(IB_FECN_SHIFT)
+#define IB_BECN_SHIFT 30
+#define IB_BECN_MASK 1
+#define IB_BECN_SMASK BIT(IB_BECN_SHIFT)
 
 #define IB_AETH_CREDIT_SHIFT   24
 #define IB_AETH_CREDIT_MASK    0x1F