Lines Matching defs:new_smc

1718 static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc)
1730 *new_smc = NULL;
1734 *new_smc = smc_sk(new_sk);
1750 *new_smc = NULL;
1771 (*new_smc)->clcsock = new_clcsock;
1906 static void smc_listen_out(struct smc_sock *new_smc)
1908 struct smc_sock *lsmc = new_smc->listen_smc;
1909 struct sock *newsmcsk = &new_smc->sk;
1911 if (tcp_sk(new_smc->clcsock->sk)->syn_smc)
1928 static void smc_listen_out_connected(struct smc_sock *new_smc)
1930 struct sock *newsmcsk = &new_smc->sk;
1935 smc_listen_out(new_smc);
1939 static void smc_listen_out_err(struct smc_sock *new_smc)
1941 struct sock *newsmcsk = &new_smc->sk;
1946 sock_put(&new_smc->sk); /* passive closing */
1949 smc_listen_out(new_smc);
1953 static void smc_listen_decline(struct smc_sock *new_smc, int reason_code,
1957 smc_conn_abort(new_smc, local_first);
1959 smc_switch_to_fallback(new_smc, reason_code)) {
1961 smc_listen_out_err(new_smc);
1965 if (smc_clc_send_decline(new_smc, reason_code, version) < 0) {
1966 smc_listen_out_err(new_smc);
1970 smc_listen_out_connected(new_smc);
1974 static int smc_listen_v2_check(struct smc_sock *new_smc,
2036 static int smc_listen_prfx_check(struct smc_sock *new_smc,
2040 struct socket *newclcsock = new_smc->clcsock;
2052 static int smc_listen_rdma_init(struct smc_sock *new_smc,
2058 rc = smc_conn_create(new_smc, ini);
2063 if (smc_buf_create(new_smc, false)) {
2064 smc_conn_abort(new_smc, ini->first_contact_local);
2072 static int smc_listen_ism_init(struct smc_sock *new_smc,
2077 rc = smc_conn_create(new_smc, ini);
2082 rc = smc_buf_create(new_smc, true);
2084 smc_conn_abort(new_smc, ini->first_contact_local);
2138 static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc,
2208 rc = smc_listen_ism_init(new_smc, ini);
2226 static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc,
2239 rc = smc_find_ism_device(new_smc, ini);
2243 rc = smc_listen_ism_init(new_smc, ini);
2255 static int smc_listen_rdma_reg(struct smc_sock *new_smc, bool local_first)
2257 struct smc_connection *conn = &new_smc->conn;
2273 static void smc_find_rdma_v2_device_serv(struct smc_sock *new_smc,
2293 ini->smcrv2.clc_sk = new_smc->clcsock->sk;
2294 ini->smcrv2.saddr = new_smc->clcsock->sk->sk_rcv_saddr;
2296 rc = smc_find_rdma_device(new_smc, ini);
2306 rc = smc_listen_rdma_init(new_smc, ini);
2308 rc = smc_listen_rdma_reg(new_smc, ini->first_contact_local);
2310 smc_conn_abort(new_smc, ini->first_contact_local);
2323 static int smc_find_rdma_v1_device_serv(struct smc_sock *new_smc,
2336 rc = smc_find_rdma_device(new_smc, ini);
2341 rc = smc_listen_rdma_init(new_smc, ini);
2344 return smc_listen_rdma_reg(new_smc, ini->first_contact_local);
2348 static int smc_listen_find_device(struct smc_sock *new_smc,
2355 smc_find_ism_v2_device_serv(new_smc, pclc, ini);
2360 prfx_rc = smc_listen_prfx_check(new_smc, pclc);
2365 if (smc_vlan_by_tcpsk(new_smc->clcsock, ini))
2370 smc_find_ism_v1_device_serv(new_smc, pclc, ini);
2380 smc_find_rdma_v2_device_serv(new_smc, pclc, ini);
2388 rc = smc_find_rdma_v1_device_serv(new_smc, pclc, ini);
2396 static int smc_listen_rdma_finish(struct smc_sock *new_smc,
2401 struct smc_link *link = new_smc->conn.lnk;
2407 if (smc_rmb_rtoken_handling(&new_smc->conn, link, cclc))
2415 reason_code = smcr_serv_conf_first_link(new_smc);
2424 struct smc_sock *new_smc = container_of(work, struct smc_sock,
2426 struct socket *newclcsock = new_smc->clcsock;
2435 if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN)
2436 return smc_listen_out_err(new_smc);
2438 if (new_smc->use_fallback) {
2439 smc_listen_out_connected(new_smc);
2445 rc = smc_switch_to_fallback(new_smc, SMC_CLC_DECL_PEERNOSMC);
2447 smc_listen_out_err(new_smc);
2449 smc_listen_out_connected(new_smc);
2462 rc = smc_clc_wait_msg(new_smc, pclc, sizeof(*buf),
2471 if (using_ipsec(new_smc)) {
2483 rc = smc_listen_v2_check(new_smc, pclc, ini);
2487 rc = smc_clc_srv_v2x_features_validate(new_smc, pclc, ini);
2492 smc_close_init(new_smc);
2493 smc_rx_init(new_smc);
2494 smc_tx_init(new_smc);
2497 rc = smc_listen_find_device(new_smc, pclc, ini);
2503 rc = smc_clc_send_accept(new_smc, ini->first_contact_local,
2515 rc = smc_clc_wait_msg(new_smc, cclc, sizeof(*buf),
2533 smc_conn_save_peer_info_fce(new_smc, cclc);
2537 rc = smc_listen_rdma_finish(new_smc, cclc,
2543 smc_conn_save_peer_info(new_smc, cclc);
2544 smc_listen_out_connected(new_smc);
2551 smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0,
2563 struct smc_sock *new_smc;
2568 rc = smc_clcsock_accept(lsmc, &new_smc);
2571 if (!new_smc)
2574 if (tcp_sk(new_smc->clcsock->sk)->syn_smc)
2577 new_smc->listen_smc = lsmc;
2578 new_smc->use_fallback = lsmc->use_fallback;
2579 new_smc->fallback_rsn = lsmc->fallback_rsn;
2581 INIT_WORK(&new_smc->smc_listen_work, smc_listen_work);
2582 smc_copy_sock_settings_to_smc(new_smc);
2583 sock_hold(&new_smc->sk); /* sock_put in passive closing */
2584 if (!queue_work(smc_hs_wq, &new_smc->smc_listen_work))
2585 sock_put(&new_smc->sk);