]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
IB/hfi1: Add a function to build TID RDMA RESYNC packet
authorKaike Wan <kaike.wan@intel.com>
Thu, 24 Jan 2019 05:50:36 +0000 (21:50 -0800)
committerDoug Ledford <dledford@redhat.com>
Tue, 5 Feb 2019 23:07:44 +0000 (18:07 -0500)
This patch adds a function to build TID RDMA RESYNC packet, which is
sent by the requester to notify the responder that no TID RDMA ACK
packet has been received for a given KDETH PSN.

Signed-off-by: Mitko Haralanov <mitko.haralanov@intel.com>
Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
drivers/infiniband/hw/hfi1/tid_rdma.c
drivers/infiniband/hw/hfi1/tid_rdma.h

index a4faf7d6c224d0fbccecda67a7f45c8f3ccbcff5..e10f6d714dff42dd3464b338aca206fc1b340617 100644 (file)
@@ -4623,3 +4623,29 @@ static void hfi1_tid_retry_timeout(struct timer_list *t)
        spin_unlock(&qp->s_lock);
        spin_unlock_irqrestore(&qp->r_lock, flags);
 }
+
+u32 hfi1_build_tid_rdma_resync(struct rvt_qp *qp, struct rvt_swqe *wqe,
+                              struct ib_other_headers *ohdr, u32 *bth1,
+                              u32 *bth2, u16 fidx)
+{
+       struct hfi1_qp_priv *qpriv = qp->priv;
+       struct tid_rdma_params *remote;
+       struct tid_rdma_request *req = wqe_to_tid_req(wqe);
+       struct tid_rdma_flow *flow = &req->flows[fidx];
+       u32 generation;
+
+       rcu_read_lock();
+       remote = rcu_dereference(qpriv->tid_rdma.remote);
+       KDETH_RESET(ohdr->u.tid_rdma.ack.kdeth1, JKEY, remote->jkey);
+       ohdr->u.tid_rdma.ack.verbs_qp = cpu_to_be32(qp->remote_qpn);
+       *bth1 = remote->qp;
+       rcu_read_unlock();
+
+       generation = kern_flow_generation_next(flow->flow_state.generation);
+       *bth2 = mask_psn((generation << HFI1_KDETH_BTH_SEQ_SHIFT) - 1);
+       qpriv->s_resync_psn = *bth2;
+       *bth2 |= IB_BTH_REQ_ACK;
+       KDETH_RESET(ohdr->u.tid_rdma.ack.kdeth0, KVER, 0x1);
+
+       return sizeof(ohdr->u.tid_rdma.resync) / sizeof(u32);
+}
index 3be5f79ed1fb850269c9992e89a32340865a7c05..d876b0efeac2e8f175623a6ff38d444952f37ac4 100644 (file)
@@ -292,4 +292,8 @@ void hfi1_rc_rcv_tid_rdma_ack(struct hfi1_packet *packet);
 void hfi1_add_tid_retry_timer(struct rvt_qp *qp);
 void hfi1_del_tid_retry_timer(struct rvt_qp *qp);
 
+u32 hfi1_build_tid_rdma_resync(struct rvt_qp *qp, struct rvt_swqe *wqe,
+                              struct ib_other_headers *ohdr, u32 *bth1,
+                              u32 *bth2, u16 fidx);
+
 #endif /* HFI1_TID_RDMA_H */