Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
qp.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007 Cisco Systems, Inc. All rights reserved.
3  *
4  * This software is available to you under a choice of one of two
5  * licenses. You may choose to be licensed under the terms of the GNU
6  * General Public License (GPL) Version 2, available from the file
7  * COPYING in the main directory of this source tree, or the
8  * OpenIB.org BSD license below:
9  *
10  * Redistribution and use in source and binary forms, with or
11  * without modification, are permitted provided that the following
12  * conditions are met:
13  *
14  * - Redistributions of source code must retain the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer.
17  *
18  * - Redistributions in binary form must reproduce the above
19  * copyright notice, this list of conditions and the following
20  * disclaimer in the documentation and/or other materials
21  * provided with the distribution.
22  *
23  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
24  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
25  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
26  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
27  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
28  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
29  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30  * SOFTWARE.
31  */
32 
33 #ifndef MLX4_QP_H
34 #define MLX4_QP_H
35 
36 #include <linux/types.h>
37 
38 #include <linux/mlx4/device.h>
39 
40 #define MLX4_INVALID_LKEY 0x100
41 
59 };
60 
71 };
72 
73 enum {
80 };
81 
82 enum {
86 };
87 
88 enum {
89  /* params1 */
90  MLX4_QP_BIT_SRE = 1 << 15,
91  MLX4_QP_BIT_SWE = 1 << 14,
92  MLX4_QP_BIT_SAE = 1 << 13,
93  /* params2 */
94  MLX4_QP_BIT_RRE = 1 << 15,
95  MLX4_QP_BIT_RWE = 1 << 14,
96  MLX4_QP_BIT_RAE = 1 << 13,
97  MLX4_QP_BIT_RIC = 1 << 4,
98 };
99 
100 enum {
103 
107  MLX4_RSS_IPV6 = 1 << 3,
109  MLX4_RSS_IPV4 = 1 << 5,
110 
111  /* offset of mlx4_rss_context within mlx4_qp_context.pri_path */
113  /* offset of being RSS indirection QP within mlx4_qp_context.flags */
115 };
116 
125 };
126 
127 struct mlx4_qp_path {
140  u8 rgid[16];
146  u8 dmac[6];
147 };
148 
186 };
187 
188 /* Which firmware version adds support for NEC (NoErrorCompletion) bit */
189 #define MLX4_FW_VER_WQE_CTRL_NEC mlx4_fw_ver(2, 2, 232)
190 
191 enum {
192  MLX4_WQE_CTRL_NEC = 1 << 29,
201 };
202 
208  /*
209  * High 24 bits are SRC remote buffer; low 8 bits are flags:
210  * [7] SO (strong ordering)
211  * [5] TCP/UDP checksum
212  * [4] IP checksum
213  * [3:2] C (generate completion queue entry)
214  * [1] SE (solicited event)
215  * [0] FL (force loopback)
216  */
217  union {
220  };
221  /*
222  * imm is immediate data for send/RDMA write w/ immediate;
223  * also invalidation key for send with invalidate; input
224  * modifier for WQEs on CCQs.
225  */
227 };
228 
229 enum {
230  MLX4_WQE_MLX_VL15 = 1 << 17,
232 };
233 
241  /*
242  * [17] VL15
243  * [16] SLR
244  * [15:12] static rate
245  * [11:8] SL
246  * [4] ICRC
247  * [3:2] C
248  * [0] FL (force loopback)
249  */
253 };
254 
256  __be32 av[8];
260  u8 mac[6];
261 };
262 
266 };
267 
275 };
276 
277 enum {
283 };
284 
294 };
295 
304 };
305 
313 };
314 
319 };
320 
324 };
325 
331 };
332 
337 };
338 
339 enum {
341  MLX4_INLINE_SEG = 1 << 31,
342 };
343 
346 };
347 
348 int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
349  enum mlx4_qp_state cur_state, enum mlx4_qp_state new_state,
350  struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar,
351  int sqd_event, struct mlx4_qp *qp);
352 
353 int mlx4_qp_query(struct mlx4_dev *dev, struct mlx4_qp *qp,
354  struct mlx4_qp_context *context);
355 
356 int mlx4_qp_to_ready(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
357  struct mlx4_qp_context *context,
358  struct mlx4_qp *qp, enum mlx4_qp_state *qp_state);
359 
360 static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn)
361 {
362  return radix_tree_lookup(&dev->qp_table_tree, qpn & (dev->caps.num_qps - 1));
363 }
364 
365 void mlx4_qp_remove(struct mlx4_dev *dev, struct mlx4_qp *qp);
366 
367 #endif /* MLX4_QP_H */