aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/ipath/ipath_verbs.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband/hw/ipath/ipath_verbs.h')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_verbs.h52
1 files changed, 37 insertions, 15 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_verbs.h b/drivers/infiniband/hw/ipath/ipath_verbs.h
index c0c8d5b24a7d..b0b29d97d56e 100644
--- a/drivers/infiniband/hw/ipath/ipath_verbs.h
+++ b/drivers/infiniband/hw/ipath/ipath_verbs.h
@@ -43,6 +43,8 @@
43 43
44#include "ipath_layer.h" 44#include "ipath_layer.h"
45 45
46#define IPATH_MAX_RDMA_ATOMIC 4
47
46#define QPN_MAX (1 << 24) 48#define QPN_MAX (1 << 24)
47#define QPNMAP_ENTRIES (QPN_MAX / PAGE_SIZE / BITS_PER_BYTE) 49#define QPNMAP_ENTRIES (QPN_MAX / PAGE_SIZE / BITS_PER_BYTE)
48 50
@@ -89,7 +91,7 @@ struct ib_reth {
89} __attribute__ ((packed)); 91} __attribute__ ((packed));
90 92
91struct ib_atomic_eth { 93struct ib_atomic_eth {
92 __be64 vaddr; 94 __be32 vaddr[2]; /* unaligned so access as 2 32-bit words */
93 __be32 rkey; 95 __be32 rkey;
94 __be64 swap_data; 96 __be64 swap_data;
95 __be64 compare_data; 97 __be64 compare_data;
@@ -108,7 +110,7 @@ struct ipath_other_headers {
108 } rc; 110 } rc;
109 struct { 111 struct {
110 __be32 aeth; 112 __be32 aeth;
111 __be64 atomic_ack_eth; 113 __be32 atomic_ack_eth[2];
112 } at; 114 } at;
113 __be32 imm_data; 115 __be32 imm_data;
114 __be32 aeth; 116 __be32 aeth;
@@ -312,6 +314,19 @@ struct ipath_sge_state {
312}; 314};
313 315
314/* 316/*
317 * This structure holds the information that the send tasklet needs
318 * to send a RDMA read response or atomic operation.
319 */
320struct ipath_ack_entry {
321 u8 opcode;
322 u32 psn;
323 union {
324 struct ipath_sge_state rdma_sge;
325 u64 atomic_data;
326 };
327};
328
329/*
315 * Variables prefixed with s_ are for the requester (sender). 330 * Variables prefixed with s_ are for the requester (sender).
316 * Variables prefixed with r_ are for the responder (receiver). 331 * Variables prefixed with r_ are for the responder (receiver).
317 * Variables prefixed with ack_ are for responder replies. 332 * Variables prefixed with ack_ are for responder replies.
@@ -333,24 +348,24 @@ struct ipath_qp {
333 struct ipath_mmap_info *ip; 348 struct ipath_mmap_info *ip;
334 struct ipath_sge_state *s_cur_sge; 349 struct ipath_sge_state *s_cur_sge;
335 struct ipath_sge_state s_sge; /* current send request data */ 350 struct ipath_sge_state s_sge; /* current send request data */
336 /* current RDMA read send data */ 351 struct ipath_ack_entry s_ack_queue[IPATH_MAX_RDMA_ATOMIC + 1];
337 struct ipath_sge_state s_rdma_sge; 352 struct ipath_sge_state s_ack_rdma_sge;
353 struct ipath_sge_state s_rdma_read_sge;
338 struct ipath_sge_state r_sge; /* current receive data */ 354 struct ipath_sge_state r_sge; /* current receive data */
339 spinlock_t s_lock; 355 spinlock_t s_lock;
340 unsigned long s_flags; 356 unsigned long s_busy;
341 u32 s_hdrwords; /* size of s_hdr in 32 bit words */ 357 u32 s_hdrwords; /* size of s_hdr in 32 bit words */
342 u32 s_cur_size; /* size of send packet in bytes */ 358 u32 s_cur_size; /* size of send packet in bytes */
343 u32 s_len; /* total length of s_sge */ 359 u32 s_len; /* total length of s_sge */
344 u32 s_rdma_len; /* total length of s_rdma_sge */ 360 u32 s_rdma_read_len; /* total length of s_rdma_read_sge */
345 u32 s_next_psn; /* PSN for next request */ 361 u32 s_next_psn; /* PSN for next request */
346 u32 s_last_psn; /* last response PSN processed */ 362 u32 s_last_psn; /* last response PSN processed */
347 u32 s_psn; /* current packet sequence number */ 363 u32 s_psn; /* current packet sequence number */
348 u32 s_ack_psn; /* PSN for RDMA_READ */ 364 u32 s_ack_rdma_psn; /* PSN for sending RDMA read responses */
365 u32 s_ack_psn; /* PSN for acking sends and RDMA writes */
349 u32 s_rnr_timeout; /* number of milliseconds for RNR timeout */ 366 u32 s_rnr_timeout; /* number of milliseconds for RNR timeout */
350 u32 r_ack_psn; /* PSN for next ACK or atomic ACK */ 367 u32 r_ack_psn; /* PSN for next ACK or atomic ACK */
351 u64 r_wr_id; /* ID for current receive WQE */ 368 u64 r_wr_id; /* ID for current receive WQE */
352 u64 r_atomic_data; /* data for last atomic op */
353 u32 r_atomic_psn; /* PSN of last atomic op */
354 u32 r_len; /* total length of r_sge */ 369 u32 r_len; /* total length of r_sge */
355 u32 r_rcv_len; /* receive data len processed */ 370 u32 r_rcv_len; /* receive data len processed */
356 u32 r_psn; /* expected rcv packet sequence number */ 371 u32 r_psn; /* expected rcv packet sequence number */
@@ -360,12 +375,13 @@ struct ipath_qp {
360 u8 s_ack_state; /* opcode of packet to ACK */ 375 u8 s_ack_state; /* opcode of packet to ACK */
361 u8 s_nak_state; /* non-zero if NAK is pending */ 376 u8 s_nak_state; /* non-zero if NAK is pending */
362 u8 r_state; /* opcode of last packet received */ 377 u8 r_state; /* opcode of last packet received */
363 u8 r_ack_state; /* opcode of packet to ACK */
364 u8 r_nak_state; /* non-zero if NAK is pending */ 378 u8 r_nak_state; /* non-zero if NAK is pending */
365 u8 r_min_rnr_timer; /* retry timeout value for RNR NAKs */ 379 u8 r_min_rnr_timer; /* retry timeout value for RNR NAKs */
366 u8 r_reuse_sge; /* for UC receive errors */ 380 u8 r_reuse_sge; /* for UC receive errors */
367 u8 r_sge_inx; /* current index into sg_list */ 381 u8 r_sge_inx; /* current index into sg_list */
368 u8 r_wrid_valid; /* r_wrid set but CQ entry not yet made */ 382 u8 r_wrid_valid; /* r_wrid set but CQ entry not yet made */
383 u8 r_max_rd_atomic; /* max number of RDMA read/atomic to receive */
384 u8 r_head_ack_queue; /* index into s_ack_queue[] */
369 u8 qp_access_flags; 385 u8 qp_access_flags;
370 u8 s_max_sge; /* size of s_wq->sg_list */ 386 u8 s_max_sge; /* size of s_wq->sg_list */
371 u8 s_retry_cnt; /* number of times to retry */ 387 u8 s_retry_cnt; /* number of times to retry */
@@ -374,6 +390,10 @@ struct ipath_qp {
374 u8 s_rnr_retry; /* requester RNR retry counter */ 390 u8 s_rnr_retry; /* requester RNR retry counter */
375 u8 s_wait_credit; /* limit number of unacked packets sent */ 391 u8 s_wait_credit; /* limit number of unacked packets sent */
376 u8 s_pkey_index; /* PKEY index to use */ 392 u8 s_pkey_index; /* PKEY index to use */
393 u8 s_max_rd_atomic; /* max number of RDMA read/atomic to send */
394 u8 s_num_rd_atomic; /* number of RDMA read/atomic pending */
395 u8 s_tail_ack_queue; /* index into s_ack_queue[] */
396 u8 s_flags;
377 u8 timeout; /* Timeout for this QP */ 397 u8 timeout; /* Timeout for this QP */
378 enum ib_mtu path_mtu; 398 enum ib_mtu path_mtu;
379 u32 remote_qpn; 399 u32 remote_qpn;
@@ -390,11 +410,16 @@ struct ipath_qp {
390 struct ipath_sge r_sg_list[0]; /* verified SGEs */ 410 struct ipath_sge r_sg_list[0]; /* verified SGEs */
391}; 411};
392 412
413/* Bit definition for s_busy. */
414#define IPATH_S_BUSY 0
415
393/* 416/*
394 * Bit definitions for s_flags. 417 * Bit definitions for s_flags.
395 */ 418 */
396#define IPATH_S_BUSY 0 419#define IPATH_S_SIGNAL_REQ_WR 0x01
397#define IPATH_S_SIGNAL_REQ_WR 1 420#define IPATH_S_FENCE_PENDING 0x02
421#define IPATH_S_RDMAR_PENDING 0x04
422#define IPATH_S_ACK_PENDING 0x08
398 423
399#define IPATH_PSN_CREDIT 2048 424#define IPATH_PSN_CREDIT 2048
400 425
@@ -757,9 +782,6 @@ u32 ipath_make_grh(struct ipath_ibdev *dev, struct ib_grh *hdr,
757 782
758void ipath_do_ruc_send(unsigned long data); 783void ipath_do_ruc_send(unsigned long data);
759 784
760u32 ipath_make_rc_ack(struct ipath_qp *qp, struct ipath_other_headers *ohdr,
761 u32 pmtu);
762
763int ipath_make_rc_req(struct ipath_qp *qp, struct ipath_other_headers *ohdr, 785int ipath_make_rc_req(struct ipath_qp *qp, struct ipath_other_headers *ohdr,
764 u32 pmtu, u32 *bth0p, u32 *bth2p); 786 u32 pmtu, u32 *bth0p, u32 *bth2p);
765 787