Lines Matching refs:new_smc
1142 static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc) in smc_clcsock_accept() argument
1154 *new_smc = NULL; in smc_clcsock_accept()
1158 *new_smc = smc_sk(new_sk); in smc_clcsock_accept()
1174 *new_smc = NULL; in smc_clcsock_accept()
1182 (*new_smc)->clcsock = new_clcsock; in smc_clcsock_accept()
1305 static void smc_listen_out(struct smc_sock *new_smc) in smc_listen_out() argument
1307 struct smc_sock *lsmc = new_smc->listen_smc; in smc_listen_out()
1308 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out()
1324 static void smc_listen_out_connected(struct smc_sock *new_smc) in smc_listen_out_connected() argument
1326 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_connected()
1331 smc_listen_out(new_smc); in smc_listen_out_connected()
1335 static void smc_listen_out_err(struct smc_sock *new_smc) in smc_listen_out_err() argument
1337 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_err()
1340 sock_put(&new_smc->sk); /* passive closing */ in smc_listen_out_err()
1343 smc_listen_out(new_smc); in smc_listen_out_err()
1347 static void smc_listen_decline(struct smc_sock *new_smc, int reason_code, in smc_listen_decline() argument
1352 smc_lgr_cleanup_early(&new_smc->conn); in smc_listen_decline()
1354 smc_conn_free(&new_smc->conn); in smc_listen_decline()
1356 smc_listen_out_err(new_smc); in smc_listen_decline()
1359 smc_switch_to_fallback(new_smc); in smc_listen_decline()
1360 new_smc->fallback_rsn = reason_code; in smc_listen_decline()
1362 if (smc_clc_send_decline(new_smc, reason_code, version) < 0) { in smc_listen_decline()
1363 smc_listen_out_err(new_smc); in smc_listen_decline()
1367 smc_listen_out_connected(new_smc); in smc_listen_decline()
1371 static int smc_listen_v2_check(struct smc_sock *new_smc, in smc_listen_v2_check() argument
1412 static int smc_listen_prfx_check(struct smc_sock *new_smc, in smc_listen_prfx_check() argument
1416 struct socket *newclcsock = new_smc->clcsock; in smc_listen_prfx_check()
1428 static int smc_listen_rdma_init(struct smc_sock *new_smc, in smc_listen_rdma_init() argument
1434 rc = smc_conn_create(new_smc, ini); in smc_listen_rdma_init()
1439 if (smc_buf_create(new_smc, false)) in smc_listen_rdma_init()
1446 static int smc_listen_ism_init(struct smc_sock *new_smc, in smc_listen_ism_init() argument
1451 rc = smc_conn_create(new_smc, ini); in smc_listen_ism_init()
1456 rc = smc_buf_create(new_smc, true); in smc_listen_ism_init()
1459 smc_lgr_cleanup_early(&new_smc->conn); in smc_listen_ism_init()
1461 smc_conn_free(&new_smc->conn); in smc_listen_ism_init()
1504 static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc, in smc_find_ism_v2_device_serv() argument
1556 if (smc_listen_ism_init(new_smc, ini)) in smc_find_ism_v2_device_serv()
1570 static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc, in smc_find_ism_v1_device_serv() argument
1581 if (smc_find_ism_device(new_smc, ini)) in smc_find_ism_v1_device_serv()
1584 if (!smc_listen_ism_init(new_smc, ini)) in smc_find_ism_v1_device_serv()
1593 static int smc_listen_rdma_reg(struct smc_sock *new_smc, bool local_first) in smc_listen_rdma_reg() argument
1595 struct smc_connection *conn = &new_smc->conn; in smc_listen_rdma_reg()
1601 smc_rmb_sync_sg_for_device(&new_smc->conn); in smc_listen_rdma_reg()
1606 static int smc_find_rdma_v1_device_serv(struct smc_sock *new_smc, in smc_find_rdma_v1_device_serv() argument
1617 rc = smc_find_rdma_device(new_smc, ini); in smc_find_rdma_v1_device_serv()
1625 rc = smc_listen_rdma_init(new_smc, ini); in smc_find_rdma_v1_device_serv()
1628 return smc_listen_rdma_reg(new_smc, ini->first_contact_local); in smc_find_rdma_v1_device_serv()
1632 static int smc_listen_find_device(struct smc_sock *new_smc, in smc_listen_find_device() argument
1639 smc_find_ism_v2_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1647 rc = smc_listen_prfx_check(new_smc, pclc); in smc_listen_find_device()
1652 if (smc_vlan_by_tcpsk(new_smc->clcsock, ini)) in smc_listen_find_device()
1656 smc_find_ism_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1664 return smc_find_rdma_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1668 static int smc_listen_rdma_finish(struct smc_sock *new_smc, in smc_listen_rdma_finish() argument
1672 struct smc_link *link = new_smc->conn.lnk; in smc_listen_rdma_finish()
1678 if (smc_rmb_rtoken_handling(&new_smc->conn, link, cclc)) in smc_listen_rdma_finish()
1686 reason_code = smcr_serv_conf_first_link(new_smc); in smc_listen_rdma_finish()
1695 struct smc_sock *new_smc = container_of(work, struct smc_sock, in smc_listen_work() local
1698 struct socket *newclcsock = new_smc->clcsock; in smc_listen_work()
1705 if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN) in smc_listen_work()
1706 return smc_listen_out_err(new_smc); in smc_listen_work()
1708 if (new_smc->use_fallback) { in smc_listen_work()
1709 smc_listen_out_connected(new_smc); in smc_listen_work()
1715 smc_switch_to_fallback(new_smc); in smc_listen_work()
1716 new_smc->fallback_rsn = SMC_CLC_DECL_PEERNOSMC; in smc_listen_work()
1717 smc_listen_out_connected(new_smc); in smc_listen_work()
1730 rc = smc_clc_wait_msg(new_smc, pclc, sizeof(*buf), in smc_listen_work()
1737 if (using_ipsec(new_smc)) { in smc_listen_work()
1749 rc = smc_listen_v2_check(new_smc, pclc, ini); in smc_listen_work()
1754 smc_close_init(new_smc); in smc_listen_work()
1755 smc_rx_init(new_smc); in smc_listen_work()
1756 smc_tx_init(new_smc); in smc_listen_work()
1759 rc = smc_listen_find_device(new_smc, pclc, ini); in smc_listen_work()
1764 rc = smc_clc_send_accept(new_smc, ini->first_contact_local, in smc_listen_work()
1776 rc = smc_clc_wait_msg(new_smc, cclc, sizeof(*buf), in smc_listen_work()
1786 rc = smc_listen_rdma_finish(new_smc, cclc, in smc_listen_work()
1792 smc_conn_save_peer_info(new_smc, cclc); in smc_listen_work()
1793 smc_listen_out_connected(new_smc); in smc_listen_work()
1799 smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0, in smc_listen_work()
1811 struct smc_sock *new_smc; in smc_tcp_listen_work() local
1816 rc = smc_clcsock_accept(lsmc, &new_smc); in smc_tcp_listen_work()
1819 if (!new_smc) in smc_tcp_listen_work()
1822 new_smc->listen_smc = lsmc; in smc_tcp_listen_work()
1823 new_smc->use_fallback = lsmc->use_fallback; in smc_tcp_listen_work()
1824 new_smc->fallback_rsn = lsmc->fallback_rsn; in smc_tcp_listen_work()
1826 INIT_WORK(&new_smc->smc_listen_work, smc_listen_work); in smc_tcp_listen_work()
1827 smc_copy_sock_settings_to_smc(new_smc); in smc_tcp_listen_work()
1828 new_smc->sk.sk_sndbuf = lsmc->sk.sk_sndbuf; in smc_tcp_listen_work()
1829 new_smc->sk.sk_rcvbuf = lsmc->sk.sk_rcvbuf; in smc_tcp_listen_work()
1830 sock_hold(&new_smc->sk); /* sock_put in passive closing */ in smc_tcp_listen_work()
1831 if (!queue_work(smc_hs_wq, &new_smc->smc_listen_work)) in smc_tcp_listen_work()
1832 sock_put(&new_smc->sk); in smc_tcp_listen_work()