1 2006-11-09 Roland Dreier <rdreier@cisco.com>
3 * Release version 1.0.3.
5 2006-10-17 Roland Dreier <rdreier@cisco.com>
7 * src/cq.c, src/qp.c, src/srq.c: Convert existing uses of mb() to
8 rmb() or wmb() as appropriate. In fact all memory barriers were
9 really just wmb(), except for the barrier between reading a CQE's
10 ownership bit and contents, which should be rmb().
12 * src/mthca.h: Add compatibility defines of rmb()/wmb() so that
13 libmthca continues to build against old libibverbs releases.
15 2006-10-03 Roland Dreier <rdreier@cisco.com>
17 * src/cq.c (mthca_poll_one): Annotate so that Valgrind knows
18 contents of CQ entry are all valid after they are written by HCA.
19 (set_cqe_hw): Annotate so that CQ entries owned by hardware are
22 * src/mthca.h: Add wrapper for VALGRIND_MAKE_MEM_DEFINED so that
23 it can be used in .c files without worrying about whether Valgrind
24 is installed or enabled.
26 * configure.in: Add support for Valgrind annotation (enabled with
27 --with-valgrind option to configure).
29 * src/verbs.c (mthca_create_qp): Set reserved fields to 0 to avoid
30 future problems and also to make Valgrind a little quieter.
32 2006-09-04 Roland Dreier <rdreier@cisco.com>
34 * src/verbs.c (mthca_destroy_qp): Avoid potential AB-BA deadlock
35 when destroying QPs by always taking CQ locks in a consistent
36 order (lowest CQN first). The old code always took the send_cq
37 lock first, which is prone to deadlock if the send_cq of one QP is
38 the recv_cq of another QP destroyed at the same time. This bug
39 was pointed out by Dotan Barak and Jack Morgenstein.
41 2006-08-23 Roland Dreier <rdreier@cisco.com>
43 * src/verbs.c (mthca_resize_cq): Add a test for
44 IBV_CMD_RESIZE_CQ_HAS_RESP_PARAMS to make libmthca work with newer
45 libibverbs libraries that add two parameters to ibv_cmd_resize_cq().
47 2006-08-09 Michael S. Tsirkin <mst@mellanox.co.il>
49 * src/qp.c (mthca_tavor_post_send, mthca_arbel_post_send): Fence
50 bit must be set in both doorbell and WQE.
52 2006-08-03 Jack Morgenstein <jackm@mellanox.co.il>
54 * src/mthca.h: Include <stddef.h> to get definition of offsetof().
56 2006-08-03 Michael S. Tsirkin <mst@mellanox.co.il>
58 * src/verbs.c (mthca_create_srq): Limit SRQ max_wr to avoid
61 2006-07-26 Roland Dreier <rdreier@cisco.com>
63 * src/mthca.h, src/ah.c, src/cq.c, src/memfree.c, src/qp.c,
64 src/srq.c, src/verbs.c: Convert internal allocations for AH pages
65 (for non-memfree HCAs), CQ buffers, doorbell pages (for memfree
66 HCAs), QP buffers and SRQ buffers to use the new buffer
67 allocator. This makes libmthca fork()-clean when built against
70 * src/buf.c (mthca_alloc_buf, mthca_free_buf): Add new functions
71 to wrap up allocating page-aligned buffers. The new functions
72 will call ibv_dontfork_range()/ibv_dofork_range() to do proper
73 madvise()ing to handle fork(), if applicable.
75 * configure.in: Check for ibv_dontfork_range() and ibv_dontfork_range().
77 2006-07-04 Dotan Barak <dotanb@mellanox.co.il>
79 * src/verbs.c (mthca_create_cq, mthca_resize_cq): Passing huge
80 size values to create_cq/resize_cq causes a hang in
81 align_cq_size(). Fix this by validating input, similiar to what
82 we do for mthca_create_qp() and mthca_create_srq().
84 2006-06-13 Roland Dreier <rdreier@cisco.com>
86 * Release version 1.0.2.
88 2006-06-13 Michael S. Tsirkin <mst@mellanox.co.il>
90 * src/cq.c (mthca_poll_one): Add workaround for MemFree FW bug
91 that causes wrong WQE addr to be reported.
93 2006-05-24 Roland Dreier <rdreier@cisco.com>
95 * src/mthca.c: If <sysfs/libsysfs.h> is detected, include it
96 explicitly. This lets things build when sysfs headers are
97 installed on the build system even when building against
98 libibverbs 1.1 (which does not include sysfs headers implicitly).
100 * src/ah.c, src/cq.c, src/memfree.c, src/mthca.c, src/qp.c,
101 src/srq.c: Add include of <string.h>, since it may no long be
102 implicitly included from libsysfs headers when building with
105 2006-05-24 Michael S. Tsirkin <mst@mellanox.co.il>
107 * src/srq.c (mthca_tavor_post_srq_recv): Fix posting of lists of
108 receives that have exactly a multiple of 256 entries (same as QP
111 2006-05-22 Roland Dreier <rdreier@cisco.com>
113 * configure.in, src/mthca.c (openib_driver_init): Check for the
114 presence of <sysfs/libsysfs.h>, and if it is not installed, don't
115 export the old openib_driver_init() entry point.
117 2006-05-18 Michael S. Tsirkin <mst@mellanox.co.il>
119 * src/qp.c (mthca_tavor_post_recv): Fix posting of lists of
120 receives that have exactly a multiple of 256 entries.
122 2006-05-08 Jack Morgenstein <jackm@mellanox.co.il>
124 * src/mthca.c: Add include files needed for open() if
125 HAVE_IBV_READ_SYSFS_FILE is not defined (so libmthca includes a
126 private local definition of ibv_read_sysfs_file()).
128 2006-04-11 Roland Dreier <rdreier@cisco.com>
130 * src/mthca.c (ibv_driver_init, openib_driver_init): Add new
131 forward-compatible driver entry point. Make old entry point a
132 simple wrapper for the new one.
134 2006-03-14 Roland Dreier <rdreier@cisco.com>
136 * Release version 1.0.1.
138 * Makefile.am (EXTRA_DIST): Remove debian/ directory from
139 tarballs, since Debian policy is that upstream tarballs should not
142 2006-03-13 Roland Dreier <rdreier@cisco.com>
144 * Release version 1.0.
146 2006-02-27 Dotan Barak <dotanb@mellanox.co.il>
148 * src/qp.c (mthca_tavor_post_send, mthca_arbel_post_send): Add
149 support for IBV_SEND_FENCE flag.
151 2006-02-16 Roland Dreier <rdreier@cisco.com>
153 * src/memfree.c (mthca_alloc_db): Introduce a temporary variable
154 to pass to posix_memalign() to avoid "warning: dereferencing
155 type-punned pointer will break strict-aliasing rules."
157 * Release version 1.0-rc7.
159 2006-02-15 Roland Dreier <rdreier@cisco.com>
161 * src/verbs.c (mthca_create_qp): Update to add new response and
162 response size parameters for libibverbs ibv_cmd_create_qp().
164 2006-02-14 Roland Dreier <rdreier@cisco.com>
166 * Release version 1.0-rc6.
168 2006-02-13 Dotan Barak <dotanb@mellanox.co.il>
170 * src/verbs.c (mthca_query_qp, mthca_query_srq): Add query QP and
173 2006-01-31 Roland Dreier <rdreier@cisco.com>
175 * src/mthca.h: Remove useless "extern" from function declarations.
177 2006-01-30 Michael S. Tsirkin <mst@mellanox.co.il>
179 * src/qp.c (mthca_tavor_post_recv, mthca_arbel_post_recv): Pass
180 recv_cq to wq_overflow() so we lock the correct CQ. Noticed by
183 2006-01-26 Roland Dreier <rdreier@cisco.com>
185 * src/mthca.h, src/verbs.c, src/cq.c, src/mthca.c: Add
186 implementation of resize CQ operation.
188 * src/mthca-abi.h: Add mthca-specific resize CQ ABI.
190 2006-01-22 Roland Dreier <rdreier@cisco.com>
192 * Release version 1.0-rc5.
194 2006-01-11 Jack Morgenstein <jackm@mellanox.co.il>
196 * src/verbs.c (mthca_free_pd): Free pointer to correct structure
197 (we get lucky now, but don't rely on this).
198 * src/mthca.c (mthca_free_context): Free context's PD so we don't
201 2006-01-06 Michael S. Tsirkin <mst@mellanox.co.il>
203 * src/verbs.c (mthca_destroy_qp): Jack Morgenstein has discovered
204 the following race condition in libmthca:
206 Thread A destroys QP A at the kernel side by calling
207 ibv_cmd_destroy_qp, but its time-slice is over before removing it
208 from the user-space qp_table removal.
210 Thread B allocates QP B, receiving a QP number that matches the
211 just-destroyed QP A in the low 16 bits. Thread B will now
212 over-write the slot in qp_table which was used for QP A.
214 Thread A wakes up and clears qp_table slot, in effect removing QP
217 As a solution, remove the QP from qp_table before calling
218 ibv_cmd_destroy_qp. This also makes sense since operations are
219 performed in the reverse order in create_qp.
221 * src/cq.c (handle_error_cqe): Fill in vendor_err field for
222 completions with error.
224 2006-01-05 Jack Morgenstein <jackm@mellanox.co.il>
226 * src/verbs.c (mthca_destroy_qp, mthca_destroy_srq): Free QP/SRQ
227 object to avoid memory leak.
229 2005-12-15 Jack Morgenstein <jackm@mellanox.co.il>
231 * src/cq.c (mthca_cq_clean): When cleaning up a CQ, we should free
232 an SRQ WQE if and only if the CQE is a receive.
234 2005-12-15 Michael S. Tsirkin <mst@mellanox.co.il>
236 * src/qp.c (mthca_store_qp): Don't increment qp_table ref count if
239 2005-11-29 Michael S. Tsirkin <mst@mellanox.co.il>
241 * src/qp.c (mthca_arbel_post_send): Add handling for posting long
242 send lists for mem-free HCAs.
243 * src/qp.c (mthca_tavor_post_recv): Fix posting long receive
244 lists: nreq is set to zero early on, so we need to use
245 MTHCA_TAVOR_MAX_WQES_PER_RECV_DB as the increment to rq.head.
247 2005-11-28 Roland Dreier <roland@cisco.com>
249 * src/qp.c (mthca_init_qp_indices): Set qp->sq.last and
250 qp->rq.last so that QP is fully reset when the indices are
251 reinited on transition to RESET state.
252 (mthca_tavor_post_send, mthca_arbel_post_send): Don't create an
253 inline send segment when a work request is posted that has the
254 inline flag set but no gather entries included.
256 2005-11-09 Roland Dreier <roland@cisco.com>
258 * src/srq.c (mthca_tavor_post_srq_recv), src/qp.c
259 (mthca_tavor_post_recv): Fix bugs in long receive list handling;
260 need to set nreq to 0 and not put 256 credits into the second
263 * src/cq.c (mthca_cq_clean): Handle case where CQ indices wrap
264 around by treating signed comparisons of prod_index and
265 cq->cons_index carefully.
267 2005-11-09 Michael S. Tsirkin <mst@mellanox.co.il>
269 * src/srq.c (mthca_tavor_post_srq_recv), src/qp.c
270 (mthca_tavor_post_recv): Tavor requires that a doorbell be rung
271 at least every 256 receives, so add code to ring doorbells in the
272 middle of posting a huge list of receives.
274 * src/qp.c (mthca_tavor_post_send, mthca_tavor_post_send): When
275 posting atomic operations, could wqe size in "octowords" correctly.
277 * src/ah.c (mthca_alloc_av): Don't free ah if page allocation
278 fails. It will be freed where it's allocated, in the caller.
280 2005-11-08 Roland Dreier <roland@cisco.com>
282 * src/qp.c, src/verbs.c, src/mthca.h: Delegate setting of QP
283 capabilities (max_sge, max_inline_data, etc) to kernel.
285 2005-11-04 Roland Dreier <roland@cisco.com>
287 * src/verbs.c (mthca_destroy_qp): Clean CQEs when we destroy a QP.
288 (mthca_modify_qp): Clean CQEs when we move a QP to RESET state,
289 and reset QP index pointers.
291 * src/cq.c (mthca_cq_clean): Add function to clean out CQEs for
292 QPs that are being destroyed or reset.
294 2005-10-30 Roland Dreier <roland@cisco.com>
296 * src/srq.c (wqe_to_link): Change to use an offset of 12 (the imm
297 field), because posting an SRQ WQE may actually change the ee_nds
298 field and still cause free list corruption. A receive WQE will
299 never have immediate data, so using imm is definitely safe.
301 2005-10-25 Roland Dreier <roland@cisco.com>
303 * Release version 1.0-rc4.
305 2005-10-23 Roland Dreier <roland@cisco.com>
307 * src/qp.c (mthca_return_cap, mthca_alloc_qp_buf), src/verbs.c
308 (mthca_create_qp): Explicitly pass QP type to functions used while
309 creating QP, since we can't rely on ibv_qp.qp_type to be set until
310 after we return. This fixes breakage with UD QPs introduced in
311 the last change below.
313 2005-10-19 Roland Dreier <roland@cisco.com>
315 * src/mthca.h, src/verbs.c (mthca_create_qp), src/qp.c
316 (mthca_tavor_post_send, mthca_arbel_post_send, mthca_alloc_qp_buf,
317 mthca_return_cap): Eliminate struct mthca_qp.qpt field and use
318 struct ibv_qp.qp_type instead (now that that field has been added
321 2005-10-18 Roland Dreier <roland@cisco.com>
323 * src/cq.c (handle_error_cqe, mthca_poll_one): Dump CQEs for local
324 QP operation errors instead of all error statuses.
326 2005-10-06 Roland Dreier <roland@cisco.com>
328 * src/srq.c (mthca_free_srq_wqe): Pass index instead of WQE
329 address. The only caller already has the index handy, so there's
330 no need to recalculate it here.
332 * src/srq.c (mthca_tavor_post_srq_recv,
333 mthca_arbel_post_srq_recv): Add an extra check so that we report
334 the SRQ as full before using the one extra WQE we need internally.
336 2005-10-05 Roland Dreier <roland@cisco.com>
338 * src/verbs.c (mthca_modify_srq): Fill in mthca_modify_srq().
340 2005-09-29 Roland Dreier <roland@cisco.com>
342 * src/verbs.c (mthca_query_device): Update to match new libibverbs
343 API that requires device-specific libraries to format firmware version.
345 2005-09-25 Roland Dreier <roland@cisco.com>
347 * src/cq.c, src/mthca.c, src/mthca.h, src/verbs.c: Update to match
348 new libibverbs API introduced with completion channel implementation.
350 2005-09-13 Roland Dreier <roland@cisco.com>
352 * src/qp.c (mthca_tavor_post_send, mthca_tavor_post_recv,
353 mthca_arbel_post_send), src/srq.c (mthca_tavor_post_srq_recv):
354 Apply Michael S. Tsirkin's patch to fix linking of WQEs on
355 mem-free HCAs. While we're at it, simplify the Tavor WQE posting
356 code as well -- there's no need for a conditional, just always lik
359 2005-09-07 Roland Dreier <roland@cisco.com>
361 * src/mthca.h: Get rid of ntohll() and htonll() now that
362 libibverbs defines them in <infiniband/arch.h>.
364 2005-08-31 Roland Dreier <roland@cisco.com>
366 * src/memfree.c (mthca_free_db): When we free a doorbell record,
367 really mark it as free in the free bitmap. This we we don't
368 eventually run out of doorbells if a consumer creates and frees a
371 * src/memfree.c (mthca_alloc_db): Introduce MTHCA_FREE_MAP_SIZE so
372 that we iterate over the correct number of entries in the mem-free
373 doorbell record free maps. This fixes some off-by-a-factor-of-8
374 bugs that could lead to crashes.
376 * src/verbs.c (mthca_create_cq): In the mem-free case, when
377 creating a CQ fails to allocate an arm doorbell, make sure we free
378 the set CI doorbell instead of the (non-existent) arm doorbell.