Lines Matching refs:new_smc

1716 static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc)  in smc_clcsock_accept()  argument
1728 *new_smc = NULL; in smc_clcsock_accept()
1732 *new_smc = smc_sk(new_sk); in smc_clcsock_accept()
1748 *new_smc = NULL; in smc_clcsock_accept()
1769 (*new_smc)->clcsock = new_clcsock; in smc_clcsock_accept()
1904 static void smc_listen_out(struct smc_sock *new_smc) in smc_listen_out() argument
1906 struct smc_sock *lsmc = new_smc->listen_smc; in smc_listen_out()
1907 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out()
1909 if (tcp_sk(new_smc->clcsock->sk)->syn_smc) in smc_listen_out()
1926 static void smc_listen_out_connected(struct smc_sock *new_smc) in smc_listen_out_connected() argument
1928 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_connected()
1933 smc_listen_out(new_smc); in smc_listen_out_connected()
1937 static void smc_listen_out_err(struct smc_sock *new_smc) in smc_listen_out_err() argument
1939 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_err()
1944 sock_put(&new_smc->sk); /* passive closing */ in smc_listen_out_err()
1947 smc_listen_out(new_smc); in smc_listen_out_err()
1951 static void smc_listen_decline(struct smc_sock *new_smc, int reason_code, in smc_listen_decline() argument
1955 smc_conn_abort(new_smc, local_first); in smc_listen_decline()
1957 smc_switch_to_fallback(new_smc, reason_code)) { in smc_listen_decline()
1959 smc_listen_out_err(new_smc); in smc_listen_decline()
1963 if (smc_clc_send_decline(new_smc, reason_code, version) < 0) { in smc_listen_decline()
1964 smc_listen_out_err(new_smc); in smc_listen_decline()
1968 smc_listen_out_connected(new_smc); in smc_listen_decline()
1972 static int smc_listen_v2_check(struct smc_sock *new_smc, in smc_listen_v2_check() argument
2034 static int smc_listen_prfx_check(struct smc_sock *new_smc, in smc_listen_prfx_check() argument
2038 struct socket *newclcsock = new_smc->clcsock; in smc_listen_prfx_check()
2050 static int smc_listen_rdma_init(struct smc_sock *new_smc, in smc_listen_rdma_init() argument
2056 rc = smc_conn_create(new_smc, ini); in smc_listen_rdma_init()
2061 if (smc_buf_create(new_smc, false)) { in smc_listen_rdma_init()
2062 smc_conn_abort(new_smc, ini->first_contact_local); in smc_listen_rdma_init()
2070 static int smc_listen_ism_init(struct smc_sock *new_smc, in smc_listen_ism_init() argument
2075 rc = smc_conn_create(new_smc, ini); in smc_listen_ism_init()
2080 rc = smc_buf_create(new_smc, true); in smc_listen_ism_init()
2082 smc_conn_abort(new_smc, ini->first_contact_local); in smc_listen_ism_init()
2131 static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc, in smc_find_ism_v2_device_serv() argument
2182 rc = smc_listen_ism_init(new_smc, ini); in smc_find_ism_v2_device_serv()
2200 static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc, in smc_find_ism_v1_device_serv() argument
2212 rc = smc_find_ism_device(new_smc, ini); in smc_find_ism_v1_device_serv()
2216 rc = smc_listen_ism_init(new_smc, ini); in smc_find_ism_v1_device_serv()
2228 static int smc_listen_rdma_reg(struct smc_sock *new_smc, bool local_first) in smc_listen_rdma_reg() argument
2230 struct smc_connection *conn = &new_smc->conn; in smc_listen_rdma_reg()
2246 static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc, in smc_find_rdma_v2_device_serv() argument
2266 ini->smcrv2.clc_sk = new_smc->clcsock->sk; in smc_find_rdma_v2_device_serv()
2267 ini->smcrv2.saddr = new_smc->clcsock->sk->sk_rcv_saddr; in smc_find_rdma_v2_device_serv()
2269 rc = smc_find_rdma_device(new_smc, ini); in smc_find_rdma_v2_device_serv()
2279 rc = smc_listen_rdma_init(new_smc, ini); in smc_find_rdma_v2_device_serv()
2281 rc = smc_listen_rdma_reg(new_smc, ini->first_contact_local); in smc_find_rdma_v2_device_serv()
2283 smc_conn_abort(new_smc, ini->first_contact_local); in smc_find_rdma_v2_device_serv()
2296 static int smc_find_rdma_v1_device_serv(struct smc_sock *new_smc, in smc_find_rdma_v1_device_serv() argument
2309 rc = smc_find_rdma_device(new_smc, ini); in smc_find_rdma_v1_device_serv()
2314 rc = smc_listen_rdma_init(new_smc, ini); in smc_find_rdma_v1_device_serv()
2317 return smc_listen_rdma_reg(new_smc, ini->first_contact_local); in smc_find_rdma_v1_device_serv()
2321 static int smc_listen_find_device(struct smc_sock *new_smc, in smc_listen_find_device() argument
2328 smc_find_ism_v2_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
2333 prfx_rc = smc_listen_prfx_check(new_smc, pclc); in smc_listen_find_device()
2338 if (smc_vlan_by_tcpsk(new_smc->clcsock, ini)) in smc_listen_find_device()
2343 smc_find_ism_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
2353 smc_find_rdma_v2_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
2361 rc = smc_find_rdma_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
2369 static int smc_listen_rdma_finish(struct smc_sock *new_smc, in smc_listen_rdma_finish() argument
2374 struct smc_link *link = new_smc->conn.lnk; in smc_listen_rdma_finish()
2380 if (smc_rmb_rtoken_handling(&new_smc->conn, link, cclc)) in smc_listen_rdma_finish()
2388 reason_code = smcr_serv_conf_first_link(new_smc); in smc_listen_rdma_finish()
2397 struct smc_sock *new_smc = container_of(work, struct smc_sock, in smc_listen_work() local
2399 struct socket *newclcsock = new_smc->clcsock; in smc_listen_work()
2408 if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN) in smc_listen_work()
2409 return smc_listen_out_err(new_smc); in smc_listen_work()
2411 if (new_smc->use_fallback) { in smc_listen_work()
2412 smc_listen_out_connected(new_smc); in smc_listen_work()
2418 rc = smc_switch_to_fallback(new_smc, SMC_CLC_DECL_PEERNOSMC); in smc_listen_work()
2420 smc_listen_out_err(new_smc); in smc_listen_work()
2422 smc_listen_out_connected(new_smc); in smc_listen_work()
2435 rc = smc_clc_wait_msg(new_smc, pclc, sizeof(*buf), in smc_listen_work()
2444 if (using_ipsec(new_smc)) { in smc_listen_work()
2456 rc = smc_listen_v2_check(new_smc, pclc, ini); in smc_listen_work()
2465 smc_close_init(new_smc); in smc_listen_work()
2466 smc_rx_init(new_smc); in smc_listen_work()
2467 smc_tx_init(new_smc); in smc_listen_work()
2470 rc = smc_listen_find_device(new_smc, pclc, ini); in smc_listen_work()
2476 rc = smc_clc_send_accept(new_smc, ini->first_contact_local, in smc_listen_work()
2488 rc = smc_clc_wait_msg(new_smc, cclc, sizeof(*buf), in smc_listen_work()
2506 smc_conn_save_peer_info_fce(new_smc, cclc); in smc_listen_work()
2510 rc = smc_listen_rdma_finish(new_smc, cclc, in smc_listen_work()
2516 smc_conn_save_peer_info(new_smc, cclc); in smc_listen_work()
2517 smc_listen_out_connected(new_smc); in smc_listen_work()
2524 smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0, in smc_listen_work()
2536 struct smc_sock *new_smc; in smc_tcp_listen_work() local
2541 rc = smc_clcsock_accept(lsmc, &new_smc); in smc_tcp_listen_work()
2544 if (!new_smc) in smc_tcp_listen_work()
2547 if (tcp_sk(new_smc->clcsock->sk)->syn_smc) in smc_tcp_listen_work()
2550 new_smc->listen_smc = lsmc; in smc_tcp_listen_work()
2551 new_smc->use_fallback = lsmc->use_fallback; in smc_tcp_listen_work()
2552 new_smc->fallback_rsn = lsmc->fallback_rsn; in smc_tcp_listen_work()
2554 INIT_WORK(&new_smc->smc_listen_work, smc_listen_work); in smc_tcp_listen_work()
2555 smc_copy_sock_settings_to_smc(new_smc); in smc_tcp_listen_work()
2556 sock_hold(&new_smc->sk); /* sock_put in passive closing */ in smc_tcp_listen_work()
2557 if (!queue_work(smc_hs_wq, &new_smc->smc_listen_work)) in smc_tcp_listen_work()
2558 sock_put(&new_smc->sk); in smc_tcp_listen_work()