Lines Matching refs:xrcd
1341 struct mlx4_ib_xrcd *xrcd; in mlx4_ib_alloc_xrcd() local
1348 xrcd = kmalloc(sizeof *xrcd, GFP_KERNEL); in mlx4_ib_alloc_xrcd()
1349 if (!xrcd) in mlx4_ib_alloc_xrcd()
1352 err = mlx4_xrcd_alloc(to_mdev(ibdev)->dev, &xrcd->xrcdn); in mlx4_ib_alloc_xrcd()
1356 xrcd->pd = ib_alloc_pd(ibdev, 0); in mlx4_ib_alloc_xrcd()
1357 if (IS_ERR(xrcd->pd)) { in mlx4_ib_alloc_xrcd()
1358 err = PTR_ERR(xrcd->pd); in mlx4_ib_alloc_xrcd()
1363 xrcd->cq = ib_create_cq(ibdev, NULL, NULL, xrcd, &cq_attr); in mlx4_ib_alloc_xrcd()
1364 if (IS_ERR(xrcd->cq)) { in mlx4_ib_alloc_xrcd()
1365 err = PTR_ERR(xrcd->cq); in mlx4_ib_alloc_xrcd()
1369 return &xrcd->ibxrcd; in mlx4_ib_alloc_xrcd()
1372 ib_dealloc_pd(xrcd->pd); in mlx4_ib_alloc_xrcd()
1374 mlx4_xrcd_free(to_mdev(ibdev)->dev, xrcd->xrcdn); in mlx4_ib_alloc_xrcd()
1376 kfree(xrcd); in mlx4_ib_alloc_xrcd()
1380 static int mlx4_ib_dealloc_xrcd(struct ib_xrcd *xrcd) in mlx4_ib_dealloc_xrcd() argument
1382 ib_destroy_cq(to_mxrcd(xrcd)->cq); in mlx4_ib_dealloc_xrcd()
1383 ib_dealloc_pd(to_mxrcd(xrcd)->pd); in mlx4_ib_dealloc_xrcd()
1384 mlx4_xrcd_free(to_mdev(xrcd->device)->dev, to_mxrcd(xrcd)->xrcdn); in mlx4_ib_dealloc_xrcd()
1385 kfree(xrcd); in mlx4_ib_dealloc_xrcd()