Lines Matching refs:rv
51 int rv = -EINVAL; in siw_mmap() local
68 rv = remap_vmalloc_range(vma, entry->address, 0); in siw_mmap()
69 if (rv) { in siw_mmap()
77 return rv; in siw_mmap()
85 int rv; in siw_alloc_ucontext() local
88 rv = -ENOMEM; in siw_alloc_ucontext()
96 rv = -EINVAL; in siw_alloc_ucontext()
99 rv = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); in siw_alloc_ucontext()
100 if (rv) in siw_alloc_ucontext()
110 siw_dbg(base_ctx->device, "failure %d. now %d context(s)\n", rv, in siw_alloc_ucontext()
113 return rv; in siw_alloc_ucontext()
169 int rv; in siw_query_port() local
173 rv = ib_get_eth_speed(base_dev, port, &attr->active_speed, in siw_query_port()
196 return rv; in siw_query_port()
203 int rv = siw_query_port(base_dev, port, &attr); in siw_get_port_immutable() local
205 if (rv) in siw_get_port_immutable()
206 return rv; in siw_get_port_immutable()
264 int rv; in siw_mmap_entry_insert() local
272 rv = rdma_user_mmap_entry_insert(&uctx->base_ucontext, in siw_mmap_entry_insert()
275 if (rv) { in siw_mmap_entry_insert()
306 int num_sqe, num_rqe, rv = 0; in siw_create_qp() local
316 rv = -ENOMEM; in siw_create_qp()
321 rv = -EOPNOTSUPP; in siw_create_qp()
329 rv = -EINVAL; in siw_create_qp()
335 rv = -EINVAL; in siw_create_qp()
344 rv = -EINVAL; in siw_create_qp()
350 rv = -EINVAL; in siw_create_qp()
359 rv = siw_qp_add(sdev, qp); in siw_create_qp()
360 if (rv) in siw_create_qp()
375 rv = -EINVAL; in siw_create_qp()
387 rv = -ENOMEM; in siw_create_qp()
394 rv = -EINVAL; in siw_create_qp()
420 rv = -ENOMEM; in siw_create_qp()
448 rv = -ENOMEM; in siw_create_qp()
460 rv = -ENOMEM; in siw_create_qp()
466 rv = -EINVAL; in siw_create_qp()
469 rv = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); in siw_create_qp()
470 if (rv) in siw_create_qp()
475 rv = -EINVAL; in siw_create_qp()
498 return rv; in siw_create_qp()
547 int rv = 0; in siw_verbs_modify_qp() local
583 rv = siw_qp_modify(qp, &new_attrs, siw_attr_mask); in siw_verbs_modify_qp()
587 return rv; in siw_verbs_modify_qp()
679 int rv = 0; in siw_sq_flush_wr() local
710 rv = -EINVAL; in siw_sq_flush_wr()
713 if (!rv) { in siw_sq_flush_wr()
715 rv = siw_sqe_complete(qp, &sqe, 0, in siw_sq_flush_wr()
718 if (rv) { in siw_sq_flush_wr()
725 return rv; in siw_sq_flush_wr()
733 int rv = 0; in siw_rq_flush_wr() local
737 rv = siw_rqe_complete(qp, &rqe, 0, 0, SIW_WC_WR_FLUSH_ERR); in siw_rq_flush_wr()
738 if (rv) { in siw_rq_flush_wr()
745 return rv; in siw_rq_flush_wr()
764 int rv = 0; in siw_post_send() local
787 rv = siw_sq_flush_wr(qp, wr, bad_wr); in siw_post_send()
792 rv = -ENOTCONN; in siw_post_send()
794 return rv; in siw_post_send()
805 rv = siw_sq_flush_wr(qp, wr, bad_wr); in siw_post_send()
810 rv = -ENOTCONN; in siw_post_send()
813 return rv; in siw_post_send()
823 rv = -ENOMEM; in siw_post_send()
828 rv = -EINVAL; in siw_post_send()
851 rv = siw_copy_inline_sgl(wr, sqe); in siw_post_send()
852 if (rv <= 0) { in siw_post_send()
853 rv = -EINVAL; in siw_post_send()
877 rv = -EINVAL; in siw_post_send()
900 rv = siw_copy_inline_sgl(wr, sqe); in siw_post_send()
901 if (unlikely(rv < 0)) { in siw_post_send()
902 rv = -EINVAL; in siw_post_send()
928 rv = -EINVAL; in siw_post_send()
935 if (unlikely(rv < 0)) in siw_post_send()
957 rv = siw_activate_tx(qp); in siw_post_send()
960 if (rv <= 0) in siw_post_send()
964 rv = siw_sq_start(qp); in siw_post_send()
977 if (rv >= 0) in siw_post_send()
982 siw_dbg_qp(qp, "error %d\n", rv); in siw_post_send()
985 return rv; in siw_post_send()
1002 int rv = 0; in siw_post_receive() local
1029 rv = siw_rq_flush_wr(qp, wr, bad_wr); in siw_post_receive()
1034 rv = -ENOTCONN; in siw_post_receive()
1036 return rv; in siw_post_receive()
1047 rv = siw_rq_flush_wr(qp, wr, bad_wr); in siw_post_receive()
1052 rv = -ENOTCONN; in siw_post_receive()
1055 return rv; in siw_post_receive()
1069 rv = -ENOMEM; in siw_post_receive()
1074 rv = -EINVAL; in siw_post_receive()
1093 if (rv < 0) { in siw_post_receive()
1094 siw_dbg_qp(qp, "error %d\n", rv); in siw_post_receive()
1097 return rv > 0 ? 0 : rv; in siw_post_receive()
1136 int rv, size = attr->cqe; in siw_create_cq() local
1143 rv = -ENOMEM; in siw_create_cq()
1148 rv = -EINVAL; in siw_create_cq()
1163 rv = -ENOMEM; in siw_create_cq()
1185 rv = -ENOMEM; in siw_create_cq()
1193 rv = -EINVAL; in siw_create_cq()
1196 rv = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); in siw_create_cq()
1197 if (rv) in siw_create_cq()
1203 siw_dbg(base_cq->device, "CQ creation failed: %d", rv); in siw_create_cq()
1215 return rv; in siw_create_cq()
1326 int rv; in siw_reg_user_mr() local
1334 rv = -ENOMEM; in siw_reg_user_mr()
1338 rv = -EINVAL; in siw_reg_user_mr()
1350 rv = -ENOMEM; in siw_reg_user_mr()
1356 rv = PTR_ERR(umem); in siw_reg_user_mr()
1357 siw_dbg_pd(pd, "getting user memory failed: %d\n", rv); in siw_reg_user_mr()
1363 rv = -ENOMEM; in siw_reg_user_mr()
1366 rv = siw_mr_add_mem(mr, pd, umem, start, len, rights); in siw_reg_user_mr()
1367 if (rv) in siw_reg_user_mr()
1375 rv = -EINVAL; in siw_reg_user_mr()
1378 rv = ib_copy_from_udata(&ureq, udata, sizeof(ureq)); in siw_reg_user_mr()
1379 if (rv) in siw_reg_user_mr()
1388 rv = -EINVAL; in siw_reg_user_mr()
1391 rv = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); in siw_reg_user_mr()
1392 if (rv) in siw_reg_user_mr()
1409 return ERR_PTR(rv); in siw_reg_user_mr()
1418 int rv; in siw_alloc_mr() local
1422 rv = -ENOMEM; in siw_alloc_mr()
1427 rv = -EOPNOTSUPP; in siw_alloc_mr()
1432 rv = -ENOMEM; in siw_alloc_mr()
1437 rv = PTR_ERR(pbl); in siw_alloc_mr()
1438 siw_dbg_pd(pd, "pbl allocation failed: %d\n", rv); in siw_alloc_mr()
1444 rv = -ENOMEM; in siw_alloc_mr()
1447 rv = siw_mr_add_mem(mr, pd, pbl, 0, max_sge * PAGE_SIZE, 0); in siw_alloc_mr()
1448 if (rv) in siw_alloc_mr()
1467 siw_dbg_pd(pd, "failed: %d\n", rv); in siw_alloc_mr()
1469 return ERR_PTR(rv); in siw_alloc_mr()
1487 int i, rv; in siw_map_mr_sg() local
1529 rv = ib_sg_to_pages(base_mr, sl, num_sle, sg_off, siw_set_pbl_page); in siw_map_mr_sg()
1530 if (rv > 0) { in siw_map_mr_sg()
1538 return rv; in siw_map_mr_sg()
1550 int rv; in siw_get_dma_mr() local
1554 rv = -ENOMEM; in siw_get_dma_mr()
1559 rv = -ENOMEM; in siw_get_dma_mr()
1562 rv = siw_mr_add_mem(mr, pd, NULL, 0, ULONG_MAX, rights); in siw_get_dma_mr()
1563 if (rv) in siw_get_dma_mr()
1573 if (rv) in siw_get_dma_mr()
1578 return ERR_PTR(rv); in siw_get_dma_mr()
1600 int rv; in siw_create_srq() local
1607 rv = -ENOMEM; in siw_create_srq()
1612 rv = -EINVAL; in siw_create_srq()
1630 rv = -ENOMEM; in siw_create_srq()
1641 rv = -ENOMEM; in siw_create_srq()
1648 rv = -EINVAL; in siw_create_srq()
1651 rv = ib_copy_to_udata(udata, &uresp, sizeof(uresp)); in siw_create_srq()
1652 if (rv) in siw_create_srq()
1669 return rv; in siw_create_srq()
1686 int rv = 0; in siw_modify_srq() local
1692 rv = -EOPNOTSUPP; in siw_modify_srq()
1698 rv = -EINVAL; in siw_modify_srq()
1710 return rv; in siw_modify_srq()
1774 int rv = 0; in siw_post_srq_recv() local
1779 rv = -EINVAL; in siw_post_srq_recv()
1795 rv = -ENOMEM; in siw_post_srq_recv()
1801 rv = -EINVAL; in siw_post_srq_recv()
1818 if (unlikely(rv < 0)) { in siw_post_srq_recv()
1819 siw_dbg_pd(base_srq->pd, "[SRQ]: error %d\n", rv); in siw_post_srq_recv()
1822 return rv; in siw_post_srq_recv()