2 * IBM eServer eHCA Infiniband device driver for Linux on POWER
4 * Hardware request structures
6 * Authors: Waleri Fomin <fomin@de.ibm.com>
7 * Reinhard Ernst <rernst@de.ibm.com>
8 * Christoph Raisch <raisch@de.ibm.com>
10 * Copyright (c) 2005 IBM Corporation
12 * All rights reserved.
14 * This source code is distributed under a dual license of GPL v2.0 and OpenIB
19 * Redistribution and use in source and binary forms, with or without
20 * modification, are permitted provided that the following conditions are met:
22 * Redistributions of source code must retain the above copyright notice, this
23 * list of conditions and the following disclaimer.
25 * Redistributions in binary form must reproduce the above copyright notice,
26 * this list of conditions and the following disclaimer in the documentation
27 * and/or other materials
28 * provided with the distribution.
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
33 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
34 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
35 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
36 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
37 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
38 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
39 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 * POSSIBILITY OF SUCH DAMAGE.
47 #include "ehca_tools.h"
49 /* virtual scatter gather entry to specify remote adresses with length */
50 struct ehca_vsgentry
{
56 #define GRH_FLAG_MASK EHCA_BMASK_IBM(7,7)
57 #define GRH_IPVERSION_MASK EHCA_BMASK_IBM(0,3)
58 #define GRH_TCLASS_MASK EHCA_BMASK_IBM(4,12)
59 #define GRH_FLOWLABEL_MASK EHCA_BMASK_IBM(13,31)
60 #define GRH_PAYLEN_MASK EHCA_BMASK_IBM(32,47)
61 #define GRH_NEXTHEADER_MASK EHCA_BMASK_IBM(48,55)
62 #define GRH_HOPLIMIT_MASK EHCA_BMASK_IBM(56,63)
65 * Unreliable Datagram Address Vector Format
66 * see IBTA Vol1 chapter 8.3 Global Routing Header
84 u64 word_0
; /* always set to 6 */
85 /*should be 0x1B for IB transport */
94 /* DWord_1 --> SGID */
101 /* DWord_3 --> DGID */
112 /* maximum number of sg entries allowed in a WQE */
113 #define MAX_WQE_SG_ENTRIES 252
115 #define WQE_OPTYPE_SEND 0x80
116 #define WQE_OPTYPE_RDMAREAD 0x40
117 #define WQE_OPTYPE_RDMAWRITE 0x20
118 #define WQE_OPTYPE_CMPSWAP 0x10
119 #define WQE_OPTYPE_FETCHADD 0x08
120 #define WQE_OPTYPE_BIND 0x04
122 #define WQE_WRFLAG_REQ_SIGNAL_COM 0x80
123 #define WQE_WRFLAG_FENCE 0x40
124 #define WQE_WRFLAG_IMM_DATA_PRESENT 0x20
125 #define WQE_WRFLAG_SOLIC_EVENT 0x10
127 #define WQEF_CACHE_HINT 0x80
128 #define WQEF_CACHE_HINT_RD_WR 0x40
129 #define WQEF_TIMED_WQE 0x20
130 #define WQEF_PURGE 0x08
131 #define WQEF_HIGH_NIBBLE 0xF0
133 #define MW_BIND_ACCESSCTRL_R_WRITE 0x40
134 #define MW_BIND_ACCESSCTRL_R_READ 0x20
135 #define MW_BIND_ACCESSCTRL_R_ATOMIC 0x10
144 u16 wqe_provided_slid
;
145 u32 destination_qp_number
;
147 u32 local_ee_context_qkey
;
151 u64 remote_virtual_adress
;
154 u64 atomic_1st_op_dma_len
;
156 struct ehca_vsgentry sg_list
[MAX_WQE_SG_ENTRIES
];
164 struct ehca_vsgentry sg_list
[MAX_WQE_SG_ENTRIES
];
167 struct ehca_ud_av ud_av
;
168 struct ehca_vsgentry sg_list
[MAX_WQE_SG_ENTRIES
-
176 struct ehca_vsgentry sg_list
[MAX_WQE_SG_ENTRIES
];
209 #define WC_SEND_RECEIVE EHCA_BMASK_IBM(0,0)
210 #define WC_IMM_DATA EHCA_BMASK_IBM(1,1)
211 #define WC_GRH_PRESENT EHCA_BMASK_IBM(2,2)
212 #define WC_SE_BIT EHCA_BMASK_IBM(3,3)
213 #define WC_STATUS_ERROR_BIT 0x80000000
214 #define WC_STATUS_REMOTE_ERROR_FLAGS 0x0000F800
215 #define WC_STATUS_PURGE_BIT 0x10
220 u8 w_completion_flags
;
222 u32 nr_bytes_transferred
;
225 u8 freed_resource_count
;
230 u32 remote_qp_number
;
237 u8 wqe_timestamp_valid
;
250 u64 length
; /* length of memory region in bytes*/
255 u8 local_remote_access_ctrl
;
256 u8 reserved
[0x20 - 0x18];
259 #endif /*_EHCA_QES_H_*/