1219820Sjeff2006-11-09  Roland Dreier  <rdreier@cisco.com>
2219820Sjeff
3219820Sjeff	* Release version 1.0.3.
4219820Sjeff
5219820Sjeff2006-10-17  Roland Dreier  <rdreier@cisco.com>
6219820Sjeff
7219820Sjeff	* src/cq.c, src/qp.c, src/srq.c: Convert existing uses of mb() to
8219820Sjeff	rmb() or wmb() as appropriate.  In fact all memory barriers were
9219820Sjeff	really just wmb(), except for the barrier between reading a CQE's
10219820Sjeff	ownership bit and contents, which should be rmb().
11219820Sjeff
12219820Sjeff	* src/mthca.h: Add compatibility defines of rmb()/wmb() so that
13219820Sjeff	libmthca continues to build against old libibverbs releases.
14219820Sjeff
15219820Sjeff2006-10-03  Roland Dreier  <rdreier@cisco.com>
16219820Sjeff
17219820Sjeff	* src/cq.c (mthca_poll_one): Annotate so that Valgrind knows
18219820Sjeff	contents of CQ entry are all valid after they are written by HCA.
19219820Sjeff	(set_cqe_hw): Annotate so that CQ entries owned by hardware are
20219820Sjeff	not defined.
21219820Sjeff
22219820Sjeff	* src/mthca.h: Add wrapper for VALGRIND_MAKE_MEM_DEFINED so that
23219820Sjeff	it can be used in .c files without worrying about whether Valgrind
24219820Sjeff	is installed or enabled.
25219820Sjeff
26219820Sjeff	* configure.in: Add support for Valgrind annotation (enabled with
27219820Sjeff	--with-valgrind option to configure).
28219820Sjeff
29219820Sjeff	* src/verbs.c (mthca_create_qp): Set reserved fields to 0 to avoid
30219820Sjeff	future problems and also to make Valgrind a little quieter.
31219820Sjeff
32219820Sjeff2006-09-04  Roland Dreier  <rdreier@cisco.com>
33219820Sjeff
34219820Sjeff	* src/verbs.c (mthca_destroy_qp): Avoid potential AB-BA deadlock
35219820Sjeff	when destroying QPs by always taking CQ locks in a consistent
36219820Sjeff	order (lowest CQN first).  The old code always took the send_cq
37219820Sjeff	lock first, which is prone to deadlock if the send_cq of one QP is
38219820Sjeff	the recv_cq of another QP destroyed at the same time.  This bug
39219820Sjeff	was pointed out by Dotan Barak and Jack Morgenstein.
40219820Sjeff
41219820Sjeff2006-08-23  Roland Dreier  <rdreier@cisco.com>
42219820Sjeff
43219820Sjeff	* src/verbs.c (mthca_resize_cq): Add a test for
44219820Sjeff	IBV_CMD_RESIZE_CQ_HAS_RESP_PARAMS to make libmthca work with newer
45219820Sjeff	libibverbs libraries that add two parameters to ibv_cmd_resize_cq().
46219820Sjeff
47219820Sjeff2006-08-09  Michael S. Tsirkin  <mst@mellanox.co.il>
48219820Sjeff
49219820Sjeff	* src/qp.c (mthca_tavor_post_send, mthca_arbel_post_send): Fence
50219820Sjeff	bit must be set in both doorbell and WQE.
51219820Sjeff
52219820Sjeff2006-08-03  Jack Morgenstein  <jackm@mellanox.co.il>
53219820Sjeff
54219820Sjeff	* src/mthca.h: Include <stddef.h> to get definition of offsetof().
55219820Sjeff
56219820Sjeff2006-08-03  Michael S. Tsirkin  <mst@mellanox.co.il>
57219820Sjeff
58219820Sjeff	* src/verbs.c (mthca_create_srq): Limit SRQ max_wr to avoid
59219820Sjeff	integer overflow.
60219820Sjeff
61219820Sjeff2006-07-26  Roland Dreier  <rdreier@cisco.com>
62219820Sjeff
63219820Sjeff	* src/mthca.h, src/ah.c, src/cq.c, src/memfree.c, src/qp.c,
64219820Sjeff	src/srq.c, src/verbs.c: Convert internal allocations for AH pages
65219820Sjeff	(for non-memfree HCAs), CQ buffers, doorbell pages (for memfree
66219820Sjeff	HCAs), QP buffers and SRQ buffers to use the new buffer
67219820Sjeff	allocator.  This makes libmthca fork()-clean when built against
68219820Sjeff	libibverbs 1.1.
69219820Sjeff
70219820Sjeff	* src/buf.c (mthca_alloc_buf, mthca_free_buf): Add new functions
71219820Sjeff	to wrap up allocating page-aligned buffers.  The new functions
72219820Sjeff	will call ibv_dontfork_range()/ibv_dofork_range() to do proper
73219820Sjeff	madvise()ing to handle fork(), if applicable.
74219820Sjeff
75219820Sjeff	* configure.in: Check for ibv_dontfork_range() and ibv_dontfork_range().
76219820Sjeff
77219820Sjeff2006-07-04  Dotan Barak  <dotanb@mellanox.co.il>
78219820Sjeff
79219820Sjeff	* src/verbs.c (mthca_create_cq, mthca_resize_cq): Passing huge
80219820Sjeff	size values to create_cq/resize_cq causes a hang in
81219820Sjeff	align_cq_size().  Fix this by validating input, similiar to what
82219820Sjeff	we do for mthca_create_qp() and mthca_create_srq().
83219820Sjeff
84219820Sjeff2006-06-13  Roland Dreier  <rdreier@cisco.com>
85219820Sjeff
86219820Sjeff	* Release version 1.0.2.
87219820Sjeff
88219820Sjeff2006-06-13  Michael S. Tsirkin  <mst@mellanox.co.il>
89219820Sjeff
90219820Sjeff	* src/cq.c (mthca_poll_one): Add workaround for MemFree FW bug
91219820Sjeff	that causes wrong WQE addr to be reported.
92219820Sjeff
93219820Sjeff2006-05-24  Roland Dreier  <rdreier@cisco.com>
94219820Sjeff
95219820Sjeff	* src/mthca.c: If <sysfs/libsysfs.h> is detected, include it
96219820Sjeff	explicitly.  This lets things build when sysfs headers are
97219820Sjeff	installed on the build system even when building against
98219820Sjeff	libibverbs 1.1 (which does not include sysfs headers implicitly).
99219820Sjeff
100219820Sjeff	* src/ah.c, src/cq.c, src/memfree.c, src/mthca.c, src/qp.c,
101219820Sjeff	src/srq.c: Add include of <string.h>, since it may no long be
102219820Sjeff	implicitly included from libsysfs headers when building with
103219820Sjeff	libibverbs 1.1.
104219820Sjeff
105219820Sjeff2006-05-24  Michael S. Tsirkin  <mst@mellanox.co.il>
106219820Sjeff
107219820Sjeff	* src/srq.c (mthca_tavor_post_srq_recv): Fix posting of lists of
108219820Sjeff	receives that have exactly a multiple of 256 entries (same as QP
109219820Sjeff	bug fixed below).
110219820Sjeff
111219820Sjeff2006-05-22  Roland Dreier  <rdreier@cisco.com>
112219820Sjeff
113219820Sjeff	* configure.in, src/mthca.c (openib_driver_init): Check for the
114219820Sjeff	presence of <sysfs/libsysfs.h>, and if it is not installed, don't
115219820Sjeff	export the old openib_driver_init() entry point.
116219820Sjeff
117219820Sjeff2006-05-18  Michael S. Tsirkin  <mst@mellanox.co.il>
118219820Sjeff
119219820Sjeff	* src/qp.c (mthca_tavor_post_recv): Fix posting of lists of
120219820Sjeff	receives that have exactly a multiple of 256 entries.
121219820Sjeff
122219820Sjeff2006-05-08  Jack Morgenstein  <jackm@mellanox.co.il>
123219820Sjeff
124219820Sjeff	* src/mthca.c: Add include files needed for open() if
125219820Sjeff	HAVE_IBV_READ_SYSFS_FILE is not defined (so libmthca includes a
126219820Sjeff	private local definition of ibv_read_sysfs_file()).
127219820Sjeff
128219820Sjeff2006-04-11  Roland Dreier  <rdreier@cisco.com>
129219820Sjeff
130219820Sjeff	* src/mthca.c (ibv_driver_init, openib_driver_init): Add new
131219820Sjeff	forward-compatible driver entry point.  Make old entry point a
132219820Sjeff	simple wrapper for the new one.
133219820Sjeff
134219820Sjeff2006-03-14  Roland Dreier  <rdreier@cisco.com>
135219820Sjeff
136219820Sjeff	* Release version 1.0.1.
137219820Sjeff
138219820Sjeff	* Makefile.am (EXTRA_DIST): Remove debian/ directory from
139219820Sjeff	tarballs, since Debian policy is that upstream tarballs should not
140219820Sjeff	include it.
141219820Sjeff
142219820Sjeff2006-03-13  Roland Dreier  <rdreier@cisco.com>
143219820Sjeff
144219820Sjeff	* Release version 1.0.
145219820Sjeff
146219820Sjeff2006-02-27  Dotan Barak  <dotanb@mellanox.co.il>
147219820Sjeff
148219820Sjeff	* src/qp.c (mthca_tavor_post_send, mthca_arbel_post_send): Add
149219820Sjeff	support for IBV_SEND_FENCE flag.
150219820Sjeff
151219820Sjeff2006-02-16  Roland Dreier  <rdreier@cisco.com>
152219820Sjeff
153219820Sjeff	* src/memfree.c (mthca_alloc_db): Introduce a temporary variable
154219820Sjeff	to pass to posix_memalign() to avoid "warning: dereferencing
155219820Sjeff	type-punned pointer will break strict-aliasing rules."
156219820Sjeff
157219820Sjeff	* Release version 1.0-rc7.
158219820Sjeff
159219820Sjeff2006-02-15  Roland Dreier  <rdreier@cisco.com>
160219820Sjeff
161219820Sjeff	* src/verbs.c (mthca_create_qp): Update to add new response and
162219820Sjeff	response size parameters for libibverbs ibv_cmd_create_qp().
163219820Sjeff
164219820Sjeff2006-02-14  Roland Dreier  <rdreier@cisco.com>
165219820Sjeff
166219820Sjeff	* Release version 1.0-rc6.
167219820Sjeff
168219820Sjeff2006-02-13  Dotan Barak  <dotanb@mellanox.co.il>
169219820Sjeff
170219820Sjeff	* src/verbs.c (mthca_query_qp, mthca_query_srq): Add query QP and
171219820Sjeff	query SRQ verbs.
172219820Sjeff
173219820Sjeff2006-01-31  Roland Dreier  <rdreier@cisco.com>
174219820Sjeff
175219820Sjeff	* src/mthca.h: Remove useless "extern" from function declarations.
176219820Sjeff
177219820Sjeff2006-01-30  Michael S. Tsirkin  <mst@mellanox.co.il>
178219820Sjeff
179219820Sjeff	* src/qp.c (mthca_tavor_post_recv, mthca_arbel_post_recv): Pass
180219820Sjeff	recv_cq to wq_overflow() so we lock the correct CQ.  Noticed by
181219820Sjeff	Yossi Leybovich.
182219820Sjeff
183219820Sjeff2006-01-26  Roland Dreier  <rdreier@cisco.com>
184219820Sjeff
185219820Sjeff	* src/mthca.h, src/verbs.c, src/cq.c, src/mthca.c: Add
186219820Sjeff	implementation of resize CQ operation.
187219820Sjeff
188219820Sjeff	* src/mthca-abi.h: Add mthca-specific resize CQ ABI.
189219820Sjeff
190219820Sjeff2006-01-22  Roland Dreier  <rdreier@cisco.com>
191219820Sjeff
192219820Sjeff	* Release version 1.0-rc5.
193219820Sjeff
194219820Sjeff2006-01-11  Jack Morgenstein  <jackm@mellanox.co.il>
195219820Sjeff
196219820Sjeff	* src/verbs.c (mthca_free_pd): Free pointer to correct structure
197219820Sjeff	(we get lucky now, but don't rely on this).
198219820Sjeff	* src/mthca.c (mthca_free_context): Free context's PD so we don't
199219820Sjeff	leak it.
200219820Sjeff
201219820Sjeff2006-01-06  Michael S. Tsirkin  <mst@mellanox.co.il>
202219820Sjeff
203219820Sjeff	* src/verbs.c (mthca_destroy_qp): Jack Morgenstein has discovered
204219820Sjeff	the following race condition in libmthca:
205219820Sjeff
206219820Sjeff	Thread A destroys QP A at the kernel side by calling
207219820Sjeff	ibv_cmd_destroy_qp, but its time-slice is over before removing it
208219820Sjeff	from the user-space qp_table removal.
209219820Sjeff
210219820Sjeff	Thread B allocates QP B, receiving a QP number that matches the
211219820Sjeff	just-destroyed QP A in the low 16 bits.  Thread B will now
212219820Sjeff	over-write the slot in qp_table which was used for QP A.
213219820Sjeff
214219820Sjeff	Thread A wakes up and clears qp_table slot, in effect removing QP
215219820Sjeff	B from qp_table.
216219820Sjeff
217219820Sjeff	As a solution, remove the QP from qp_table before calling
218219820Sjeff	ibv_cmd_destroy_qp.  This also makes sense since operations are
219219820Sjeff	performed in the reverse order in create_qp.
220219820Sjeff
221219820Sjeff	* src/cq.c (handle_error_cqe): Fill in vendor_err field for
222219820Sjeff	completions with error.
223219820Sjeff
224219820Sjeff2006-01-05  Jack Morgenstein  <jackm@mellanox.co.il>
225219820Sjeff
226219820Sjeff	* src/verbs.c (mthca_destroy_qp, mthca_destroy_srq): Free QP/SRQ
227219820Sjeff	object to avoid memory leak.
228219820Sjeff
229219820Sjeff2005-12-15  Jack Morgenstein  <jackm@mellanox.co.il>
230219820Sjeff
231219820Sjeff	* src/cq.c (mthca_cq_clean): When cleaning up a CQ, we should free
232219820Sjeff	an SRQ WQE if and only if the CQE is a receive.
233219820Sjeff
234219820Sjeff2005-12-15  Michael S. Tsirkin  <mst@mellanox.co.il>
235219820Sjeff
236219820Sjeff	* src/qp.c (mthca_store_qp): Don't increment qp_table ref count if
237219820Sjeff	allocation fails.
238219820Sjeff
239219820Sjeff2005-11-29  Michael S. Tsirkin  <mst@mellanox.co.il>
240219820Sjeff
241219820Sjeff	* src/qp.c (mthca_arbel_post_send): Add handling for posting long
242219820Sjeff	send lists for mem-free HCAs.
243219820Sjeff	* src/qp.c (mthca_tavor_post_recv): Fix posting long receive
244219820Sjeff	lists: nreq is set to zero early on, so we need to use
245219820Sjeff	MTHCA_TAVOR_MAX_WQES_PER_RECV_DB as the increment to rq.head.
246219820Sjeff
247219820Sjeff2005-11-28  Roland Dreier  <roland@cisco.com>
248219820Sjeff
249219820Sjeff	* src/qp.c (mthca_init_qp_indices): Set qp->sq.last and
250219820Sjeff	qp->rq.last so that QP is fully reset when the indices are
251219820Sjeff	reinited on transition to RESET state.
252219820Sjeff	(mthca_tavor_post_send, mthca_arbel_post_send): Don't create an
253219820Sjeff	inline send segment when a work request is posted that has the
254219820Sjeff	inline flag set but no gather entries included.
255219820Sjeff
256219820Sjeff2005-11-09  Roland Dreier  <roland@cisco.com>
257219820Sjeff
258219820Sjeff	* src/srq.c (mthca_tavor_post_srq_recv), src/qp.c
259219820Sjeff	(mthca_tavor_post_recv): Fix bugs in long receive list handling;
260219820Sjeff	need to set nreq to 0 and not put 256 credits into the second
261219820Sjeff	doorbell word.
262219820Sjeff
263219820Sjeff	* src/cq.c (mthca_cq_clean): Handle case where CQ indices wrap
264219820Sjeff	around by treating signed comparisons of prod_index and
265219820Sjeff	cq->cons_index carefully.
266219820Sjeff
267219820Sjeff2005-11-09  Michael S. Tsirkin  <mst@mellanox.co.il>
268219820Sjeff
269219820Sjeff	* src/srq.c (mthca_tavor_post_srq_recv), src/qp.c
270219820Sjeff	(mthca_tavor_post_recv): Tavor requires that a doorbell be rung
271219820Sjeff	at least every 256 receives, so add code to ring doorbells in the
272219820Sjeff	middle of posting a huge list of receives.
273219820Sjeff	
274219820Sjeff	* src/qp.c (mthca_tavor_post_send, mthca_tavor_post_send): When
275219820Sjeff	posting atomic operations, could wqe size in "octowords" correctly.
276219820Sjeff
277219820Sjeff	* src/ah.c (mthca_alloc_av): Don't free ah if page allocation
278219820Sjeff	fails.  It will be freed where it's allocated, in the caller.
279219820Sjeff
280219820Sjeff2005-11-08  Roland Dreier  <roland@cisco.com>
281219820Sjeff
282219820Sjeff	* src/qp.c, src/verbs.c, src/mthca.h: Delegate setting of QP
283219820Sjeff	capabilities (max_sge, max_inline_data, etc) to kernel.
284219820Sjeff
285219820Sjeff2005-11-04  Roland Dreier  <roland@cisco.com>
286219820Sjeff
287219820Sjeff	* src/verbs.c (mthca_destroy_qp): Clean CQEs when we destroy a QP.
288219820Sjeff	(mthca_modify_qp): Clean CQEs when we move a QP to RESET state,
289219820Sjeff	and reset QP index pointers.
290219820Sjeff
291219820Sjeff	* src/cq.c (mthca_cq_clean): Add function to clean out CQEs for
292219820Sjeff	QPs that are being destroyed or reset.
293219820Sjeff
294219820Sjeff2005-10-30  Roland Dreier  <roland@cisco.com>
295219820Sjeff
296219820Sjeff	* src/srq.c (wqe_to_link): Change to use an offset of 12 (the imm
297219820Sjeff	field), because posting an SRQ WQE may actually change the ee_nds
298219820Sjeff	field and still cause free list corruption.  A receive WQE will
299219820Sjeff	never have immediate data, so using imm is definitely safe.
300219820Sjeff
301219820Sjeff2005-10-25  Roland Dreier  <roland@cisco.com>
302219820Sjeff
303219820Sjeff	* Release version 1.0-rc4.
304219820Sjeff
305219820Sjeff2005-10-23  Roland Dreier  <roland@cisco.com>
306219820Sjeff
307219820Sjeff	* src/qp.c (mthca_return_cap, mthca_alloc_qp_buf), src/verbs.c
308219820Sjeff	(mthca_create_qp): Explicitly pass QP type to functions used while
309219820Sjeff	creating QP, since we can't rely on ibv_qp.qp_type to be set until
310219820Sjeff	after we return.  This fixes breakage with UD QPs introduced in
311219820Sjeff	the last change below.
312219820Sjeff
313219820Sjeff2005-10-19  Roland Dreier  <roland@cisco.com>
314219820Sjeff
315219820Sjeff	* src/mthca.h, src/verbs.c (mthca_create_qp), src/qp.c
316219820Sjeff	(mthca_tavor_post_send, mthca_arbel_post_send, mthca_alloc_qp_buf,
317219820Sjeff	mthca_return_cap): Eliminate struct mthca_qp.qpt field and use
318219820Sjeff	struct ibv_qp.qp_type instead (now that that field has been added
319219820Sjeff	in libibverbs).
320219820Sjeff
321219820Sjeff2005-10-18  Roland Dreier  <roland@cisco.com>
322219820Sjeff
323219820Sjeff	* src/cq.c (handle_error_cqe, mthca_poll_one): Dump CQEs for local
324219820Sjeff	QP operation errors instead of all error statuses.
325219820Sjeff
326219820Sjeff2005-10-06  Roland Dreier  <roland@cisco.com>
327219820Sjeff
328219820Sjeff	* src/srq.c (mthca_free_srq_wqe): Pass index instead of WQE
329219820Sjeff	address.  The only caller already has the index handy, so there's
330219820Sjeff	no need to recalculate it here.
331219820Sjeff	
332219820Sjeff	* src/srq.c (mthca_tavor_post_srq_recv,
333219820Sjeff	mthca_arbel_post_srq_recv): Add an extra check so that we report
334219820Sjeff	the SRQ as full before using the one extra WQE we need internally.
335219820Sjeff
336219820Sjeff2005-10-05  Roland Dreier  <roland@cisco.com>
337219820Sjeff
338219820Sjeff	* src/verbs.c (mthca_modify_srq): Fill in mthca_modify_srq().
339219820Sjeff
340219820Sjeff2005-09-29  Roland Dreier  <roland@cisco.com>
341219820Sjeff
342219820Sjeff	* src/verbs.c (mthca_query_device): Update to match new libibverbs
343219820Sjeff	API that requires device-specific libraries to format firmware version.
344219820Sjeff
345219820Sjeff2005-09-25  Roland Dreier  <roland@cisco.com>
346219820Sjeff
347219820Sjeff	* src/cq.c, src/mthca.c, src/mthca.h, src/verbs.c: Update to match
348219820Sjeff	new libibverbs API introduced with completion channel implementation.
349219820Sjeff
350219820Sjeff2005-09-13  Roland Dreier  <roland@cisco.com>
351219820Sjeff
352219820Sjeff	* src/qp.c (mthca_tavor_post_send, mthca_tavor_post_recv,
353219820Sjeff	mthca_arbel_post_send), src/srq.c (mthca_tavor_post_srq_recv):
354219820Sjeff	Apply Michael S. Tsirkin's patch to fix linking of WQEs on
355219820Sjeff	mem-free HCAs.  While we're at it, simplify the Tavor WQE posting
356219820Sjeff	code as well -- there's no need for a conditional, just always lik
357219820Sjeff	the previous WQE.
358219820Sjeff
359219820Sjeff2005-09-07  Roland Dreier  <roland@cisco.com>
360219820Sjeff
361219820Sjeff	* src/mthca.h: Get rid of ntohll() and htonll() now that
362219820Sjeff	libibverbs defines them in <infiniband/arch.h>.
363219820Sjeff
364219820Sjeff2005-08-31  Roland Dreier  <roland@cisco.com>
365219820Sjeff
366219820Sjeff	* src/memfree.c (mthca_free_db): When we free a doorbell record,
367219820Sjeff	really mark it as free in the free bitmap.  This we we don't
368219820Sjeff	eventually run out of doorbells if a consumer creates and frees a
369219820Sjeff	lot of objects.
370219820Sjeff
371219820Sjeff	* src/memfree.c (mthca_alloc_db): Introduce MTHCA_FREE_MAP_SIZE so
372219820Sjeff	that we iterate over the correct number of entries in the mem-free
373219820Sjeff	doorbell record free maps.  This fixes some off-by-a-factor-of-8
374219820Sjeff	bugs that could lead to crashes.
375219820Sjeff
376219820Sjeff	* src/verbs.c (mthca_create_cq): In the mem-free case, when
377219820Sjeff	creating a CQ fails to allocate an arm doorbell, make sure we free
378219820Sjeff	the set CI doorbell instead of the (non-existent) arm doorbell.
379