]> git.openfabrics.org - ~shefty/libibverbs.git/commit
Fix unset context breakage when a low-level driver does kernel bypass
authorRoland Dreier <rolandd@cisco.com>
Wed, 31 Jan 2007 18:38:50 +0000 (10:38 -0800)
committerRoland Dreier <rolandd@cisco.com>
Wed, 31 Jan 2007 18:38:50 +0000 (10:38 -0800)
commit536d8ddbc7cb8710fb6a8d6e20632611ca915fa0
treeece7376cd38f7936d8aa042f1ccffe9e8b8702d7
parentc306ae92b00c54cfb05899bde06e693789fec8d2
Fix unset context breakage when a low-level driver does kernel bypass

Commit 8b3d2254 ("The ibv_cmd_* create functions need to set context")
breaks things when a low-level driver does not actually use an
ibv_cmd_* function to create an object, since then the context member
of that object never gets set.  For example, libmthca does not nee to
call into the kernel to create an AH, and hence ibv_destroy_ah() will
crash because it tries to call a function pointer from the AH's
context member, which never gets set.

Fix this by adding back all the setting of context to the main verbs
functions like ibv_create_ah() (but still leave the setting in the
ibv_cmd_* create functions too).  This means context gets set twice,
but that doesn't really hurt anything.  Once we branch off libibverbs
1.1 as stable, we can change the signatures of the ibv_cmd_* destroy
functions to take an explicit context parameter, and get rid of
setting context in the ibv_cmd_* create functions.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
src/verbs.c