@@ -19,6 +19,7 @@ static const struct ib_device_ops mana_ib_dev_ops = {
1919 .add_gid = mana_ib_gd_add_gid ,
2020 .alloc_pd = mana_ib_alloc_pd ,
2121 .alloc_ucontext = mana_ib_alloc_ucontext ,
22+ .create_ah = mana_ib_create_ah ,
2223 .create_cq = mana_ib_create_cq ,
2324 .create_qp = mana_ib_create_qp ,
2425 .create_rwq_ind_table = mana_ib_create_rwq_ind_table ,
@@ -27,6 +28,7 @@ static const struct ib_device_ops mana_ib_dev_ops = {
2728 .dealloc_ucontext = mana_ib_dealloc_ucontext ,
2829 .del_gid = mana_ib_gd_del_gid ,
2930 .dereg_mr = mana_ib_dereg_mr ,
31+ .destroy_ah = mana_ib_destroy_ah ,
3032 .destroy_cq = mana_ib_destroy_cq ,
3133 .destroy_qp = mana_ib_destroy_qp ,
3234 .destroy_rwq_ind_table = mana_ib_destroy_rwq_ind_table ,
@@ -44,6 +46,7 @@ static const struct ib_device_ops mana_ib_dev_ops = {
4446 .query_port = mana_ib_query_port ,
4547 .reg_user_mr = mana_ib_reg_user_mr ,
4648
49+ INIT_RDMA_OBJ_SIZE (ib_ah , mana_ib_ah , ibah ),
4750 INIT_RDMA_OBJ_SIZE (ib_cq , mana_ib_cq , ibcq ),
4851 INIT_RDMA_OBJ_SIZE (ib_pd , mana_ib_pd , ibpd ),
4952 INIT_RDMA_OBJ_SIZE (ib_qp , mana_ib_qp , ibqp ),
@@ -135,15 +138,22 @@ static int mana_ib_probe(struct auxiliary_device *adev,
135138 goto destroy_rnic ;
136139 }
137140
141+ dev -> av_pool = dma_pool_create ("mana_ib_av" , mdev -> gdma_context -> dev ,
142+ MANA_AV_BUFFER_SIZE , MANA_AV_BUFFER_SIZE , 0 );
143+ if (!dev -> av_pool )
144+ goto destroy_rnic ;
145+
138146 ret = ib_register_device (& dev -> ib_dev , "mana_%d" ,
139147 mdev -> gdma_context -> dev );
140148 if (ret )
141- goto destroy_rnic ;
149+ goto deallocate_pool ;
142150
143151 dev_set_drvdata (& adev -> dev , dev );
144152
145153 return 0 ;
146154
155+ deallocate_pool :
156+ dma_pool_destroy (dev -> av_pool );
147157destroy_rnic :
148158 xa_destroy (& dev -> qp_table_wq );
149159 mana_ib_gd_destroy_rnic_adapter (dev );
@@ -161,6 +171,7 @@ static void mana_ib_remove(struct auxiliary_device *adev)
161171 struct mana_ib_dev * dev = dev_get_drvdata (& adev -> dev );
162172
163173 ib_unregister_device (& dev -> ib_dev );
174+ dma_pool_destroy (dev -> av_pool );
164175 xa_destroy (& dev -> qp_table_wq );
165176 mana_ib_gd_destroy_rnic_adapter (dev );
166177 mana_ib_destroy_eqs (dev );
0 commit comments