On 3/26/2013 4:16 PM, [email protected] wrote: <snip>
@@ -236,23 +235,30 @@ found: return NULL; }- dev = malloc(sizeof *dev);+ dev = calloc(1, sizeof(*dev)); if (!dev) { fprintf(stderr, PFX "Fatal: couldn't allocate device for %s\n", uverbs_sys_path); return NULL; }- dev->ibv_dev.ops = mlx4_dev_ops;dev->page_size = sysconf(_SC_PAGESIZE); - - return &dev->ibv_dev; + dev->verbs_dev.sz = sizeof(*dev); + dev->verbs_dev.size_of_context = + sizeof(struct mlx4_context) - sizeof(struct ibv_context); + /* mlx4_init_context will initialize provider calls */ + dev->verbs_dev.init_context = mlx4_init_context; + dev->verbs_dev.uninit_context = mlx4_uninit_context; + + return &dev->verbs_dev; }+#ifdef HAVE_IBV_REGISTER_DRIVER static __attribute__((constructor)) void mlx4_register_driver(void) { - ibv_register_driver("mlx4", mlx4_driver_init); + verbs_register_driver("mlx4", mlx4_driver_init); + } #else
Shouldn't ibv_register_driver() need to be called in the lib constructor function if HAVE_IBV_REGISTER_DRIVER is not defined?
Steve. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
