[ofw] crash in mlx4 driver

Sean Hefty sean.hefty at intel.com
Mon Mar 16 12:04:10 PDT 2009


>I do not quite agree with that. As far as I remember, it was used only
>as PDO before WinVerbs\WinMad came.

When winverbs was added to the stack, this changed.  For comparison, here's
mlx4/kernel/hca/drv.c rev 1971:
 
__query_ci_ifc(...)
{
	...
	p_ifc->Verbs.p_hca_dev = &p_fdo->hca;

commit 200? changed this to:

	p_ifc->p_hca_obj = &p_fdo->hca;

(I can't find the exact SVN rev because I'm having problems getting to the SVN
repo at the moment.)  IOW, prior to this change a query for RDMA_INTERFACE_VERBS
did *not* return the PDO in struct ci_interface::p_hca_dev.  (And IBAL did not
query for RDMA_INTERFACE_VERBS.)

>Once more, my believe that it was WinVerbs\WinMad, that stored in this
>field the pointer to an internal structure of HCA driver.
>They should have gotten this pointer by calling open_ca like IBAL does
>in create_ci_ca().

The HCA drivers do not support multiple users calling open_ca.
 
>But QueryCa requires CA handle, so this field was overwritten with the
>value of CA handle, which made it to have the "dual usage".
>The right way was not to touch this field at all, but to perform OpenCa,
>which returns the needed handle.

Calling OpenCa to obtain the CA handle is one way of obtaining it.  Returning it
with the interface is another way.  I opted for the latter to minimize the
changes.

If you use the Linux stack as a guide, there are no open_ca/close_ca calls for
kernel users.  There's really not a need for them.

>But if you agree with the above and have no time for that, I can change
>WinVerbs\WinMad and remove this field back.
>It is really unnecessary.

For now, I've just rebuilt everything, so I don't see this as urgent.  But a
proper fix should be added before the next WinOF release. 

- Sean




More information about the ofw mailing list