• Home
  • Raw
  • Download

Lines Matching refs:rc

144 	int rc = 0;  in __smc_release()  local
147 rc = smc_close_active(smc); in __smc_release()
157 rc = kernel_sock_shutdown(smc->clcsock, in __smc_release()
178 return rc; in __smc_release()
185 int old_state, rc = 0; in smc_release() local
214 rc = __smc_release(smc); in smc_release()
224 return rc; in smc_release()
273 int rc; in smc_bind() local
278 rc = -EINVAL; in smc_bind()
282 rc = -EAFNOSUPPORT; in smc_bind()
295 rc = -EINVAL; in smc_bind()
300 rc = kernel_bind(smc->clcsock, uaddr, addr_len); in smc_bind()
305 return rc; in smc_bind()
365 int i, rc = 0; in smcr_lgr_reg_rmbs() local
367 rc = smc_llc_flow_initiate(lgr, SMC_LLC_FLOW_RKEY); in smcr_lgr_reg_rmbs()
368 if (rc) in smcr_lgr_reg_rmbs()
369 return rc; in smcr_lgr_reg_rmbs()
377 rc = smcr_link_reg_rmb(&lgr->lnk[i], rmb_desc); in smcr_lgr_reg_rmbs()
378 if (rc) in smcr_lgr_reg_rmbs()
383 rc = smc_llc_do_confirm_rkey(link, rmb_desc); in smcr_lgr_reg_rmbs()
384 if (rc) { in smcr_lgr_reg_rmbs()
385 rc = -EFAULT; in smcr_lgr_reg_rmbs()
392 return rc; in smcr_lgr_reg_rmbs()
399 int rc; in smcr_clnt_conf_first_link() local
411 rc = smc_clc_wait_msg(smc, &dclc, sizeof(dclc), in smcr_clnt_conf_first_link()
413 return rc == -EAGAIN ? SMC_CLC_DECL_TIMEOUT_CL : rc; in smcr_clnt_conf_first_link()
416 rc = smc_llc_eval_conf_link(qentry, SMC_LLC_REQ); in smcr_clnt_conf_first_link()
418 if (rc) in smcr_clnt_conf_first_link()
421 rc = smc_ib_modify_qp_rts(link); in smcr_clnt_conf_first_link()
422 if (rc) in smcr_clnt_conf_first_link()
434 rc = smc_llc_send_confirm_link(link, SMC_LLC_RESP); in smcr_clnt_conf_first_link()
435 if (rc < 0) in smcr_clnt_conf_first_link()
447 rc = smc_clc_wait_msg(smc, &dclc, sizeof(dclc), in smcr_clnt_conf_first_link()
449 if (rc == -EAGAIN) in smcr_clnt_conf_first_link()
450 rc = 0; /* no DECLINE received, go with one link */ in smcr_clnt_conf_first_link()
451 return rc; in smcr_clnt_conf_first_link()
662 int rc = 0; in smc_switch_to_fallback() local
666 rc = -EBADF; in smc_switch_to_fallback()
701 return rc; in smc_switch_to_fallback()
708 int rc = 0; in smc_connect_fallback() local
710 rc = smc_switch_to_fallback(smc, reason_code); in smc_connect_fallback()
711 if (rc) { /* fallback fails */ in smc_connect_fallback()
715 return rc; in smc_connect_fallback()
729 int rc; in smc_connect_decline_fallback() local
738 rc = smc_clc_send_decline(smc, reason_code, version); in smc_connect_decline_fallback()
739 if (rc < 0) { in smc_connect_decline_fallback()
743 return rc; in smc_connect_decline_fallback()
804 int rc = SMC_CLC_DECL_NOSMCDDEV; in smc_find_ism_v2_device_clnt() local
810 rc = 0; /* already initialized for V1 */ in smc_find_ism_v2_device_clnt()
823 rc = 0; in smc_find_ism_v2_device_clnt()
834 return rc; in smc_find_ism_v2_device_clnt()
849 int rc = 0; in smc_find_proposal_devices() local
873 rc = SMC_CLC_DECL_NOSMCDEV; in smc_find_proposal_devices()
875 return rc; in smc_find_proposal_devices()
901 int rc = 0; in smc_connect_clc() local
904 rc = smc_clc_send_proposal(smc, ini); in smc_connect_clc()
905 if (rc) in smc_connect_clc()
906 return rc; in smc_connect_clc()
1043 int rc = 0; in smc_connect_ism() local
1052 rc = smc_v2_determine_accepted_chid(aclc_v2, ini); in smc_connect_ism()
1053 if (rc) in smc_connect_ism()
1054 return rc; in smc_connect_ism()
1060 rc = smc_conn_create(smc, ini); in smc_connect_ism()
1061 if (rc) { in smc_connect_ism()
1063 return rc; in smc_connect_ism()
1067 rc = smc_buf_create(smc, true); in smc_connect_ism()
1068 if (rc) { in smc_connect_ism()
1069 rc = (rc == -ENOSPC) ? SMC_CLC_DECL_MAX_DMB : SMC_CLC_DECL_MEM; in smc_connect_ism()
1078 rc = smc_clc_send_confirm(smc, ini->first_contact_local, in smc_connect_ism()
1080 if (rc) in smc_connect_ism()
1095 return rc; in smc_connect_ism()
1124 int rc = 0; in __smc_connect() local
1153 rc = SMC_CLC_DECL_GETVLANERR; in __smc_connect()
1158 rc = smc_find_proposal_devices(smc, ini); in __smc_connect()
1159 if (rc) in __smc_connect()
1164 rc = SMC_CLC_DECL_MEM; in __smc_connect()
1171 rc = smc_connect_clc(smc, aclc2, ini); in __smc_connect()
1172 if (rc) in __smc_connect()
1176 rc = smc_connect_check_aclc(ini, aclc); in __smc_connect()
1179 if (rc) in __smc_connect()
1184 rc = smc_connect_rdma(smc, aclc, ini); in __smc_connect()
1186 rc = smc_connect_ism(smc, aclc, ini); in __smc_connect()
1187 if (rc) in __smc_connect()
1201 return smc_connect_decline_fallback(smc, rc, version); in __smc_connect()
1209 int rc = 0; in smc_connect_work() local
1218 rc = sk_stream_wait_connect(smc->clcsock->sk, &timeo); in smc_connect_work()
1219 if ((rc == -EPIPE) && in smc_connect_work()
1222 rc = 0; in smc_connect_work()
1226 if (rc != 0 || smc->sk.sk_err) { in smc_connect_work()
1228 if (rc == -EPIPE || rc == -EAGAIN) in smc_connect_work()
1230 else if (rc == -ECONNREFUSED) in smc_connect_work()
1238 rc = __smc_connect(smc); in smc_connect_work()
1239 if (rc < 0) in smc_connect_work()
1240 smc->sk.sk_err = -rc; in smc_connect_work()
1259 int rc = -EINVAL; in smc_connect() local
1274 rc = -EISCONN; in smc_connect()
1283 rc = -EALREADY; in smc_connect()
1286 rc = kernel_connect(smc->clcsock, addr, alen, flags); in smc_connect()
1287 if (rc && rc != -EINPROGRESS) in smc_connect()
1296 rc = -EINPROGRESS; in smc_connect()
1298 rc = __smc_connect(smc); in smc_connect()
1299 if (rc < 0) in smc_connect()
1302 rc = 0; /* success cases including fallback */ in smc_connect()
1308 return rc; in smc_connect()
1316 int rc = -EINVAL; in smc_clcsock_accept() local
1321 rc = -ENOMEM; in smc_clcsock_accept()
1331 rc = kernel_accept(lsmc->clcsock, &new_clcsock, SOCK_NONBLOCK); in smc_clcsock_accept()
1334 if (rc < 0 && rc != -EAGAIN) in smc_clcsock_accept()
1335 lsk->sk_err = -rc; in smc_clcsock_accept()
1336 if (rc < 0 || lsk->sk_state == SMC_CLOSED) { in smc_clcsock_accept()
1353 return rc; in smc_clcsock_accept()
1436 int rc; in smcr_serv_conf_first_link() local
1442 rc = smc_llc_send_confirm_link(link, SMC_LLC_REQ); in smcr_serv_conf_first_link()
1443 if (rc < 0) in smcr_serv_conf_first_link()
1452 rc = smc_clc_wait_msg(smc, &dclc, sizeof(dclc), in smcr_serv_conf_first_link()
1454 return rc == -EAGAIN ? SMC_CLC_DECL_TIMEOUT_CL : rc; in smcr_serv_conf_first_link()
1457 rc = smc_llc_eval_conf_link(qentry, SMC_LLC_RESP); in smcr_serv_conf_first_link()
1459 if (rc) in smcr_serv_conf_first_link()
1545 int rc = SMC_CLC_DECL_PEERNOSMC; in smc_listen_v2_check() local
1554 rc = SMC_CLC_DECL_PEERNOSMC; in smc_listen_v2_check()
1559 rc = SMC_CLC_DECL_NOISM2SUPP; in smc_listen_v2_check()
1565 rc = SMC_CLC_DECL_NOV2EXT; in smc_listen_v2_check()
1571 rc = SMC_CLC_DECL_NOV2DEXT; in smc_listen_v2_check()
1576 return rc; in smc_listen_v2_check()
1601 int rc; in smc_listen_rdma_init() local
1604 rc = smc_conn_create(new_smc, ini); in smc_listen_rdma_init()
1605 if (rc) in smc_listen_rdma_init()
1606 return rc; in smc_listen_rdma_init()
1619 int rc; in smc_listen_ism_init() local
1621 rc = smc_conn_create(new_smc, ini); in smc_listen_ism_init()
1622 if (rc) in smc_listen_ism_init()
1623 return rc; in smc_listen_ism_init()
1626 rc = smc_buf_create(new_smc, true); in smc_listen_ism_init()
1627 if (rc) { in smc_listen_ism_init()
1629 return (rc == -ENOSPC) ? SMC_CLC_DECL_MAX_DMB : in smc_listen_ism_init()
1671 static void smc_find_ism_store_rc(u32 rc, struct smc_init_info *ini) in smc_find_ism_store_rc() argument
1673 if (!ini->rc) in smc_find_ism_store_rc()
1674 ini->rc = rc; in smc_find_ism_store_rc()
1687 int i, rc; in smc_find_ism_v2_device_serv() local
1731 rc = smc_listen_ism_init(new_smc, ini); in smc_find_ism_v2_device_serv()
1732 if (rc) { in smc_find_ism_v2_device_serv()
1733 smc_find_ism_store_rc(rc, ini); in smc_find_ism_v2_device_serv()
1753 int rc = 0; in smc_find_ism_v1_device_serv() local
1760 rc = smc_find_ism_device(new_smc, ini); in smc_find_ism_v1_device_serv()
1761 if (rc) in smc_find_ism_v1_device_serv()
1764 rc = smc_listen_ism_init(new_smc, ini); in smc_find_ism_v1_device_serv()
1765 if (!rc) in smc_find_ism_v1_device_serv()
1769 smc_find_ism_store_rc(rc, ini); in smc_find_ism_v1_device_serv()
1792 int rc; in smc_find_rdma_v1_device_serv() local
1799 rc = smc_find_rdma_device(new_smc, ini); in smc_find_rdma_v1_device_serv()
1800 if (rc) { in smc_find_rdma_v1_device_serv()
1804 rc = SMC_CLC_DECL_NOSMCDEV; in smc_find_rdma_v1_device_serv()
1805 return rc; in smc_find_rdma_v1_device_serv()
1807 rc = smc_listen_rdma_init(new_smc, ini); in smc_find_rdma_v1_device_serv()
1808 if (rc) in smc_find_rdma_v1_device_serv()
1809 return rc; in smc_find_rdma_v1_device_serv()
1818 int rc; in smc_listen_find_device() local
1826 return ini->rc ?: SMC_CLC_DECL_NOSMCD2DEV; in smc_listen_find_device()
1829 rc = smc_listen_prfx_check(new_smc, pclc); in smc_listen_find_device()
1830 if (rc) in smc_listen_find_device()
1831 return ini->rc ?: rc; in smc_listen_find_device()
1835 return ini->rc ?: SMC_CLC_DECL_GETVLANERR; in smc_listen_find_device()
1844 return ini->rc ?: SMC_CLC_DECL_NOSMCDDEV; in smc_listen_find_device()
1847 rc = smc_find_rdma_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1848 smc_find_ism_store_rc(rc, ini); in smc_listen_find_device()
1850 return (!rc) ? 0 : ini->rc; in smc_listen_find_device()
1889 int rc = 0; in smc_listen_work() local
1901 rc = smc_switch_to_fallback(new_smc, SMC_CLC_DECL_PEERNOSMC); in smc_listen_work()
1902 if (rc) in smc_listen_work()
1914 rc = SMC_CLC_DECL_MEM; in smc_listen_work()
1918 rc = smc_clc_wait_msg(new_smc, pclc, sizeof(*buf), in smc_listen_work()
1920 if (rc) in smc_listen_work()
1926 rc = SMC_CLC_DECL_IPSEC; in smc_listen_work()
1932 rc = SMC_CLC_DECL_MEM; in smc_listen_work()
1937 rc = smc_listen_v2_check(new_smc, pclc, ini); in smc_listen_work()
1938 if (rc) in smc_listen_work()
1947 rc = smc_listen_find_device(new_smc, pclc, ini); in smc_listen_work()
1948 if (rc) in smc_listen_work()
1952 rc = smc_clc_send_accept(new_smc, ini->first_contact_local, in smc_listen_work()
1954 if (rc) in smc_listen_work()
1964 rc = smc_clc_wait_msg(new_smc, cclc, sizeof(*buf), in smc_listen_work()
1966 if (rc) { in smc_listen_work()
1974 rc = smc_listen_rdma_finish(new_smc, cclc, in smc_listen_work()
1976 if (rc) in smc_listen_work()
1988 smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0, in smc_listen_work()
2001 int rc = 0; in smc_tcp_listen_work() local
2005 rc = smc_clcsock_accept(lsmc, &new_smc); in smc_tcp_listen_work()
2006 if (rc) /* clcsock accept queue empty or error */ in smc_tcp_listen_work()
2048 int rc; in smc_listen() local
2053 rc = -EINVAL; in smc_listen()
2058 rc = 0; in smc_listen()
2077 rc = kernel_listen(smc->clcsock, backlog); in smc_listen()
2078 if (rc) { in smc_listen()
2088 return rc; in smc_listen()
2098 int rc = 0; in smc_accept() local
2105 rc = -EINVAL; in smc_accept()
2116 rc = -EAGAIN; in smc_accept()
2125 rc = sock_intr_errno(timeo); in smc_accept()
2132 if (!rc) in smc_accept()
2133 rc = sock_error(nsk); in smc_accept()
2135 if (rc) in smc_accept()
2158 return rc; in smc_accept()
2179 int rc; in smc_sendmsg() local
2188 rc = smc_switch_to_fallback(smc, SMC_CLC_DECL_OPTUNSUPP); in smc_sendmsg()
2189 if (rc) in smc_sendmsg()
2192 rc = -EINVAL; in smc_sendmsg()
2198 rc = -EPIPE; in smc_sendmsg()
2203 rc = smc->clcsock->ops->sendmsg(smc->clcsock, msg, len); in smc_sendmsg()
2205 rc = smc_tx_sendmsg(smc, msg, len); in smc_sendmsg()
2206 SMC_STAT_TX_PAYLOAD(smc, len, rc); in smc_sendmsg()
2210 return rc; in smc_sendmsg()
2218 int rc = -ENOTCONN; in smc_recvmsg() local
2224 rc = 0; in smc_recvmsg()
2233 rc = 0; in smc_recvmsg()
2238 rc = smc->clcsock->ops->recvmsg(smc->clcsock, msg, len, flags); in smc_recvmsg()
2241 rc = smc_rx_recvmsg(smc, msg, NULL, len, flags); in smc_recvmsg()
2242 SMC_STAT_RX_PAYLOAD(smc, rc, rc); in smc_recvmsg()
2247 return rc; in smc_recvmsg()
2321 int rc = -EINVAL; in smc_shutdown() local
2328 return rc; in smc_shutdown()
2332 rc = -ENOTCONN; in smc_shutdown()
2341 rc = kernel_sock_shutdown(smc->clcsock, how); in smc_shutdown()
2352 rc = smc_close_active(smc); in smc_shutdown()
2358 rc = smc_close_shutdown_write(smc); in smc_shutdown()
2361 rc = 0; in smc_shutdown()
2372 return rc ? rc : rc1; in smc_shutdown()
2380 int val, rc; in smc_setsockopt() local
2396 rc = -EOPNOTSUPP; in smc_setsockopt()
2398 rc = smc->clcsock->ops->setsockopt(smc->clcsock, level, optname, in smc_setsockopt()
2412 if (rc || smc->use_fallback) in smc_setsockopt()
2421 rc = smc_switch_to_fallback(smc, SMC_CLC_DECL_OPTUNSUPP); in smc_setsockopt()
2423 rc = -EINVAL; in smc_setsockopt()
2457 return rc; in smc_setsockopt()
2464 int rc; in smc_getsockopt() local
2477 rc = smc->clcsock->ops->getsockopt(smc->clcsock, level, optname, in smc_getsockopt()
2480 return rc; in smc_getsockopt()
2569 int rc = -EPIPE; in smc_sendpage() local
2579 rc = kernel_sendpage(smc->clcsock, page, offset, in smc_sendpage()
2583 rc = sock_no_sendpage(sock, page, offset, size, flags); in smc_sendpage()
2587 return rc; in smc_sendpage()
2602 int rc = -ENOTCONN; in smc_splice_read() local
2608 rc = 0; in smc_splice_read()
2617 rc = 0; in smc_splice_read()
2622 rc = smc->clcsock->ops->splice_read(smc->clcsock, ppos, in smc_splice_read()
2626 rc = -ESPIPE; in smc_splice_read()
2634 rc = smc_rx_recvmsg(smc, NULL, pipe, len, flags); in smc_splice_read()
2639 return rc; in smc_splice_read()
2671 int rc; in smc_create() local
2673 rc = -ESOCKTNOSUPPORT; in smc_create()
2677 rc = -EPROTONOSUPPORT; in smc_create()
2681 rc = -ENOBUFS; in smc_create()
2691 rc = sock_create_kern(net, family, SOCK_STREAM, IPPROTO_TCP, in smc_create()
2693 if (rc) { in smc_create()
2701 return rc; in smc_create()
2746 int rc; in smc_init() local
2748 rc = register_pernet_subsys(&smc_net_ops); in smc_init()
2749 if (rc) in smc_init()
2750 return rc; in smc_init()
2752 rc = register_pernet_subsys(&smc_net_stat_ops); in smc_init()
2753 if (rc) in smc_init()
2759 rc = smc_nl_init(); in smc_init()
2760 if (rc) in smc_init()
2763 rc = smc_pnet_init(); in smc_init()
2764 if (rc) in smc_init()
2767 rc = -ENOMEM; in smc_init()
2776 rc = smc_core_init(); in smc_init()
2777 if (rc) { in smc_init()
2778 pr_err("%s: smc_core_init fails with %d\n", __func__, rc); in smc_init()
2782 rc = smc_llc_init(); in smc_init()
2783 if (rc) { in smc_init()
2784 pr_err("%s: smc_llc_init fails with %d\n", __func__, rc); in smc_init()
2788 rc = smc_cdc_init(); in smc_init()
2789 if (rc) { in smc_init()
2790 pr_err("%s: smc_cdc_init fails with %d\n", __func__, rc); in smc_init()
2794 rc = proto_register(&smc_proto, 1); in smc_init()
2795 if (rc) { in smc_init()
2796 pr_err("%s: proto_register(v4) fails with %d\n", __func__, rc); in smc_init()
2800 rc = proto_register(&smc_proto6, 1); in smc_init()
2801 if (rc) { in smc_init()
2802 pr_err("%s: proto_register(v6) fails with %d\n", __func__, rc); in smc_init()
2806 rc = sock_register(&smc_sock_family_ops); in smc_init()
2807 if (rc) { in smc_init()
2808 pr_err("%s: sock_register fails with %d\n", __func__, rc); in smc_init()
2814 rc = smc_ib_register_client(); in smc_init()
2815 if (rc) { in smc_init()
2816 pr_err("%s: ib_register fails with %d\n", __func__, rc); in smc_init()
2844 return rc; in smc_init()