Lines Matching refs:xrcd
760 struct mlx4_ib_xrcd *xrcd; in mlx4_ib_alloc_xrcd() local
766 xrcd = kmalloc(sizeof *xrcd, GFP_KERNEL); in mlx4_ib_alloc_xrcd()
767 if (!xrcd) in mlx4_ib_alloc_xrcd()
770 err = mlx4_xrcd_alloc(to_mdev(ibdev)->dev, &xrcd->xrcdn); in mlx4_ib_alloc_xrcd()
774 xrcd->pd = ib_alloc_pd(ibdev); in mlx4_ib_alloc_xrcd()
775 if (IS_ERR(xrcd->pd)) { in mlx4_ib_alloc_xrcd()
776 err = PTR_ERR(xrcd->pd); in mlx4_ib_alloc_xrcd()
780 xrcd->cq = ib_create_cq(ibdev, NULL, NULL, xrcd, 1, 0); in mlx4_ib_alloc_xrcd()
781 if (IS_ERR(xrcd->cq)) { in mlx4_ib_alloc_xrcd()
782 err = PTR_ERR(xrcd->cq); in mlx4_ib_alloc_xrcd()
786 return &xrcd->ibxrcd; in mlx4_ib_alloc_xrcd()
789 ib_dealloc_pd(xrcd->pd); in mlx4_ib_alloc_xrcd()
791 mlx4_xrcd_free(to_mdev(ibdev)->dev, xrcd->xrcdn); in mlx4_ib_alloc_xrcd()
793 kfree(xrcd); in mlx4_ib_alloc_xrcd()
797 static int mlx4_ib_dealloc_xrcd(struct ib_xrcd *xrcd) in mlx4_ib_dealloc_xrcd() argument
799 ib_destroy_cq(to_mxrcd(xrcd)->cq); in mlx4_ib_dealloc_xrcd()
800 ib_dealloc_pd(to_mxrcd(xrcd)->pd); in mlx4_ib_dealloc_xrcd()
801 mlx4_xrcd_free(to_mdev(xrcd->device)->dev, to_mxrcd(xrcd)->xrcdn); in mlx4_ib_dealloc_xrcd()
802 kfree(xrcd); in mlx4_ib_dealloc_xrcd()