Lines Matching refs:new_smc
1651 static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc) in smc_clcsock_accept() argument
1663 *new_smc = NULL; in smc_clcsock_accept()
1667 *new_smc = smc_sk(new_sk); in smc_clcsock_accept()
1683 *new_smc = NULL; in smc_clcsock_accept()
1704 (*new_smc)->clcsock = new_clcsock; in smc_clcsock_accept()
1835 static void smc_listen_out(struct smc_sock *new_smc) in smc_listen_out() argument
1837 struct smc_sock *lsmc = new_smc->listen_smc; in smc_listen_out()
1838 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out()
1840 if (tcp_sk(new_smc->clcsock->sk)->syn_smc) in smc_listen_out()
1857 static void smc_listen_out_connected(struct smc_sock *new_smc) in smc_listen_out_connected() argument
1859 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_connected()
1864 smc_listen_out(new_smc); in smc_listen_out_connected()
1868 static void smc_listen_out_err(struct smc_sock *new_smc) in smc_listen_out_err() argument
1870 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_err()
1875 sock_put(&new_smc->sk); /* passive closing */ in smc_listen_out_err()
1878 smc_listen_out(new_smc); in smc_listen_out_err()
1882 static void smc_listen_decline(struct smc_sock *new_smc, int reason_code, in smc_listen_decline() argument
1886 smc_conn_abort(new_smc, local_first); in smc_listen_decline()
1888 smc_switch_to_fallback(new_smc, reason_code)) { in smc_listen_decline()
1890 smc_listen_out_err(new_smc); in smc_listen_decline()
1894 if (smc_clc_send_decline(new_smc, reason_code, version) < 0) { in smc_listen_decline()
1895 smc_listen_out_err(new_smc); in smc_listen_decline()
1899 smc_listen_out_connected(new_smc); in smc_listen_decline()
1903 static int smc_listen_v2_check(struct smc_sock *new_smc, in smc_listen_v2_check() argument
1961 static int smc_listen_prfx_check(struct smc_sock *new_smc, in smc_listen_prfx_check() argument
1965 struct socket *newclcsock = new_smc->clcsock; in smc_listen_prfx_check()
1977 static int smc_listen_rdma_init(struct smc_sock *new_smc, in smc_listen_rdma_init() argument
1983 rc = smc_conn_create(new_smc, ini); in smc_listen_rdma_init()
1988 if (smc_buf_create(new_smc, false)) in smc_listen_rdma_init()
1995 static int smc_listen_ism_init(struct smc_sock *new_smc, in smc_listen_ism_init() argument
2000 rc = smc_conn_create(new_smc, ini); in smc_listen_ism_init()
2005 rc = smc_buf_create(new_smc, true); in smc_listen_ism_init()
2007 smc_conn_abort(new_smc, ini->first_contact_local); in smc_listen_ism_init()
2056 static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc, in smc_find_ism_v2_device_serv() argument
2107 rc = smc_listen_ism_init(new_smc, ini); in smc_find_ism_v2_device_serv()
2125 static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc, in smc_find_ism_v1_device_serv() argument
2137 rc = smc_find_ism_device(new_smc, ini); in smc_find_ism_v1_device_serv()
2141 rc = smc_listen_ism_init(new_smc, ini); in smc_find_ism_v1_device_serv()
2153 static int smc_listen_rdma_reg(struct smc_sock *new_smc, bool local_first) in smc_listen_rdma_reg() argument
2155 struct smc_connection *conn = &new_smc->conn; in smc_listen_rdma_reg()
2171 static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc, in smc_find_rdma_v2_device_serv() argument
2191 ini->smcrv2.clc_sk = new_smc->clcsock->sk; in smc_find_rdma_v2_device_serv()
2192 ini->smcrv2.saddr = new_smc->clcsock->sk->sk_rcv_saddr; in smc_find_rdma_v2_device_serv()
2194 rc = smc_find_rdma_device(new_smc, ini); in smc_find_rdma_v2_device_serv()
2204 rc = smc_listen_rdma_init(new_smc, ini); in smc_find_rdma_v2_device_serv()
2206 rc = smc_listen_rdma_reg(new_smc, ini->first_contact_local); in smc_find_rdma_v2_device_serv()
2218 static int smc_find_rdma_v1_device_serv(struct smc_sock *new_smc, in smc_find_rdma_v1_device_serv() argument
2231 rc = smc_find_rdma_device(new_smc, ini); in smc_find_rdma_v1_device_serv()
2236 rc = smc_listen_rdma_init(new_smc, ini); in smc_find_rdma_v1_device_serv()
2239 return smc_listen_rdma_reg(new_smc, ini->first_contact_local); in smc_find_rdma_v1_device_serv()
2243 static int smc_listen_find_device(struct smc_sock *new_smc, in smc_listen_find_device() argument
2250 smc_find_ism_v2_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
2255 prfx_rc = smc_listen_prfx_check(new_smc, pclc); in smc_listen_find_device()
2260 if (smc_vlan_by_tcpsk(new_smc->clcsock, ini)) in smc_listen_find_device()
2265 smc_find_ism_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
2275 smc_find_rdma_v2_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
2283 rc = smc_find_rdma_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
2291 static int smc_listen_rdma_finish(struct smc_sock *new_smc, in smc_listen_rdma_finish() argument
2296 struct smc_link *link = new_smc->conn.lnk; in smc_listen_rdma_finish()
2302 if (smc_rmb_rtoken_handling(&new_smc->conn, link, cclc)) in smc_listen_rdma_finish()
2310 reason_code = smcr_serv_conf_first_link(new_smc); in smc_listen_rdma_finish()
2319 struct smc_sock *new_smc = container_of(work, struct smc_sock, in smc_listen_work() local
2321 struct socket *newclcsock = new_smc->clcsock; in smc_listen_work()
2330 if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN) in smc_listen_work()
2331 return smc_listen_out_err(new_smc); in smc_listen_work()
2333 if (new_smc->use_fallback) { in smc_listen_work()
2334 smc_listen_out_connected(new_smc); in smc_listen_work()
2340 rc = smc_switch_to_fallback(new_smc, SMC_CLC_DECL_PEERNOSMC); in smc_listen_work()
2342 smc_listen_out_err(new_smc); in smc_listen_work()
2344 smc_listen_out_connected(new_smc); in smc_listen_work()
2357 rc = smc_clc_wait_msg(new_smc, pclc, sizeof(*buf), in smc_listen_work()
2366 if (using_ipsec(new_smc)) { in smc_listen_work()
2378 rc = smc_listen_v2_check(new_smc, pclc, ini); in smc_listen_work()
2383 smc_close_init(new_smc); in smc_listen_work()
2384 smc_rx_init(new_smc); in smc_listen_work()
2385 smc_tx_init(new_smc); in smc_listen_work()
2388 rc = smc_listen_find_device(new_smc, pclc, ini); in smc_listen_work()
2394 rc = smc_clc_send_accept(new_smc, ini->first_contact_local, in smc_listen_work()
2406 rc = smc_clc_wait_msg(new_smc, cclc, sizeof(*buf), in smc_listen_work()
2416 rc = smc_listen_rdma_finish(new_smc, cclc, in smc_listen_work()
2422 smc_conn_save_peer_info(new_smc, cclc); in smc_listen_work()
2423 smc_listen_out_connected(new_smc); in smc_listen_work()
2430 smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0, in smc_listen_work()
2442 struct smc_sock *new_smc; in smc_tcp_listen_work() local
2447 rc = smc_clcsock_accept(lsmc, &new_smc); in smc_tcp_listen_work()
2450 if (!new_smc) in smc_tcp_listen_work()
2453 if (tcp_sk(new_smc->clcsock->sk)->syn_smc) in smc_tcp_listen_work()
2456 new_smc->listen_smc = lsmc; in smc_tcp_listen_work()
2457 new_smc->use_fallback = lsmc->use_fallback; in smc_tcp_listen_work()
2458 new_smc->fallback_rsn = lsmc->fallback_rsn; in smc_tcp_listen_work()
2460 INIT_WORK(&new_smc->smc_listen_work, smc_listen_work); in smc_tcp_listen_work()
2461 smc_copy_sock_settings_to_smc(new_smc); in smc_tcp_listen_work()
2462 new_smc->sk.sk_sndbuf = lsmc->sk.sk_sndbuf; in smc_tcp_listen_work()
2463 new_smc->sk.sk_rcvbuf = lsmc->sk.sk_rcvbuf; in smc_tcp_listen_work()
2464 sock_hold(&new_smc->sk); /* sock_put in passive closing */ in smc_tcp_listen_work()
2465 if (!queue_work(smc_hs_wq, &new_smc->smc_listen_work)) in smc_tcp_listen_work()
2466 sock_put(&new_smc->sk); in smc_tcp_listen_work()