Lines Matching refs:new_smc

1152 static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc)  in smc_clcsock_accept()  argument
1164 *new_smc = NULL; in smc_clcsock_accept()
1168 *new_smc = smc_sk(new_sk); in smc_clcsock_accept()
1184 *new_smc = NULL; in smc_clcsock_accept()
1192 (*new_smc)->clcsock = new_clcsock; in smc_clcsock_accept()
1315 static void smc_listen_out(struct smc_sock *new_smc) in smc_listen_out() argument
1317 struct smc_sock *lsmc = new_smc->listen_smc; in smc_listen_out()
1318 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out()
1334 static void smc_listen_out_connected(struct smc_sock *new_smc) in smc_listen_out_connected() argument
1336 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_connected()
1342 smc_listen_out(new_smc); in smc_listen_out_connected()
1346 static void smc_listen_out_err(struct smc_sock *new_smc) in smc_listen_out_err() argument
1348 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_err()
1353 sock_put(&new_smc->sk); /* passive closing */ in smc_listen_out_err()
1356 smc_listen_out(new_smc); in smc_listen_out_err()
1360 static void smc_listen_decline(struct smc_sock *new_smc, int reason_code, in smc_listen_decline() argument
1364 smc_conn_abort(new_smc, local_first); in smc_listen_decline()
1366 smc_listen_out_err(new_smc); in smc_listen_decline()
1369 smc_switch_to_fallback(new_smc, reason_code); in smc_listen_decline()
1371 if (smc_clc_send_decline(new_smc, reason_code, version) < 0) { in smc_listen_decline()
1372 smc_listen_out_err(new_smc); in smc_listen_decline()
1376 smc_listen_out_connected(new_smc); in smc_listen_decline()
1380 static int smc_listen_v2_check(struct smc_sock *new_smc, in smc_listen_v2_check() argument
1423 static int smc_listen_prfx_check(struct smc_sock *new_smc, in smc_listen_prfx_check() argument
1427 struct socket *newclcsock = new_smc->clcsock; in smc_listen_prfx_check()
1439 static int smc_listen_rdma_init(struct smc_sock *new_smc, in smc_listen_rdma_init() argument
1445 rc = smc_conn_create(new_smc, ini); in smc_listen_rdma_init()
1450 if (smc_buf_create(new_smc, false)) in smc_listen_rdma_init()
1457 static int smc_listen_ism_init(struct smc_sock *new_smc, in smc_listen_ism_init() argument
1462 rc = smc_conn_create(new_smc, ini); in smc_listen_ism_init()
1467 rc = smc_buf_create(new_smc, true); in smc_listen_ism_init()
1469 smc_conn_abort(new_smc, ini->first_contact_local); in smc_listen_ism_init()
1518 static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc, in smc_find_ism_v2_device_serv() argument
1572 rc = smc_listen_ism_init(new_smc, ini); in smc_find_ism_v2_device_serv()
1589 static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc, in smc_find_ism_v1_device_serv() argument
1601 rc = smc_find_ism_device(new_smc, ini); in smc_find_ism_v1_device_serv()
1605 rc = smc_listen_ism_init(new_smc, ini); in smc_find_ism_v1_device_serv()
1616 static int smc_listen_rdma_reg(struct smc_sock *new_smc, bool local_first) in smc_listen_rdma_reg() argument
1618 struct smc_connection *conn = &new_smc->conn; in smc_listen_rdma_reg()
1624 smc_rmb_sync_sg_for_device(&new_smc->conn); in smc_listen_rdma_reg()
1629 static int smc_find_rdma_v1_device_serv(struct smc_sock *new_smc, in smc_find_rdma_v1_device_serv() argument
1640 rc = smc_find_rdma_device(new_smc, ini); in smc_find_rdma_v1_device_serv()
1648 rc = smc_listen_rdma_init(new_smc, ini); in smc_find_rdma_v1_device_serv()
1651 return smc_listen_rdma_reg(new_smc, ini->first_contact_local); in smc_find_rdma_v1_device_serv()
1655 static int smc_listen_find_device(struct smc_sock *new_smc, in smc_listen_find_device() argument
1662 smc_find_ism_v2_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1670 rc = smc_listen_prfx_check(new_smc, pclc); in smc_listen_find_device()
1675 if (smc_vlan_by_tcpsk(new_smc->clcsock, ini)) in smc_listen_find_device()
1679 smc_find_ism_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1688 rc = smc_find_rdma_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1695 static int smc_listen_rdma_finish(struct smc_sock *new_smc, in smc_listen_rdma_finish() argument
1699 struct smc_link *link = new_smc->conn.lnk; in smc_listen_rdma_finish()
1705 if (smc_rmb_rtoken_handling(&new_smc->conn, link, cclc)) in smc_listen_rdma_finish()
1713 reason_code = smcr_serv_conf_first_link(new_smc); in smc_listen_rdma_finish()
1722 struct smc_sock *new_smc = container_of(work, struct smc_sock, in smc_listen_work() local
1725 struct socket *newclcsock = new_smc->clcsock; in smc_listen_work()
1732 if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN) in smc_listen_work()
1733 return smc_listen_out_err(new_smc); in smc_listen_work()
1735 if (new_smc->use_fallback) { in smc_listen_work()
1736 smc_listen_out_connected(new_smc); in smc_listen_work()
1742 smc_switch_to_fallback(new_smc, SMC_CLC_DECL_PEERNOSMC); in smc_listen_work()
1743 smc_listen_out_connected(new_smc); in smc_listen_work()
1756 rc = smc_clc_wait_msg(new_smc, pclc, sizeof(*buf), in smc_listen_work()
1763 if (using_ipsec(new_smc)) { in smc_listen_work()
1775 rc = smc_listen_v2_check(new_smc, pclc, ini); in smc_listen_work()
1780 smc_close_init(new_smc); in smc_listen_work()
1781 smc_rx_init(new_smc); in smc_listen_work()
1782 smc_tx_init(new_smc); in smc_listen_work()
1785 rc = smc_listen_find_device(new_smc, pclc, ini); in smc_listen_work()
1790 rc = smc_clc_send_accept(new_smc, ini->first_contact_local, in smc_listen_work()
1802 rc = smc_clc_wait_msg(new_smc, cclc, sizeof(*buf), in smc_listen_work()
1812 rc = smc_listen_rdma_finish(new_smc, cclc, in smc_listen_work()
1818 smc_conn_save_peer_info(new_smc, cclc); in smc_listen_work()
1819 smc_listen_out_connected(new_smc); in smc_listen_work()
1826 smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0, in smc_listen_work()
1838 struct smc_sock *new_smc; in smc_tcp_listen_work() local
1843 rc = smc_clcsock_accept(lsmc, &new_smc); in smc_tcp_listen_work()
1846 if (!new_smc) in smc_tcp_listen_work()
1849 new_smc->listen_smc = lsmc; in smc_tcp_listen_work()
1850 new_smc->use_fallback = lsmc->use_fallback; in smc_tcp_listen_work()
1851 new_smc->fallback_rsn = lsmc->fallback_rsn; in smc_tcp_listen_work()
1853 INIT_WORK(&new_smc->smc_listen_work, smc_listen_work); in smc_tcp_listen_work()
1854 smc_copy_sock_settings_to_smc(new_smc); in smc_tcp_listen_work()
1855 new_smc->sk.sk_sndbuf = lsmc->sk.sk_sndbuf; in smc_tcp_listen_work()
1856 new_smc->sk.sk_rcvbuf = lsmc->sk.sk_rcvbuf; in smc_tcp_listen_work()
1857 sock_hold(&new_smc->sk); /* sock_put in passive closing */ in smc_tcp_listen_work()
1858 if (!queue_work(smc_hs_wq, &new_smc->smc_listen_work)) in smc_tcp_listen_work()
1859 sock_put(&new_smc->sk); in smc_tcp_listen_work()