author | boris.chiu@oracle.com |
Wed, 02 Sep 2015 11:01:59 -0700 | |
changeset 4835 | d5abd56e3fcf |
parent 4661 | 353f8a998732 |
permissions | -rw-r--r-- |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
1 |
#This patch was developed in-house. We plan to submit it upstream, but do |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
2 |
# not yet have a target date for doing so |
1196
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
3 |
# |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
4 |
diff -r -u /tmp/839450/libmlx4-1.0.1/Makefile.am libmlx4-1.0.1/Makefile.am |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
5 |
--- /tmp/839450/libmlx4-1.0.1/Makefile.am Tue Sep 8 06:40:35 2009 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
6 |
+++ libmlx4-1.0.1/Makefile.am Tue Mar 15 06:49:47 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
7 |
@@ -10,7 +10,7 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
8 |
src_libmlx4_la_SOURCES = $(MLX4_SOURCES) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
9 |
src_libmlx4_la_LDFLAGS = -avoid-version -release @IBV_DEVICE_LIBRARY_EXTENSION@ \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
10 |
$(mlx4_version_script) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
11 |
- mlx4confdir = $(sysconfdir)/libibverbs.d |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
12 |
+ mlx4confdir = $(datadir)/libibverbs.d |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
13 |
mlx4conf_DATA = mlx4.driver |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
14 |
else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
15 |
mlx4libdir = $(libdir)/infiniband |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
16 |
diff -r -u /tmp/839450/libmlx4-1.0.1/src/mlx4-abi.h libmlx4-1.0.1/src/mlx4-abi.h |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
17 |
--- /tmp/839450/libmlx4-1.0.1/src/mlx4-abi.h Thu Mar 10 04:48:34 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
18 |
+++ libmlx4-1.0.1/src/mlx4-abi.h Fri Feb 11 03:49:51 2011 |
4835
d5abd56e3fcf
21170572 libmlx4 should be built with the system mlnx_umap.h
boris.chiu@oracle.com
parents:
4661
diff
changeset
|
19 |
@@ -35,6 +35,10 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
20 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
21 |
#include <infiniband/kern-abi.h> |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
22 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
23 |
+#if defined(__SVR4) && defined(__sun) |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
24 |
+#include <sys/ib/adapters/mlnx_umap.h> / * Opaque CI data out definitions * / |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
25 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
26 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
27 |
#define MLX4_UVERBS_MIN_ABI_VERSION 2 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
28 |
#define MLX4_UVERBS_MAX_ABI_VERSION 3 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
29 |
|
4835
d5abd56e3fcf
21170572 libmlx4 should be built with the system mlnx_umap.h
boris.chiu@oracle.com
parents:
4661
diff
changeset
|
30 |
@@ -43,6 +47,10 @@ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
31 |
__u32 qp_tab_size; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
32 |
__u16 bf_reg_size; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
33 |
__u16 bf_regs_per_page; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
34 |
+#if defined(__SVR4) && defined(__sun) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
35 |
+ uint32_t muc_rev; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
36 |
+ uint32_t muc_reserved; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
37 |
+#endif |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
38 |
}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
39 |
|
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
40 |
struct mlx4_alloc_pd_resp { |
4835
d5abd56e3fcf
21170572 libmlx4 should be built with the system mlnx_umap.h
boris.chiu@oracle.com
parents:
4661
diff
changeset
|
41 |
@@ -51,23 +59,45 @@ |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
42 |
__u32 reserved; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
43 |
}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
44 |
|
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
45 |
+struct mlx4_share_pd_resp { |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
46 |
+ struct ibv_share_pd_resp ibv_resp; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
47 |
+ __u32 pdn; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
48 |
+ __u32 reserved; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
49 |
+}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
50 |
+ |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
51 |
struct mlx4_create_cq { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
52 |
struct ibv_create_cq ibv_cmd; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
53 |
+#if !(defined(__SVR4) && defined(__sun)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
54 |
__u64 buf_addr; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
55 |
__u64 db_addr; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
56 |
+#endif |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
57 |
}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
58 |
|
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
59 |
struct mlx4_create_cq_resp { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
60 |
struct ibv_create_cq_resp ibv_resp; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
61 |
+#if !(defined(__SVR4) && defined(__sun)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
62 |
__u32 cqn; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
63 |
__u32 reserved; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
64 |
+#else |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
65 |
+ mlnx_umap_cq_data_out_t mdd; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
66 |
+#endif |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
67 |
}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
68 |
|
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
69 |
struct mlx4_resize_cq { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
70 |
struct ibv_resize_cq ibv_cmd; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
71 |
+#if !(defined(__SVR4) && defined(__sun)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
72 |
__u64 buf_addr; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
73 |
+#endif |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
74 |
}; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
75 |
|
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
76 |
+#if defined(__SVR4) && defined(__sun) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
77 |
+struct mlx4_resize_cq_resp { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
78 |
+ struct ibv_resize_cq_resp ibv_resp; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
79 |
+ mlnx_umap_cq_data_out_t mdd; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
80 |
+}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
81 |
+#endif |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
82 |
+ |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
83 |
+ |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
84 |
#ifdef HAVE_IBV_XRC_OPS |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
85 |
struct mlx4_create_xrc_srq { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
86 |
struct ibv_create_xrc_srq ibv_cmd; |
4835
d5abd56e3fcf
21170572 libmlx4 should be built with the system mlnx_umap.h
boris.chiu@oracle.com
parents:
4661
diff
changeset
|
87 |
@@ -78,18 +108,25 @@ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
88 |
|
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
89 |
struct mlx4_create_srq { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
90 |
struct ibv_create_srq ibv_cmd; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
91 |
+#if !(defined(__SVR4) && defined(__sun)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
92 |
__u64 buf_addr; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
93 |
__u64 db_addr; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
94 |
+#endif |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
95 |
}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
96 |
|
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
97 |
struct mlx4_create_srq_resp { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
98 |
struct ibv_create_srq_resp ibv_resp; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
99 |
+#if !(defined(__SVR4) && defined(__sun)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
100 |
__u32 srqn; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
101 |
__u32 reserved; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
102 |
+#else |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
103 |
+ mlnx_umap_srq_data_out_t mdd; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
104 |
+#endif |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
105 |
}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
106 |
|
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
107 |
struct mlx4_create_qp { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
108 |
struct ibv_create_qp ibv_cmd; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
109 |
+#if !(defined(__SVR4) && defined(__sun)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
110 |
__u64 buf_addr; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
111 |
__u64 db_addr; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
112 |
__u8 log_sq_bb_count; |
4835
d5abd56e3fcf
21170572 libmlx4 should be built with the system mlnx_umap.h
boris.chiu@oracle.com
parents:
4661
diff
changeset
|
113 |
@@ -96,8 +133,16 @@ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
114 |
__u8 log_sq_stride; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
115 |
__u8 sq_no_prefetch; /* was reserved in ABI 2 */ |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
116 |
__u8 reserved[5]; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
117 |
+#endif |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
118 |
}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
119 |
|
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
120 |
+#if defined(__SVR4) && defined(__sun) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
121 |
+struct mlx4_create_qp_resp { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
122 |
+ struct ibv_create_qp_resp ibv_resp; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
123 |
+ mlnx_umap_qp_data_out_t mdd; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
124 |
+}; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
125 |
+#endif |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
126 |
+ |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
127 |
#ifdef HAVE_IBV_XRC_OPS |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
128 |
struct mlx4_open_xrc_domain_resp { |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
129 |
struct ibv_open_xrc_domain_resp ibv_resp; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
130 |
diff -r -u /tmp/839450/libmlx4-1.0.1/src/verbs.c libmlx4-1.0.1/src/verbs.c |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
131 |
--- /tmp/839450/libmlx4-1.0.1/src/verbs.c Thu Mar 10 04:48:34 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
132 |
+++ libmlx4-1.0.1/src/verbs.c Fri Mar 11 14:40:18 2011 |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
133 |
@@ -56,6 +56,14 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
134 |
if (ret) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
135 |
return ret; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
136 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
137 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
138 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
139 |
+ * To be consistent with OFED and so the queue operations in srq.c work |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
140 |
+ * we need to report the max as actual max less 1. In OFED this is |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
141 |
+ * done in the HCA driver. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
142 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
143 |
+ attr->max_srq_wr -=1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
144 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
145 |
major = (raw_fw_ver >> 32) & 0xffff; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
146 |
minor = (raw_fw_ver >> 16) & 0xffff; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
147 |
sub_minor = raw_fw_ver & 0xffff; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
148 |
@@ -95,6 +103,39 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
149 |
return &pd->ibv_pd; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
150 |
} |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
151 |
|
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
152 |
+struct ibv_shpd *mlx4_alloc_shpd(struct ibv_pd *pd, uint64_t share_key, struct ibv_shpd *shpd) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
153 |
+{ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
154 |
+ struct ibv_alloc_shpd cmd; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
155 |
+ struct ibv_alloc_shpd_resp resp; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
156 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
157 |
+ if (ibv_cmd_alloc_shpd(pd->context, pd, share_key, shpd, &cmd, sizeof cmd, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
158 |
+ &resp, sizeof resp)) { |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
159 |
+ return NULL; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
160 |
+ } |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
161 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
162 |
+ return shpd; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
163 |
+} |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
164 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
165 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
166 |
+struct ibv_pd *mlx4_share_pd(struct ibv_context *context, struct ibv_shpd *shpd, uint64_t share_key) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
167 |
+{ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
168 |
+ struct ibv_share_pd cmd; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
169 |
+ struct mlx4_share_pd_resp resp; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
170 |
+ struct mlx4_pd *pd; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
171 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
172 |
+ pd = malloc(sizeof *pd); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
173 |
+ if (!pd) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
174 |
+ return NULL; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
175 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
176 |
+ if (ibv_cmd_share_pd(context, shpd, share_key, &pd->ibv_pd, &cmd, sizeof cmd, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
177 |
+ &resp.ibv_resp, sizeof resp)) { |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
178 |
+ free(pd); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
179 |
+ return NULL; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
180 |
+ } |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
181 |
+ pd->pdn = resp.pdn; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
182 |
+ return &pd->ibv_pd; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
183 |
+} |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
184 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
185 |
int mlx4_free_pd(struct ibv_pd *pd) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
186 |
{ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
187 |
int ret; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
188 |
@@ -138,6 +179,37 @@ |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
189 |
return mr; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
190 |
} |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
191 |
|
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
192 |
+struct ibv_mr *mlx4_reg_mr_relaxed(struct ibv_pd *pd, void *addr, size_t length, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
193 |
+ int access) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
194 |
+{ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
195 |
+ struct ibv_mr *mr; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
196 |
+ struct ibv_reg_mr cmd; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
197 |
+ int ret; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
198 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
199 |
+ mr = malloc(sizeof *mr); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
200 |
+ if (!mr) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
201 |
+ return NULL; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
202 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
203 |
+#ifdef IBV_CMD_REG_MR_RELAXED_HAS_RESP_PARAMS |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
204 |
+ { |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
205 |
+ struct ibv_reg_mr_resp resp; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
206 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
207 |
+ ret = ibv_cmd_reg_mr_relaxed(pd, addr, length, (uintptr_t) addr, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
208 |
+ access, mr, &cmd, sizeof cmd, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
209 |
+ &resp, sizeof resp); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
210 |
+ } |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
211 |
+#else |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
212 |
+ ret = ibv_cmd_reg_mr_relaxed(pd, addr, length, (uintptr_t) addr, access, mr, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
213 |
+ &cmd, sizeof cmd); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
214 |
+#endif |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
215 |
+ if (ret) { |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
216 |
+ free(mr); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
217 |
+ return NULL; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
218 |
+ } |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
219 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
220 |
+ return mr; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
221 |
+} |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
222 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
223 |
int mlx4_dereg_mr(struct ibv_mr *mr) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
224 |
{ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
225 |
int ret; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
226 |
@@ -150,6 +222,29 @@ |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
227 |
return 0; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
228 |
} |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
229 |
|
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
230 |
+int mlx4_dereg_mr_relaxed(struct ibv_mr *mr) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
231 |
+{ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
232 |
+ int ret; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
233 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
234 |
+ ret = ibv_cmd_dereg_mr_relaxed(mr); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
235 |
+ if (ret) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
236 |
+ return ret; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
237 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
238 |
+ free(mr); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
239 |
+ return 0; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
240 |
+} |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
241 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
242 |
+int mlx4_flush_relaxed_mr(struct ibv_pd *pd) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
243 |
+{ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
244 |
+ int ret; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
245 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
246 |
+ ret = ibv_cmd_flush_relaxed_mr(pd); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
247 |
+ if (ret) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
248 |
+ return ret; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
249 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
250 |
+ return 0; |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
251 |
+} |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
252 |
+ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
253 |
static int align_queue_size(int req) |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
254 |
{ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
255 |
int nent; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
256 |
@@ -168,6 +263,9 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
257 |
struct mlx4_create_cq_resp resp; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
258 |
struct mlx4_cq *cq; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
259 |
int ret; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
260 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
261 |
+ void *cqbuf; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
262 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
263 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
264 |
/* Sanity check CQ size before proceeding */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
265 |
if (cqe > 0x3fffff) |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
266 |
@@ -184,7 +282,8 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
267 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
268 |
cqe = align_queue_size(cqe + 1); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
269 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
270 |
- if (mlx4_alloc_cq_buf(to_mdev(context->device), &cq->buf, cqe)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
271 |
+#if !(defined(__SVR4) && defined(__sun)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
272 |
+ if (mlx4_alloc_cq_buf((to_mdev(context->device), &cq->buf, cqe)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
273 |
goto err; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
274 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
275 |
cq->set_ci_db = mlx4_alloc_db(to_mctx(context), MLX4_DB_TYPE_CQ); |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
276 |
@@ -198,15 +297,73 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
277 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
278 |
cmd.buf_addr = (uintptr_t) cq->buf.buf; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
279 |
cmd.db_addr = (uintptr_t) cq->set_ci_db; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
280 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
281 |
+ cq->buf.buf = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
282 |
+ cq->buf.length = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
283 |
+ cq->arm_db = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
284 |
+ cq->set_ci_db = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
285 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
286 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
287 |
ret = ibv_cmd_create_cq(context, cqe - 1, channel, comp_vector, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
288 |
&cq->ibv_cq, &cmd.ibv_cmd, sizeof cmd, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
289 |
&resp.ibv_resp, sizeof resp); |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
290 |
if (ret) |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
291 |
+#if !(defined(__SVR4) && defined(__sun)) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
292 |
goto err_db; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
293 |
- |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
294 |
cq->cqn = resp.cqn; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
295 |
+#else |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
296 |
+ goto err; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
297 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
298 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
299 |
+ * For Solaris the kernel driver passes back mmap information for |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
300 |
+ * mapping the CQ memory it allocated. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
301 |
+ */ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
302 |
+ if (resp.mdd.mcq_rev < MLNX_UMAP_IF_VERSION) { |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
303 |
+ fprintf(stderr, PFX "libmlx4_create_cq: libmlx4/hermon umap " |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
304 |
+ "rev mismatch (kernel rev=%d)\n", resp.mdd.mcq_rev); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
305 |
+ goto err_destroy; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
306 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
307 |
+ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
308 |
+ cqbuf = mmap64((void *)0, resp.mdd.mcq_maplen, (PROT_READ | PROT_WRITE), |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
309 |
+ MAP_SHARED, context->mmap_fd, resp.mdd.mcq_mapoffset); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
310 |
+ |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
311 |
+ if (cqbuf == MAP_FAILED) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
312 |
+ goto err_destroy; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
313 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
314 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
315 |
+ * Extract hardware driver values for the number of CQEs and the |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
316 |
+ * hardware CQ number to use (needed for user space doorbells). |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
317 |
+ */ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
318 |
+ cqe = resp.mdd.mcq_numcqe; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
319 |
+ cq->cqn = resp.mdd.mcq_cqnum; |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
320 |
+ cq->buf.buf = cqbuf; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
321 |
+ cq->buf.length = resp.mdd.mcq_maplen; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
322 |
+ cq->ibv_cq.cqe = cqe-1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
323 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
324 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
325 |
+ * We map both poll and arm as seperate doorbells (OFED assumes 1 word |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
326 |
+ * offset and just bumps the address) since Solaris provides a |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
327 |
+ * separate offst. This will amount to the same thing (a second |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
328 |
+ * reference to the first doorbell is added) but is more flexible. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
329 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
330 |
+ cq->set_ci_db = mlx4_alloc_db(to_mctx(context), |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
331 |
+ resp.mdd.mcq_polldbr_mapoffset, resp.mdd.mcq_polldbr_maplen, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
332 |
+ resp.mdd.mcq_polldbr_offset); |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
333 |
+ |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
334 |
+ if (cq->set_ci_db == NULL) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
335 |
+ goto err_buf; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
336 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
337 |
+ cq->arm_db = mlx4_alloc_db(to_mctx(context), |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
338 |
+ resp.mdd.mcq_armdbr_mapoffset, resp.mdd.mcq_armdbr_maplen, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
339 |
+ resp.mdd.mcq_armdbr_offset); |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
340 |
+ |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
341 |
+ if (cq->arm_db == NULL) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
342 |
+ goto err_db; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
343 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
344 |
+ *cq->arm_db = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
345 |
+ cq->arm_sn = 1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
346 |
+ *cq->set_ci_db = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
347 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
348 |
return &cq->ibv_cq; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
349 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
350 |
err_db: |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
351 |
@@ -215,6 +372,21 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
352 |
err_buf: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
353 |
mlx4_free_buf(&cq->buf); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
354 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
355 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
356 |
+err_destroy: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
357 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
358 |
+ * Calling ibv_cmd_destroy_cq() will try and take the ibv_cq |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
359 |
+ * mutext that is initialised by the ibv_create_cq() entry point |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
360 |
+ * that called us AFETR we return, so its not initialised yet. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
361 |
+ * So initialised it here so the destroy call doesn't hang. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
362 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
363 |
+ pthread_mutex_init(&(cq->ibv_cq.mutex), NULL); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
364 |
+ pthread_cond_init(&(cq->ibv_cq.cond), NULL); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
365 |
+ cq->ibv_cq.comp_events_completed = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
366 |
+ cq->ibv_cq.async_events_completed = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
367 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
368 |
+ ibv_cmd_destroy_cq(&cq->ibv_cq); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
369 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
370 |
err: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
371 |
free(cq); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
372 |
|
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
373 |
@@ -227,10 +399,15 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
374 |
struct mlx4_resize_cq cmd; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
375 |
struct mlx4_buf buf; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
376 |
int old_cqe, outst_cqe, ret; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
377 |
- |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
378 |
+#if !(defined(__SVR4) && defined(__sun)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
379 |
+ struct ibv_resize_cq_resp resp; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
380 |
+#else |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
381 |
+ struct mlx4_resize_cq_resp resp; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
382 |
+ void *cqbuf; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
383 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
384 |
/* Sanity check CQ size before proceeding */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
385 |
if (cqe > 0x3fffff) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
386 |
- return EINVAL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
387 |
+ return EINVAL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
388 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
389 |
pthread_spin_lock(&cq->lock); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
390 |
|
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
391 |
@@ -247,32 +424,79 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
392 |
goto out; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
393 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
394 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
395 |
+#if !(defined(__SVR4) && defined(__sun)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
396 |
ret = mlx4_alloc_cq_buf(to_mdev(ibcq->context->device), &buf, cqe); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
397 |
if (ret) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
398 |
goto out; |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
399 |
- |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
400 |
- old_cqe = ibcq->cqe; |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
401 |
cmd.buf_addr = (uintptr_t) buf.buf; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
402 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
403 |
+ old_cqe = ibcq->cqe; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
404 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
405 |
#ifdef IBV_CMD_RESIZE_CQ_HAS_RESP_PARAMS |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
406 |
- { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
407 |
- struct ibv_resize_cq_resp resp; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
408 |
- ret = ibv_cmd_resize_cq(ibcq, cqe - 1, &cmd.ibv_cmd, sizeof cmd, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
409 |
+ ret = ibv_cmd_resize_cq(ibcq, cqe - 1, &cmd.ibv_cmd, sizeof cmd, |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
410 |
+#if !(defined(__SVR4) && defined(__sun)) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
411 |
&resp, sizeof resp); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
412 |
- } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
413 |
#else |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
414 |
+ &resp.ibv_resp, sizeof resp); |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
415 |
+#endif |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
416 |
+#else |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
417 |
ret = ibv_cmd_resize_cq(ibcq, cqe - 1, &cmd.ibv_cmd, sizeof cmd); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
418 |
#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
419 |
- if (ret) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
420 |
- mlx4_free_buf(&buf); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
421 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
422 |
+ if (ret) { |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
423 |
+#if !(defined(__SVR4) && defined(__sun)) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
424 |
+ mlx4_free_buf(&buf); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
425 |
goto out; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
426 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
427 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
428 |
- mlx4_cq_resize_copy_cqes(cq, buf.buf, old_cqe); |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
429 |
+ mlx4_cq_resize_copy_cqes(cq, buf.buf, old_cqe); |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
430 |
+ mlx4_free_buf(&cq->buf); |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
431 |
+ cq->buf = buf; |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
432 |
+#else |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
433 |
+ goto out; |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
434 |
+ } |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
435 |
+ if (cq->buf.buf != NULL) { |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
436 |
+ buf.buf = malloc(cq->buf.length); |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
437 |
+ if (!buf.buf) { |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
438 |
+ ret = ENOMEM; |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
439 |
+ goto out; |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
440 |
+ } |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
441 |
|
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
442 |
- mlx4_free_buf(&cq->buf); |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
443 |
- cq->buf = buf; |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
444 |
+ memcpy(buf.buf, cq->buf.buf, cq->buf.length); |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
445 |
+ buf.length = cq->buf.length; |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
446 |
+ ret = munmap((char *)cq->buf.buf, cq->buf.length); |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
447 |
+ if (ret) { |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
448 |
+ free(buf.buf); |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
449 |
+ goto out; |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
450 |
+ } |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
451 |
+ } |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
452 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
453 |
+ * For Solaris the kernel driver passes back mmap information for |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
454 |
+ * mapping the CQ memory it allocated. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
455 |
+ */ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
456 |
+ if (resp.mdd.mcq_rev < MLNX_UMAP_IF_VERSION) { |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
457 |
+ fprintf(stderr, PFX "libmlx4_resize_cq: libmlx4/hermon umap " |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
458 |
+ "rev mismatch (kernel rev=%d)\n", resp.mdd.mcq_rev); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
459 |
+ ret = EINVAL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
460 |
+ goto out; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
461 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
462 |
|
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
463 |
+ cqbuf = mmap64((void *)0, resp.mdd.mcq_maplen, (PROT_READ | PROT_WRITE), |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
464 |
+ MAP_SHARED, ibcq->context->mmap_fd, resp.mdd.mcq_mapoffset); |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
465 |
+ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
466 |
+ if (cqbuf == MAP_FAILED) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
467 |
+ ret = EINVAL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
468 |
+ goto out; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
469 |
+ } |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
470 |
+ cq->buf.buf = buf.buf; |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
471 |
+ cq->buf.length = buf.length; |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
472 |
+ mlx4_cq_resize_copy_cqes(cq, cqbuf, old_cqe); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
473 |
+ cq->buf.buf = cqbuf; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
474 |
+ cq->buf.length = resp.mdd.mcq_maplen; |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
475 |
+ free(buf.buf); |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
476 |
+ cq->ibv_cq.cqe = resp.mdd.mcq_numcqe - 1; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
477 |
+ cq->cqn = resp.mdd.mcq_cqnum; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
478 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
479 |
out: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
480 |
pthread_spin_unlock(&cq->lock); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
481 |
return ret; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
482 |
@@ -287,6 +511,9 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
483 |
return ret; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
484 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
485 |
mlx4_free_db(to_mctx(cq->context), MLX4_DB_TYPE_CQ, to_mcq(cq)->set_ci_db); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
486 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
487 |
+ mlx4_free_db(to_mctx(cq->context), MLX4_DB_TYPE_CQ, to_mcq(cq)->arm_db); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
488 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
489 |
mlx4_free_buf(&to_mcq(cq)->buf); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
490 |
free(to_mcq(cq)); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
491 |
|
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
492 |
@@ -300,6 +527,9 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
493 |
struct mlx4_create_srq_resp resp; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
494 |
struct mlx4_srq *srq; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
495 |
int ret; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
496 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
497 |
+ void *srqbuf; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
498 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
499 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
500 |
/* Sanity check SRQ size before proceeding */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
501 |
if (attr->attr.max_wr > 1 << 16 || attr->attr.max_sge > 64) |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
502 |
@@ -312,6 +542,7 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
503 |
if (pthread_spin_init(&srq->lock, PTHREAD_PROCESS_PRIVATE)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
504 |
goto err; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
505 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
506 |
+#if !(defined(__SVR4) && defined(__sun)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
507 |
srq->max = align_queue_size(attr->attr.max_wr + 1); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
508 |
srq->max_gs = attr->attr.max_sge; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
509 |
srq->counter = 0; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
510 |
@@ -327,23 +558,118 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
511 |
|
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
512 |
cmd.buf_addr = (uintptr_t) srq->buf.buf; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
513 |
cmd.db_addr = (uintptr_t) srq->db; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
514 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
515 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
516 |
+ * Solaris SRQ WQE memory is supplied by the kernel; we'll update |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
517 |
+ * these after the creation. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
518 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
519 |
+ srq->buf.buf = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
520 |
+ srq->buf.length = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
521 |
+ srq->db = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
522 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
523 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
524 |
+ * Need solaris to allocate space for the spare WR in |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
525 |
+ * the list that makes the queue work. The Solaris driver |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
526 |
+ * will round up to the nearest power of 2 as align_queue_size() |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
527 |
+ * does for OFED. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
528 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
529 |
+ attr->attr.max_wr += 1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
530 |
+#endif |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
531 |
+ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
532 |
ret = ibv_cmd_create_srq(pd, &srq->ibv_srq, attr, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
533 |
&cmd.ibv_cmd, sizeof cmd, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
534 |
&resp.ibv_resp, sizeof resp); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
535 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
536 |
+ if (ret) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
537 |
+ goto err; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
538 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
539 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
540 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
541 |
+ * The kernel driver passes back mmap information for mapping the |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
542 |
+ * SRQ work queue memory it allocated and the doorbell for |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
543 |
+ * for posting. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
544 |
+ */ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
545 |
+ if (resp.mdd.msrq_rev < 1) { |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
546 |
+ fprintf(stderr, PFX "libmlx4_create_srq libmlx4/hermon umap " |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
547 |
+ "rev mismatch (kernel rev=%d)\n", resp.mdd.msrq_rev); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
548 |
+ goto err_destroy; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
549 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
550 |
+ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
551 |
+ srqbuf = mmap64((void *)0, resp.mdd.msrq_maplen, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
552 |
+ (PROT_READ | PROT_WRITE), MAP_SHARED, pd->context->mmap_fd, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
553 |
+ resp.mdd.msrq_mapoffset); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
554 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
555 |
+ if (srqbuf == MAP_FAILED) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
556 |
+ goto err_destroy; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
557 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
558 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
559 |
+ srq->buf.buf = srqbuf; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
560 |
+ srq->buf.length = resp.mdd.msrq_maplen; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
561 |
+ srq->max = resp.ibv_resp.max_wr; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
562 |
+ srq->max_gs = resp.ibv_resp.max_sge; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
563 |
+ srq->srqn = resp.mdd.msrq_srqnum; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
564 |
+ srq->counter = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
565 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
566 |
+ srq->db = mlx4_alloc_db(to_mctx(pd->context), |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
567 |
+ resp.mdd.msrq_rdbr_mapoffset, resp.mdd.msrq_rdbr_maplen, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
568 |
+ resp.mdd.msrq_rdbr_offset); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
569 |
+ if (srq->db == NULL) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
570 |
+ goto err_unmap; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
571 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
572 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
573 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
574 |
+ * The following call only initializes memory and control structures, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
575 |
+ * it utilizes the memory allocated by the kernel. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
576 |
+ * It also allocates the srq->wrid memory. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
577 |
+ */ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
578 |
+ if (mlx4_set_srq_buf(pd, srq, resp.mdd.msrq_wqesz, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
579 |
+ resp.mdd.msrq_numwqe)) { |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
580 |
+ goto err_db; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
581 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
582 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
583 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
584 |
+ * The rturned max wr will have been rounded up to the nearest |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
585 |
+ * power of 2, subtracting 1 from that and rporting that value |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
586 |
+ * as the max will give us the required free WR in the queue, as |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
587 |
+ * in OFED. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
588 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
589 |
+ attr->attr.max_wr -= 1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
590 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
591 |
if (ret) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
592 |
goto err_db; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
593 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
594 |
srq->srqn = resp.srqn; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
595 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
596 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
597 |
return &srq->ibv_srq; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
598 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
599 |
err_db: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
600 |
mlx4_free_db(to_mctx(pd->context), MLX4_DB_TYPE_RQ, srq->db); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
601 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
602 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
603 |
+ if (srq->wrid) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
604 |
+ free(srq->wrid); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
605 |
+err_unmap: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
606 |
+ mlx4_free_buf(&srq->buf); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
607 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
608 |
+err_destroy: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
609 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
610 |
+ * Calling ibv_cmd_destroy_srq() will try and take the ibv_srq |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
611 |
+ * mutext that is initialised by the ibv_create_srq() entry point |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
612 |
+ * that called us AFETR we return, so its not initialised yet. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
613 |
+ * So initialised it here so the destroy call doesn't hang. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
614 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
615 |
+ pthread_mutex_init(&(srq->ibv_srq.mutex), NULL); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
616 |
+ pthread_cond_init(&(srq->ibv_srq.cond), NULL); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
617 |
+ srq->ibv_srq.events_completed = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
618 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
619 |
+ ibv_cmd_destroy_srq(&srq->ibv_srq); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
620 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
621 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
622 |
err_free: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
623 |
free(srq->wrid); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
624 |
mlx4_free_buf(&srq->buf); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
625 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
626 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
627 |
err: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
628 |
free(srq); |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
629 |
@@ -357,7 +683,16 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
630 |
{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
631 |
struct ibv_modify_srq cmd; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
632 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
633 |
+#if !(defined(__SVR4) && defined(__sun)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
634 |
return ibv_cmd_modify_srq(srq, attr, attr_mask, &cmd, sizeof cmd); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
635 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
636 |
+ int ret; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
637 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
638 |
+ attr->max_wr += 1; /* See create_srq */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
639 |
+ ret = ibv_cmd_modify_srq(srq, attr, attr_mask, &cmd, sizeof cmd); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
640 |
+ attr->max_wr -= 1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
641 |
+ return (ret); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
642 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
643 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
644 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
645 |
int mlx4_query_srq(struct ibv_srq *srq, |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
646 |
@@ -365,7 +700,17 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
647 |
{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
648 |
struct ibv_query_srq cmd; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
649 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
650 |
+#if !(defined(__SVR4) && defined(__sun)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
651 |
return ibv_cmd_query_srq(srq, attr, &cmd, sizeof cmd); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
652 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
653 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
654 |
+ int ret; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
655 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
656 |
+ ret = ibv_cmd_query_srq(srq, attr, &cmd, sizeof cmd); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
657 |
+ attr->max_wr -= 1; /* See create_srq */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
658 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
659 |
+ return (ret); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
660 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
661 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
662 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
663 |
int mlx4_destroy_srq(struct ibv_srq *ibsrq) |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
664 |
@@ -443,12 +788,16 @@ |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
665 |
struct ibv_qp *mlx4_create_qp(struct ibv_pd *pd, struct ibv_qp_init_attr *attr) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
666 |
{ |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
667 |
struct mlx4_create_qp cmd; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
668 |
- struct ibv_create_qp_resp resp; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
669 |
struct mlx4_qp *qp; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
670 |
int ret; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
671 |
struct mlx4_context *context = to_mctx(pd->context); |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
672 |
+#if !(defined(__SVR4) && defined(__sun)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
673 |
+ struct ibv_create_qp_resp resp; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
674 |
+#else |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
675 |
+ struct mlx4_create_qp_resp resp; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
676 |
+ void *qpbuf; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
677 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
678 |
|
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
679 |
- |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
680 |
/* Sanity check QP size before proceeding */ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
681 |
if (verify_sizes(attr, context)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
682 |
return NULL; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
683 |
@@ -457,6 +806,7 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
684 |
if (!qp) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
685 |
return NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
686 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
687 |
+#if !(defined(__SVR4) && defined(__sun)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
688 |
mlx4_calc_sq_wqe_size(&attr->cap, attr->qp_type, qp); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
689 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
690 |
/* |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
691 |
@@ -466,6 +816,7 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
692 |
qp->sq_spare_wqes = (2048 >> qp->sq.wqe_shift) + 1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
693 |
qp->sq.wqe_cnt = align_queue_size(attr->cap.max_send_wr + qp->sq_spare_wqes); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
694 |
qp->rq.wqe_cnt = align_queue_size(attr->cap.max_recv_wr); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
695 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
696 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
697 |
if (attr->srq || attr->qp_type == IBV_QPT_XRC) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
698 |
attr->cap.max_recv_wr = qp->rq.wqe_cnt = 0; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
699 |
@@ -476,6 +827,22 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
700 |
attr->cap.max_recv_wr = 1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
701 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
702 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
703 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
704 |
+ if (pthread_spin_init(&qp->sq.lock, PTHREAD_PROCESS_PRIVATE) || |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
705 |
+ pthread_spin_init(&qp->rq.lock, PTHREAD_PROCESS_PRIVATE)) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
706 |
+ goto err; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
707 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
708 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
709 |
+ * Solaris QP work queue memory is supplied by the kernel, so |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
710 |
+ * we will update this after creation. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
711 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
712 |
+ qp->buf.buf = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
713 |
+ qp->sq.wrid = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
714 |
+ qp->rq.wrid = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
715 |
+ qp->buf.length = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
716 |
+ qp->db = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
717 |
+ memset(&cmd, 0, sizeof(cmd)); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
718 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
719 |
if (mlx4_alloc_qp_buf(pd, &attr->cap, attr->qp_type, qp)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
720 |
goto err; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
721 |
|
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
722 |
@@ -505,10 +872,12 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
723 |
; /* nothing */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
724 |
cmd.sq_no_prefetch = 0; /* OK for ABI 2: just a reserved field */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
725 |
memset(cmd.reserved, 0, sizeof cmd.reserved); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
726 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
727 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
728 |
pthread_mutex_lock(&to_mctx(pd->context)->qp_table_mutex); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
729 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
730 |
ret = ibv_cmd_create_qp(pd, &qp->ibv_qp, attr, &cmd.ibv_cmd, sizeof cmd, |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
731 |
+#if !(defined(__SVR4) && defined(__sun)) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
732 |
&resp, sizeof resp); |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
733 |
if (ret) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
734 |
goto err_rq_db; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
735 |
@@ -516,6 +885,70 @@ |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
736 |
ret = mlx4_store_qp(to_mctx(pd->context), qp->ibv_qp.qp_num, qp); |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
737 |
if (ret) |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
738 |
goto err_destroy; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
739 |
+#else |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
740 |
+ &resp.ibv_resp, sizeof resp); |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
741 |
+ if (ret) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
742 |
+ goto err_free; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
743 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
744 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
745 |
+ * The kernel driver passes back mmap information for mapping the |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
746 |
+ * QP work queue memory it allocated back into user space. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
747 |
+ */ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
748 |
+ if (resp.mdd.mqp_rev < 2) { |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
749 |
+ fprintf(stderr, PFX "libmlx4_create_qp: libmlx4/hermon umap " |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
750 |
+ "rev mismatch (kernel rev=%d)\n", resp.mdd.mqp_rev); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
751 |
+ goto err_destroy; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
752 |
+ } |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
753 |
+ qpbuf = mmap64((void *)0, resp.mdd.mqp_maplen, (PROT_READ | PROT_WRITE), |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
754 |
+ MAP_SHARED, pd->context->mmap_fd, resp.mdd.mqp_mapoffset); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
755 |
+ |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
756 |
+ if (qpbuf == MAP_FAILED) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
757 |
+ goto err_destroy; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
758 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
759 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
760 |
+ * Need to set qp->buf here in case alloc_db fails then |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
761 |
+ * we'll call mlx4_free_buf() to umap. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
762 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
763 |
+ qp->buf.buf = qpbuf; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
764 |
+ qp->buf.length = resp.mdd.mqp_maplen; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
765 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
766 |
+ if (!attr->srq && attr->qp_type != IBV_QPT_XRC) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
767 |
+ qp->db = mlx4_alloc_db(to_mctx(pd->context), |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
768 |
+ resp.mdd.mqp_rdbr_mapoffset, resp.mdd.mqp_rdbr_maplen, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
769 |
+ resp.mdd.mqp_rdbr_offset); |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
770 |
+ if (qp->db == NULL) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
771 |
+ goto err_buf; |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
772 |
+ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
773 |
+ *qp->db = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
774 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
775 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
776 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
777 |
+ * Retrieve sendqueue actual size, and the number of headroom WQEs |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
778 |
+ * that were required based on kernel setup of prefetch or not for |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
779 |
+ * send queue. |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
780 |
+ * Note: mqp_sq_numwqe includes the head room wqes. The private |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
781 |
+ * wqe.cnt also includes headroom wqes, the verbs count |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
782 |
+ * should reflect the wqe count that is usable. |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
783 |
+ */ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
784 |
+ qp->sq_spare_wqes = resp.mdd.mqp_sq_headroomwqes; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
785 |
+ qp->sq.wqe_cnt = resp.mdd.mqp_sq_numwqe; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
786 |
+ |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
787 |
+ if (attr->srq) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
788 |
+ qp->rq.wqe_cnt = 0; |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
789 |
+ else |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
790 |
+ qp->rq.wqe_cnt = resp.mdd.mqp_rq_numwqe; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
791 |
+ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
792 |
+ if (mlx4_set_qp_buf(pd, qp, qpbuf, resp.mdd.mqp_maplen, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
793 |
+ resp.mdd.mqp_rq_wqesz, resp.mdd.mqp_rq_off, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
794 |
+ resp.mdd.mqp_sq_wqesz, resp.mdd.mqp_sq_off)) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
795 |
+ goto err_rq_db; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
796 |
+ |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
797 |
+ mlx4_init_qp_indices(qp); |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
798 |
+ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
799 |
+ ret = mlx4_store_qp(to_mctx(pd->context), qp->ibv_qp.qp_num, qp); |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
800 |
+ if (ret) |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
801 |
+ goto err_rq_db; |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
802 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
803 |
pthread_mutex_unlock(&to_mctx(pd->context)->qp_table_mutex); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
804 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
805 |
qp->rq.wqe_cnt = attr->cap.max_recv_wr; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
806 |
@@ -536,9 +969,38 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
807 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
808 |
return &qp->ibv_qp; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
809 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
810 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
811 |
+err_rq_db: |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
812 |
+ if (!attr->srq && attr->qp_type != IBV_QPT_XRC) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
813 |
+ mlx4_free_db(to_mctx(pd->context), MLX4_DB_TYPE_RQ, qp->db); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
814 |
+err_buf: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
815 |
+ mlx4_free_buf(&qp->buf); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
816 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
817 |
err_destroy: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
818 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
819 |
+ * Calling ibv_cmd_destroy_qp() will try and take the ibv_qp |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
820 |
+ * mutext that is initialised by the ibv_create_qp() entry point |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
821 |
+ * that called us AFETR we retrun, so its not initialised yet. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
822 |
+ * So initialised it here so the destroy call doesn't hang. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
823 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
824 |
+ pthread_mutex_init(&(qp->ibv_qp.mutex), NULL); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
825 |
+ pthread_cond_init(&(qp->ibv_qp.cond), NULL); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
826 |
+ qp->ibv_qp.events_completed = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
827 |
ibv_cmd_destroy_qp(&qp->ibv_qp); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
828 |
+err_free: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
829 |
+ pthread_mutex_unlock(&to_mctx(pd->context)->qp_table_mutex); |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
830 |
|
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
831 |
+ if (qp->sq.wrid) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
832 |
+ free(qp->sq.wrid); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
833 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
834 |
+ if (qp->rq.wrid) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
835 |
+ free(qp->rq.wrid); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
836 |
+err: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
837 |
+ free(qp); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
838 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
839 |
+err_destroy: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
840 |
+ ibv_cmd_destroy_qp(&qp->ibv_qp); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
841 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
842 |
err_rq_db: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
843 |
pthread_mutex_unlock(&to_mctx(pd->context)->qp_table_mutex); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
844 |
if (!attr->srq && attr->qp_type != IBV_QPT_XRC) |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
845 |
@@ -552,6 +1014,7 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
846 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
847 |
err: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
848 |
free(qp); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
849 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
850 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
851 |
return NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
852 |
} |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
853 |
@@ -745,6 +1208,13 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
854 |
struct ibv_cq *xrc_cq, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
855 |
struct ibv_srq_init_attr *attr) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
856 |
{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
857 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
858 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
859 |
+ * Not supported by Solaris kenrel driver. When/if supported |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
860 |
+ * this routine will need to be ported. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
861 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
862 |
+ return NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
863 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
864 |
struct mlx4_create_xrc_srq cmd; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
865 |
struct mlx4_create_srq_resp resp; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
866 |
struct mlx4_srq *srq; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
867 |
@@ -807,6 +1277,7 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
868 |
free(srq); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
869 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
870 |
return NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
871 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
872 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
873 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
874 |
struct ibv_xrc_domain *mlx4_open_xrc_domain(struct ibv_context *context, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
875 |
diff -r -u /tmp/839450/libmlx4-1.0.1/src/qp.c libmlx4-1.0.1/src/qp.c |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
876 |
--- /tmp/839450/libmlx4-1.0.1/src/qp.c Thu Mar 10 04:48:34 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
877 |
+++ libmlx4-1.0.1/src/qp.c Tue Mar 15 07:09:43 2011 |
1196
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
878 |
@@ -407,7 +407,8 @@ |
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
879 |
out: |
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
880 |
ctx = to_mctx(ibqp->context); |
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
881 |
|
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
882 |
- if (nreq == 1 && inl && size > 1 && size < ctx->bf_buf_size / 16) { |
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
883 |
+ if (ctx->ibv_ctx.device->blueflame_enabled && nreq == 1 && inl && |
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
884 |
+ size > 1 && size < ctx->bf_buf_size / 16) { |
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
885 |
ctrl->owner_opcode |= htonl((qp->sq.head & 0xffff) << 8); |
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
886 |
*(uint32_t *) (&ctrl->vlan_tag) |= qp->doorbell_qpn; |
cba083182ade
16425070 Need a way to disable blueflame on sparc in OFUV libraries
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
817
diff
changeset
|
887 |
/* |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
888 |
@@ -589,6 +590,59 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
889 |
; /* nothing */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
890 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
891 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
892 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
893 |
+int mlx4_set_qp_buf(struct ibv_pd *pd, struct mlx4_qp *qp, void *qpbuf, |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
894 |
+ uint64_t buflen, uint32_t rq_wqesz, uint32_t rq_off, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
895 |
+ uint32_t sq_wqesz, uint32_t sq_off) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
896 |
+{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
897 |
+ qp->buf.buf = qpbuf; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
898 |
+ qp->buf.length = buflen; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
899 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
900 |
+ qp->sq.wrid = malloc(qp->sq.wqe_cnt * sizeof (uint64_t)); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
901 |
+ if (!qp->sq.wrid) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
902 |
+ return -1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
903 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
904 |
+ if (qp->rq.wqe_cnt) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
905 |
+ qp->rq.wrid = malloc(qp->rq.wqe_cnt * sizeof (uint64_t)); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
906 |
+ if (!qp->rq.wrid) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
907 |
+ free(qp->sq.wrid); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
908 |
+ return -1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
909 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
910 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
911 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
912 |
+ for (qp->rq.wqe_shift = 4; 1 << qp->rq.wqe_shift < rq_wqesz; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
913 |
+ qp->rq.wqe_shift++) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
914 |
+ ; /* nothing */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
915 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
916 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
917 |
+ for (qp->sq.wqe_shift = 6; 1 << qp->sq.wqe_shift < sq_wqesz; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
918 |
+ qp->sq.wqe_shift++) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
919 |
+ ; /* nothing */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
920 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
921 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
922 |
+ qp->buf_size = (qp->rq.wqe_cnt << qp->rq.wqe_shift) + |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
923 |
+ (qp->sq.wqe_cnt << qp->sq.wqe_shift); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
924 |
+ if (qp->rq.wqe_shift > qp->sq.wqe_shift) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
925 |
+ qp->rq.offset = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
926 |
+ qp->sq.offset = qp->rq.wqe_cnt << qp->rq.wqe_shift; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
927 |
+ } else { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
928 |
+ qp->rq.offset = qp->sq.wqe_cnt << qp->sq.wqe_shift; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
929 |
+ qp->sq.offset = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
930 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
931 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
932 |
+ if ((long int)qp->buf.length < (long int)qp->buf_size) { |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
933 |
+ fprintf(stderr, PFX "QP kernel buffer size %lu < user buf " |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
934 |
+ "size %d\n", (unsigned long)qp->buf.length, qp->buf_size); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
935 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
936 |
+ if ((!rq_off && qp->rq.offset) || (!sq_off && qp->sq.offset)) { |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
937 |
+ fprintf(stderr, PFX "QP kernel and user out of sync on " |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
938 |
+ "buffer order\n"); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
939 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
940 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
941 |
+ memset(qp->buf.buf, 0, qp->buf_size); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
942 |
+ return 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
943 |
+} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
944 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
945 |
int mlx4_alloc_qp_buf(struct ibv_pd *pd, struct ibv_qp_cap *cap, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
946 |
enum ibv_qp_type type, struct mlx4_qp *qp) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
947 |
{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
948 |
diff -r -u /tmp/839450/libmlx4-1.0.1/src/mlx4.h libmlx4-1.0.1/src/mlx4.h |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
949 |
--- /tmp/839450/libmlx4-1.0.1/src/mlx4.h Thu Mar 10 04:48:34 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
950 |
+++ libmlx4-1.0.1/src/mlx4.h Fri Feb 11 04:05:04 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
951 |
@@ -202,7 +202,11 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
952 |
int xrc_srq_table_shift; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
953 |
int xrc_srq_table_mask; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
954 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
955 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
956 |
+ struct mlx4_db_page *db_page_list; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
957 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
958 |
struct mlx4_db_page *db_list[MLX4_NUM_DB_TYPE]; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
959 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
960 |
pthread_mutex_t db_list_mutex; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
961 |
}; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
962 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
963 |
@@ -351,7 +355,12 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
964 |
int mlx4_alloc_buf(struct mlx4_buf *buf, size_t size, int page_size); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
965 |
void mlx4_free_buf(struct mlx4_buf *buf); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
966 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
967 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
968 |
+uint32_t *mlx4_alloc_db(struct mlx4_context *context, uint64_t mapoffset, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
969 |
+ uint64_t maplen, uint32_t offset); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
970 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
971 |
uint32_t *mlx4_alloc_db(struct mlx4_context *context, enum mlx4_db_type type); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
972 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
973 |
void mlx4_free_db(struct mlx4_context *context, enum mlx4_db_type type, uint32_t *db); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
974 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
975 |
int mlx4_query_device(struct ibv_context *context, |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
976 |
@@ -360,11 +369,17 @@ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
977 |
struct ibv_port_attr *attr); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
978 |
|
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
979 |
struct ibv_pd *mlx4_alloc_pd(struct ibv_context *context); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
980 |
+struct ibv_shpd *mlx4_alloc_shpd(struct ibv_pd *pd, uint64_t share_key, struct ibv_shpd *shpd); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
981 |
+struct ibv_pd *mlx4_share_pd(struct ibv_context *context, struct ibv_shpd *shpd, uint64_t share_key); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
982 |
int mlx4_free_pd(struct ibv_pd *pd); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
983 |
|
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
984 |
struct ibv_mr *mlx4_reg_mr(struct ibv_pd *pd, void *addr, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
985 |
size_t length, int access); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
986 |
+struct ibv_mr *mlx4_reg_mr_relaxed(struct ibv_pd *pd, void *addr, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
987 |
+ size_t length, int access); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
988 |
int mlx4_dereg_mr(struct ibv_mr *mr); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
989 |
+int mlx4_dereg_mr_relaxed(struct ibv_mr *mr); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
990 |
+int mlx4_flush_relaxed_mr(struct ibv_pd *pd); |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
991 |
|
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
992 |
struct ibv_cq *mlx4_create_cq(struct ibv_context *context, int cqe, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
993 |
struct ibv_comp_channel *channel, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
994 |
@@ -388,8 +403,13 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
995 |
int mlx4_query_srq(struct ibv_srq *srq, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
996 |
struct ibv_srq_attr *attr); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
997 |
int mlx4_destroy_srq(struct ibv_srq *srq); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
998 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
999 |
+int mlx4_set_srq_buf(struct ibv_pd *pd, struct mlx4_srq *srq, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1000 |
+ uint32_t srq_wqesz, uint32_t srq_numwqe); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1001 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1002 |
int mlx4_alloc_srq_buf(struct ibv_pd *pd, struct ibv_srq_attr *attr, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1003 |
struct mlx4_srq *srq); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1004 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1005 |
void mlx4_free_srq_wqe(struct mlx4_srq *srq, int ind); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1006 |
int mlx4_post_srq_recv(struct ibv_srq *ibsrq, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1007 |
struct ibv_recv_wr *wr, |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1008 |
@@ -415,8 +435,14 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1009 |
void mlx4_calc_sq_wqe_size(struct ibv_qp_cap *cap, enum ibv_qp_type type, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1010 |
struct mlx4_qp *qp); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1011 |
int num_inline_segs(int data, enum ibv_qp_type type); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1012 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1013 |
+int mlx4_set_qp_buf(struct ibv_pd *pd, struct mlx4_qp *qp, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1014 |
+ void *qpbuf, uint64_t buflen, uint32_t rq_wqesz, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1015 |
+ uint32_t rq_off, uint32_t sq_wqesz, uint32_t sq_off); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1016 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1017 |
int mlx4_alloc_qp_buf(struct ibv_pd *pd, struct ibv_qp_cap *cap, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1018 |
enum ibv_qp_type type, struct mlx4_qp *qp); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1019 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1020 |
void mlx4_set_sq_sizes(struct mlx4_qp *qp, struct ibv_qp_cap *cap, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1021 |
enum ibv_qp_type type); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1022 |
struct mlx4_qp *mlx4_find_qp(struct mlx4_context *ctx, uint32_t qpn); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1023 |
diff -r -u /tmp/839450/libmlx4-1.0.1/src/srq.c libmlx4-1.0.1/src/srq.c |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1024 |
--- /tmp/839450/libmlx4-1.0.1/src/srq.c Thu Mar 10 04:48:34 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1025 |
+++ libmlx4-1.0.1/src/srq.c Fri Feb 11 04:05:05 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1026 |
@@ -124,6 +124,54 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1027 |
return err; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1028 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1029 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1030 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1031 |
+/* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1032 |
+ * The Solaris kernel allocates the SRQ WQE buffer, this routine |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1033 |
+ * initializes the control structures and buffer contents for the |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1034 |
+ * SRQ memory. That memory is mapped into the caller's address |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1035 |
+ * space prior to this call. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1036 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1037 |
+int mlx4_set_srq_buf(struct ibv_pd *pd, struct mlx4_srq *srq, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1038 |
+ uint32_t srq_wqesz, uint32_t srq_numwqe) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1039 |
+{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1040 |
+ struct mlx4_wqe_srq_next_seg *next; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1041 |
+ struct mlx4_wqe_data_seg *scatter; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1042 |
+ int i; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1043 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1044 |
+ srq->max = srq_numwqe; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1045 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1046 |
+ srq->wrid = malloc(srq->max * sizeof (uint64_t)); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1047 |
+ if (!srq->wrid) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1048 |
+ return -1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1049 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1050 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1051 |
+ for (srq->wqe_shift = 5; 1 << srq->wqe_shift < srq_wqesz; ++srq->wqe_shift) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1052 |
+ ; /* nothing */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1053 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1054 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1055 |
+ memset(srq->buf.buf, 0, srq->buf.length); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1056 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1057 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1058 |
+ * Now initialize the SRQ buffer so that all of the WQEs are |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1059 |
+ * linked into the list of free WQEs. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1060 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1061 |
+ for (i = 0; i < srq->max; ++i) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1062 |
+ next = get_wqe(srq, i); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1063 |
+ next->next_wqe_index = htons((i + 1) & (srq->max - 1)); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1064 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1065 |
+ for (scatter = (void *) (next + 1); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1066 |
+ (void *) scatter < (void *) next + (1 << srq->wqe_shift); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1067 |
+ ++scatter) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1068 |
+ scatter->lkey = htonl(MLX4_INVALID_LKEY); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1069 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1070 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1071 |
+ srq->head = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1072 |
+ srq->tail = srq->max - 1; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1073 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1074 |
+ return 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1075 |
+} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1076 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1077 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1078 |
int mlx4_alloc_srq_buf(struct ibv_pd *pd, struct ibv_srq_attr *attr, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1079 |
struct mlx4_srq *srq) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1080 |
{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1081 |
diff -r -u /tmp/839450/libmlx4-1.0.1/src/dbrec.c libmlx4-1.0.1/src/dbrec.c |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1082 |
--- /tmp/839450/libmlx4-1.0.1/src/dbrec.c Tue Sep 8 06:40:36 2009 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1083 |
+++ libmlx4-1.0.1/src/dbrec.c Fri Feb 11 04:05:04 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1084 |
@@ -41,7 +41,157 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1085 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1086 |
#include "mlx4.h" |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1087 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1088 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1089 |
+/* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1090 |
+ * In Solaris the doorbell UAR is setup by the kernel, we only |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1091 |
+ * mmap the offset specified for the doorbell into the user |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1092 |
+ * address space. A reference counted page list is maintained |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1093 |
+ * per user context of doorbell pages that have been mapped. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1094 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1095 |
struct mlx4_db_page { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1096 |
+ struct mlx4_db_page *prev, *next; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1097 |
+ uint32_t *dbp_page_addr; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1098 |
+ uint32_t *dbp_page_addr_end; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1099 |
+ uint64_t dbp_map_offset; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1100 |
+ uint64_t dbp_map_len; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1101 |
+ int fd; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1102 |
+ int dbp_use_cnt; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1103 |
+}; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1104 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1105 |
+/* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1106 |
+ * These are not required in Solaris, but we keep them to pass |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1107 |
+ * as dummy arguments so that the the doorbell function calls can |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1108 |
+ * keep the same API. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1109 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1110 |
+static const int db_size[] = { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1111 |
+ [MLX4_DB_TYPE_CQ] = 8, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1112 |
+ [MLX4_DB_TYPE_RQ] = 4, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1113 |
+}; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1114 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1115 |
+/* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1116 |
+ * Return a doorbell pointer for the specified map offset. If this |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1117 |
+ * offset has not been previously mapped it will be mmap'd and the |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1118 |
+ * appropriate doorbell returned; otherwise, the reference count |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1119 |
+ * will be updated and the appropriate doorbell will be returned. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1120 |
+ * Each successful call to mlx4_alloc_db() must call mlx4_free_db() |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1121 |
+ * to release the reference to the doorbell page when the doorbell |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1122 |
+ * is no longer required. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1123 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1124 |
+uint32_t *mlx4_alloc_db(struct mlx4_context *context, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1125 |
+ uint64_t mapoffset, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1126 |
+ uint64_t maplen, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1127 |
+ uint32_t offset) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1128 |
+{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1129 |
+ struct mlx4_db_page *page; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1130 |
+ uint32_t *db = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1131 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1132 |
+ pthread_mutex_lock(&context->db_list_mutex); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1133 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1134 |
+ for (page = context->db_page_list; page; page = page->next) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1135 |
+ if (page->dbp_map_offset == mapoffset && |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1136 |
+ page->fd == context->ibv_ctx.mmap_fd) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1137 |
+ if (page->dbp_map_len == maplen) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1138 |
+ goto found; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1139 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1140 |
+ fprintf(stderr, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1141 |
+ PFX "mlx4_alloc_db: Bad maplen (%" PRId64 ")\n", |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1142 |
+ maplen); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1143 |
+ goto out; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1144 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1145 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1146 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1147 |
+ page = malloc(sizeof(struct mlx4_db_page)); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1148 |
+ if (!page) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1149 |
+ fprintf(stderr, PFX "DB alloc memory allocate failure\n"); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1150 |
+ goto out; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1151 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1152 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1153 |
+ page->dbp_page_addr = (uint32_t *) mmap64((void *)0, maplen, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1154 |
+ (PROT_READ | PROT_WRITE), |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1155 |
+ MAP_SHARED, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1156 |
+ context->ibv_ctx.mmap_fd, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1157 |
+ mapoffset); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1158 |
+ if (page->dbp_page_addr == MAP_FAILED) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1159 |
+ fprintf(stderr, PFX |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1160 |
+ "Unable to map doorbell entry: maplen:%" PRId64 ", offset:%" PRId64 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1161 |
+ "\n", maplen, mapoffset); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1162 |
+ free(page); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1163 |
+ goto out; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1164 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1165 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1166 |
+ page->dbp_page_addr_end = (uint32_t *)((uint8_t *) page->dbp_page_addr + maplen); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1167 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1168 |
+ page->dbp_map_offset = mapoffset; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1169 |
+ page->dbp_map_len = maplen; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1170 |
+ page->dbp_use_cnt = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1171 |
+ page->fd = context->ibv_ctx.mmap_fd; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1172 |
+ page->next = context->db_page_list; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1173 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1174 |
+ if (context->db_page_list) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1175 |
+ context->db_page_list->prev = page; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1176 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1177 |
+ page->prev = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1178 |
+ context->db_page_list = page; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1179 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1180 |
+found: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1181 |
+ page->dbp_use_cnt++; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1182 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1183 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1184 |
+ db = (uint32_t *) ((uint8_t *)page->dbp_page_addr + offset); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1185 |
+out: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1186 |
+ pthread_mutex_unlock(&context->db_list_mutex); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1187 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1188 |
+ return db; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1189 |
+} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1190 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1191 |
+/* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1192 |
+ * Dereference doorbell page mappinge associated with the specified doorbell. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1193 |
+ * If this is the last doorbell that references a mapped region, then that |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1194 |
+ * region will be unmapped. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1195 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1196 |
+void mlx4_free_db(struct mlx4_context *context, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1197 |
+ enum mlx4_db_type dummy, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1198 |
+ uint32_t *db) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1199 |
+{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1200 |
+ struct mlx4_db_page *page; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1201 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1202 |
+ pthread_mutex_lock(&context->db_list_mutex); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1203 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1204 |
+ for (page = context->db_page_list; page; page = page->next) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1205 |
+ if (db >= page->dbp_page_addr && db < page->dbp_page_addr_end) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1206 |
+ break; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1207 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1208 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1209 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1210 |
+ if (page == NULL) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1211 |
+ fprintf(stderr, PFX "mlx4_free_db: Doorbell not mapped\n"); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1212 |
+ goto out; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1213 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1214 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1215 |
+ page->dbp_use_cnt--; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1216 |
+ if (page->dbp_use_cnt > 0) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1217 |
+ goto out; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1218 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1219 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1220 |
+ munmap((void *)page->dbp_page_addr, page->dbp_map_len); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1221 |
+ if (page->next) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1222 |
+ page->next->prev = page->prev; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1223 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1224 |
+ if (page->prev) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1225 |
+ page->prev->next = page->next; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1226 |
+ } else { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1227 |
+ context->db_page_list = page->next; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1228 |
+ } |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1229 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1230 |
+ free(page); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1231 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1232 |
+out: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1233 |
+ pthread_mutex_unlock(&context->db_list_mutex); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1234 |
+} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1235 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1236 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1237 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1238 |
+struct mlx4_db_page { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1239 |
struct mlx4_db_page *prev, *next; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1240 |
struct mlx4_buf buf; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1241 |
int num_db; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1242 |
@@ -152,3 +302,4 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1243 |
out: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1244 |
pthread_mutex_unlock(&context->db_list_mutex); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1245 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1246 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1247 |
diff -r -u /tmp/839450/libmlx4-1.0.1/src/buf.c libmlx4-1.0.1/src/buf.c |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1248 |
--- /tmp/839450/libmlx4-1.0.1/src/buf.c Tue Sep 8 06:41:26 2009 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1249 |
+++ libmlx4-1.0.1/src/buf.c Fri Feb 11 04:05:03 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1250 |
@@ -78,6 +78,8 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1251 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1252 |
void mlx4_free_buf(struct mlx4_buf *buf) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1253 |
{ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1254 |
+#if !(defined(__SVR4) && defined(__sun)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1255 |
ibv_dofork_range(buf->buf, buf->length); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1256 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1257 |
munmap(buf->buf, buf->length); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1258 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1259 |
diff -r -u /tmp/839450/libmlx4-1.0.1/src/mlx4.c libmlx4-1.0.1/src/mlx4.c |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1260 |
--- /tmp/839450/libmlx4-1.0.1/src/mlx4.c Thu Mar 10 04:48:34 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1261 |
+++ libmlx4-1.0.1/src/mlx4.c Fri Mar 11 14:05:26 2011 |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1262 |
@@ -112,8 +112,13 @@ |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1263 |
.query_port = mlx4_query_port, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1264 |
.alloc_pd = mlx4_alloc_pd, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1265 |
.dealloc_pd = mlx4_free_pd, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1266 |
+ .alloc_shpd = mlx4_alloc_shpd, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1267 |
+ .share_pd = mlx4_share_pd, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1268 |
.reg_mr = mlx4_reg_mr, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1269 |
+ .reg_mr_relaxed = mlx4_reg_mr_relaxed, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1270 |
.dereg_mr = mlx4_dereg_mr, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1271 |
+ .dereg_mr_relaxed = mlx4_dereg_mr_relaxed, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1272 |
+ .flush_relaxed_mr = mlx4_flush_relaxed_mr, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1273 |
.create_cq = mlx4_create_cq, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1274 |
.poll_cq = mlx4_poll_cq, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1275 |
.req_notify_cq = mlx4_arm_cq, |
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1276 |
@@ -144,6 +149,11 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1277 |
struct mlx4_alloc_ucontext_resp resp; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1278 |
int i; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1279 |
struct ibv_device_attr dev_attrs; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1280 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1281 |
+ pid_t cur_pid; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1282 |
+ off64_t uarpg_offset; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1283 |
+ uint32_t temp_qp_num; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1284 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1285 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1286 |
context = calloc(1, sizeof *context); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1287 |
if (!context) |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
1288 |
@@ -150,11 +160,29 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1289 |
return NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1290 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1291 |
context->ibv_ctx.cmd_fd = cmd_fd; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
1292 |
- |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1293 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1294 |
+ context->ibv_ctx.device = ibdev; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1295 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1296 |
if (ibv_cmd_get_context(&context->ibv_ctx, &cmd, sizeof cmd, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1297 |
&resp.ibv_resp, sizeof resp)) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1298 |
goto err_free; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1299 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1300 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1301 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1302 |
+ * OFED expects power of two, round up here to make user table |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1303 |
+ * large enough. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1304 |
+ */ |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1305 |
+ for (temp_qp_num = 1; temp_qp_num < resp.qp_tab_size; temp_qp_num <<= 1) |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1306 |
+ ; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1307 |
+ resp.qp_tab_size = temp_qp_num; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1308 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1309 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1310 |
+ * NOTE: In Solaris this value is not returned in the channel interface |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1311 |
+ * opaque data and is assumed to be 2*256 by the dapl code. We have |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1312 |
+ * made the same assumption here. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1313 |
+ */ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1314 |
+ resp.bf_reg_size = 512; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1315 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1316 |
context->num_qps = resp.qp_tab_size; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1317 |
context->qp_table_shift = ffs(context->num_qps) - 1 - MLX4_QP_TABLE_BITS; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1318 |
context->qp_table_mask = (1 << context->qp_table_shift) - 1; |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
1319 |
@@ -172,20 +200,45 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1320 |
for (i = 0; i < MLX4_XRC_SRQ_TABLE_SIZE; ++i) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1321 |
context->xrc_srq_table[i].refcnt = 0; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1322 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1323 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1324 |
+ context->db_page_list = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1325 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1326 |
for (i = 0; i < MLX4_NUM_DB_TYPE; ++i) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1327 |
context->db_list[i] = NULL; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1328 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1329 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1330 |
pthread_mutex_init(&context->db_list_mutex, NULL); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1331 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1332 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1333 |
+ cur_pid = getpid(); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1334 |
+ uarpg_offset = (((off64_t) cur_pid << MLNX_UMAP_RSRC_TYPE_SHIFT) | |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1335 |
+ MLNX_UMAP_UARPG_RSRC) * to_mdev(ibdev)->page_size; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1336 |
+ context->uar = mmap64((void *)0, to_mdev(ibdev)->page_size, PROT_WRITE, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1337 |
+ MAP_SHARED, context->ibv_ctx.mmap_fd, uarpg_offset); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1338 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1339 |
context->uar = mmap(NULL, to_mdev(ibdev)->page_size, PROT_WRITE, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1340 |
MAP_SHARED, cmd_fd, 0); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1341 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1342 |
if (context->uar == MAP_FAILED) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1343 |
goto err_free; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1344 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1345 |
if (resp.bf_reg_size) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1346 |
+#if defined(__SVR4) && defined(__sun) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1347 |
+ /* |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1348 |
+ * If kernel driver is supporting Blue Flame feature, map |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1349 |
+ * the Blue Flame user access region as well. |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1350 |
+ */ |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
1351 |
+ uarpg_offset = (((off64_t) cur_pid << MLNX_UMAP_RSRC_TYPE_SHIFT) |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
1352 |
+ | MLNX_UMAP_BLUEFLAMEPG_RSRC) * to_mdev(ibdev)->page_size; |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
1353 |
+ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1354 |
+ context->bf_page = mmap64((void *)0, to_mdev(ibdev)->page_size, |
4661
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
1355 |
+ PROT_WRITE, MAP_SHARED, context->ibv_ctx.mmap_fd, |
353f8a998732
PSARC 2015/310 IBTF and OFUV updates
boris.chiu@oracle.com
parents:
1196
diff
changeset
|
1356 |
+ uarpg_offset); |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1357 |
+#else |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1358 |
context->bf_page = mmap(NULL, to_mdev(ibdev)->page_size, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1359 |
PROT_WRITE, MAP_SHARED, cmd_fd, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1360 |
to_mdev(ibdev)->page_size); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1361 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1362 |
if (context->bf_page == MAP_FAILED) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1363 |
fprintf(stderr, PFX "Warning: BlueFlame available, " |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1364 |
"but failed to mmap() BlueFlame page.\n"); |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1365 |
@@ -214,6 +267,7 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1366 |
context->max_qp_wr = dev_attrs.max_qp_wr; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1367 |
context->max_sge = dev_attrs.max_sge; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1368 |
context->max_cqe = dev_attrs.max_cqe; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1369 |
+#ifdef HAVE_IBV_XRC_OPS |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1370 |
if (!(dev_attrs.device_cap_flags & IBV_DEVICE_XRC)) { |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1371 |
fprintf(stderr, PFX "There is a mismatch between " |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1372 |
"the kernel and the userspace libraries: " |
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1373 |
@@ -220,6 +274,7 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1374 |
"Kernel does not support XRC. Exiting.\n"); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1375 |
goto query_free; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1376 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1377 |
+#endif |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1378 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1379 |
return &context->ibv_ctx; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1380 |
|
817
f45ca7242301
7154945 userland FMR and shared PD OFUV libraries support
Christophe Juhasz <Chris.Juhasz@Sun.COM>
parents:
715
diff
changeset
|
1381 |
@@ -240,6 +295,7 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1382 |
munmap(context->uar, to_mdev(ibctx->device)->page_size); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1383 |
if (context->bf_page) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1384 |
munmap(context->bf_page, to_mdev(ibctx->device)->page_size); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1385 |
+ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1386 |
free(context); |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1387 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1388 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1389 |
diff -r -u /tmp/839450/libmlx4-1.0.1/configure.in libmlx4-1.0.1/configure.in |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1390 |
--- /tmp/839450/libmlx4-1.0.1/configure.in Thu Mar 10 04:48:34 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1391 |
+++ libmlx4-1.0.1/configure.in Tue Mar 15 07:41:46 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1392 |
@@ -43,11 +43,11 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1393 |
AC_C_CONST |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1394 |
AC_CHECK_SIZEOF(long) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1395 |
AC_CHECK_MEMBER(struct ibv_context.more_ops, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1396 |
- [AC_DEFINE([HAVE_IBV_MORE_OPS], 1, [Define to 1 if more_ops is a member of ibv_context])],, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1397 |
+ [AC_DEFINE([HAVE_IBV_MORE_OPS], 0, [Define to 1 if more_ops is a member of ibv_context])],, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1398 |
[#include <infiniband/verbs.h>]) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1399 |
-AC_CHECK_MEMBER(struct ibv_more_ops.create_xrc_srq, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1400 |
- [AC_DEFINE([HAVE_IBV_XRC_OPS], 1, [Define to 1 if have xrc ops])],, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1401 |
- [#include <infiniband/verbs.h>]) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1402 |
+#AC_CHECK_MEMBER(struct ibv_more_ops.create_xrc_srq, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1403 |
+# [AC_DEFINE([HAVE_IBV_XRC_OPS], 1, [Define to 1 if have xrc ops])],, |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1404 |
+# [#include <infiniband/verbs.h>]) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1405 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1406 |
dnl Checks for library functions |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1407 |
AC_CHECK_FUNC(ibv_read_sysfs_file, [], |
673
bb9df3c906be
PSARC 2012/033 automake 1.11.2
Rich Burridge <rich.burridge@oracle.com>
parents:
369
diff
changeset
|
1408 |
@@ -80,6 +80,5 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1409 |
fi |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1410 |
AC_SUBST(MLX4_VERSION_SCRIPT) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1411 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1412 |
-SHAVE_INIT([], [enable]) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1413 |
AC_CONFIG_FILES([Makefile libmlx4.spec shave shave-libtool]) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1414 |
AC_OUTPUT |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1415 |
diff -r -u /tmp/839450/libmlx4-1.0.1/libmlx4.spec.in libmlx4-1.0.1/libmlx4.spec.in |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1416 |
--- /tmp/839450/libmlx4-1.0.1/libmlx4.spec.in Thu Mar 10 00:23:34 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1417 |
+++ libmlx4-1.0.1/libmlx4.spec.in Tue Mar 15 07:43:54 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1418 |
@@ -6,7 +6,7 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1419 |
Group: System Environment/Libraries |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1420 |
License: GPLv2 or BSD |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1421 |
Url: http://openfabrics.org/ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1422 |
-Source: http://openfabrics.org/downloads/libmlx4/libmlx4-1.0.1.tar.gz |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1423 |
+Source: http://openfabrics.org/downloads/libmlx4-1.0.1.tar.gz |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1424 |
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1425 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1426 |
BuildRequires: libibverbs-devel >= 1.1-0.1.rc2 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1427 |
diff -r -u /tmp/839450/libmlx4-1.0.1/configure libmlx4-1.0.1/configure |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1428 |
--- /tmp/839450/libmlx4-1.0.1/configure Thu Mar 10 04:48:41 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1429 |
+++ libmlx4-1.0.1/configure Tue Mar 15 07:35:49 2011 |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1430 |
@@ -3899,13 +3899,13 @@ |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1431 |
CFLAGS=$ac_save_CFLAGS |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1432 |
elif test $ac_cv_prog_cc_g = yes; then |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1433 |
if test "$GCC" = yes; then |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1434 |
- CFLAGS="-g -O2" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1435 |
+ CFLAGS="-g -O3" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1436 |
else |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1437 |
CFLAGS="-g" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1438 |
fi |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1439 |
else |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1440 |
if test "$GCC" = yes; then |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1441 |
- CFLAGS="-O2" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1442 |
+ CFLAGS="-O3" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1443 |
else |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1444 |
CFLAGS= |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1445 |
fi |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1446 |
@@ -8890,6 +8890,7 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1447 |
;; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1448 |
esac |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1449 |
link_all_deplibs=yes |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1450 |
+ hardcode_libdir_flag_spec= |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1451 |
;; |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1452 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1453 |
sunos4*) |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1454 |
@@ -11113,13 +11114,13 @@ |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1455 |
CFLAGS=$ac_save_CFLAGS |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1456 |
elif test $ac_cv_prog_cc_g = yes; then |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1457 |
if test "$GCC" = yes; then |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1458 |
- CFLAGS="-g -O2" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1459 |
+ CFLAGS="-g -O3" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1460 |
else |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1461 |
CFLAGS="-g" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1462 |
fi |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1463 |
else |
715
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1464 |
if test "$GCC" = yes; then |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1465 |
- CFLAGS="-O2" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1466 |
+ CFLAGS="-O3" |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1467 |
else |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1468 |
CFLAGS= |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1469 |
fi |
eed3ed08f692
6926434 ib_read_bw, ib_read_lat: OFED utilities sometimes hang when using "-e" (event) flag
Boris Chiu <Boris.Chiu@oracle.COM>
parents:
673
diff
changeset
|
1470 |
@@ -11654,11 +11655,11 @@ |
369
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1471 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1472 |
ac_fn_c_check_member "$LINENO" "struct ibv_more_ops" "create_xrc_srq" "ac_cv_member_struct_ibv_more_ops_create_xrc_srq" "#include <infiniband/verbs.h> |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1473 |
" |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1474 |
-if test "x$ac_cv_member_struct_ibv_more_ops_create_xrc_srq" = x""yes; then : |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1475 |
+#if test "x$ac_cv_member_struct_ibv_more_ops_create_xrc_srq" = x""yes; then : |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1476 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1477 |
-$as_echo "#define HAVE_IBV_XRC_OPS 1" >>confdefs.h |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1478 |
+#$as_echo "#define HAVE_IBV_XRC_OPS 1" >>confdefs.h |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1479 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1480 |
-fi |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1481 |
+#fi |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1482 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1483 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1484 |
ac_fn_c_check_func "$LINENO" "ibv_read_sysfs_file" "ac_cv_func_ibv_read_sysfs_file" |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1485 |
diff -r -u /tmp/839450/libmlx4-1.0.1/Makefile.in libmlx4-1.0.1/Makefile.in |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1486 |
--- /tmp/839450/libmlx4-1.0.1/Makefile.in Thu Mar 10 04:48:40 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1487 |
+++ libmlx4-1.0.1/Makefile.in Tue Mar 15 07:48:16 2011 |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1488 |
@@ -264,7 +264,7 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1489 |
@HAVE_IBV_DEVICE_LIBRARY_EXTENSION_TRUE@src_libmlx4_la_LDFLAGS = -avoid-version -release @IBV_DEVICE_LIBRARY_EXTENSION@ \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1490 |
@HAVE_IBV_DEVICE_LIBRARY_EXTENSION_TRUE@ $(mlx4_version_script) |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1491 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1492 |
-@HAVE_IBV_DEVICE_LIBRARY_EXTENSION_TRUE@mlx4confdir = $(sysconfdir)/libibverbs.d |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1493 |
+@HAVE_IBV_DEVICE_LIBRARY_EXTENSION_TRUE@mlx4confdir = $(datadir)/libibverbs.d |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1494 |
@HAVE_IBV_DEVICE_LIBRARY_EXTENSION_TRUE@mlx4conf_DATA = mlx4.driver |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1495 |
@HAVE_IBV_DEVICE_LIBRARY_EXTENSION_FALSE@mlx4libdir = $(libdir)/infiniband |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1496 |
@HAVE_IBV_DEVICE_LIBRARY_EXTENSION_FALSE@mlx4lib_LTLIBRARIES = src/mlx4.la |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1497 |
@@ -345,8 +345,8 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1498 |
else :; fi; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1499 |
done; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1500 |
test -z "$$list2" || { \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1501 |
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1502 |
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1503 |
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) -m 755 $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1504 |
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) -m 755 $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1505 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1506 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1507 |
uninstall-libLTLIBRARIES: |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1508 |
@@ -376,8 +376,8 @@ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1509 |
else :; fi; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1510 |
done; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1511 |
test -z "$$list2" || { \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1512 |
- echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(mlx4libdir)'"; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1513 |
- $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(mlx4libdir)"; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1514 |
+ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) -m755 $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(mlx4libdir)'"; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1515 |
+ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) -m755 $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(mlx4libdir)"; \ |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1516 |
} |
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1517 |
|
cc8c00719da9
PSARC 2011/165 OFUV update of existing components
Boris Chiu <Boris.Chiu@Sun.COM>
parents:
diff
changeset
|
1518 |
uninstall-mlx4libLTLIBRARIES: |