Lines Matching refs:new_smc

1114 static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc)  in smc_clcsock_accept()  argument
1126 *new_smc = NULL; in smc_clcsock_accept()
1130 *new_smc = smc_sk(new_sk); in smc_clcsock_accept()
1146 *new_smc = NULL; in smc_clcsock_accept()
1154 (*new_smc)->clcsock = new_clcsock; in smc_clcsock_accept()
1277 static void smc_listen_out(struct smc_sock *new_smc) in smc_listen_out() argument
1279 struct smc_sock *lsmc = new_smc->listen_smc; in smc_listen_out()
1280 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out()
1296 static void smc_listen_out_connected(struct smc_sock *new_smc) in smc_listen_out_connected() argument
1298 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_connected()
1304 smc_listen_out(new_smc); in smc_listen_out_connected()
1308 static void smc_listen_out_err(struct smc_sock *new_smc) in smc_listen_out_err() argument
1310 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_err()
1313 sock_put(&new_smc->sk); /* passive closing */ in smc_listen_out_err()
1316 smc_listen_out(new_smc); in smc_listen_out_err()
1320 static void smc_listen_decline(struct smc_sock *new_smc, int reason_code, in smc_listen_decline() argument
1325 smc_lgr_cleanup_early(&new_smc->conn); in smc_listen_decline()
1327 smc_conn_free(&new_smc->conn); in smc_listen_decline()
1329 smc_listen_out_err(new_smc); in smc_listen_decline()
1332 smc_switch_to_fallback(new_smc); in smc_listen_decline()
1333 new_smc->fallback_rsn = reason_code; in smc_listen_decline()
1335 if (smc_clc_send_decline(new_smc, reason_code, version) < 0) { in smc_listen_decline()
1336 smc_listen_out_err(new_smc); in smc_listen_decline()
1340 smc_listen_out_connected(new_smc); in smc_listen_decline()
1344 static int smc_listen_v2_check(struct smc_sock *new_smc, in smc_listen_v2_check() argument
1385 static int smc_listen_prfx_check(struct smc_sock *new_smc, in smc_listen_prfx_check() argument
1389 struct socket *newclcsock = new_smc->clcsock; in smc_listen_prfx_check()
1401 static int smc_listen_rdma_init(struct smc_sock *new_smc, in smc_listen_rdma_init() argument
1407 rc = smc_conn_create(new_smc, ini); in smc_listen_rdma_init()
1412 if (smc_buf_create(new_smc, false)) in smc_listen_rdma_init()
1419 static int smc_listen_ism_init(struct smc_sock *new_smc, in smc_listen_ism_init() argument
1424 rc = smc_conn_create(new_smc, ini); in smc_listen_ism_init()
1429 rc = smc_buf_create(new_smc, true); in smc_listen_ism_init()
1432 smc_lgr_cleanup_early(&new_smc->conn); in smc_listen_ism_init()
1434 smc_conn_free(&new_smc->conn); in smc_listen_ism_init()
1477 static void smc_find_ism_v2_device_serv(struct smc_sock *new_smc, in smc_find_ism_v2_device_serv() argument
1529 if (smc_listen_ism_init(new_smc, ini)) in smc_find_ism_v2_device_serv()
1543 static void smc_find_ism_v1_device_serv(struct smc_sock *new_smc, in smc_find_ism_v1_device_serv() argument
1554 if (smc_find_ism_device(new_smc, ini)) in smc_find_ism_v1_device_serv()
1557 if (!smc_listen_ism_init(new_smc, ini)) in smc_find_ism_v1_device_serv()
1566 static int smc_listen_rdma_reg(struct smc_sock *new_smc, bool local_first) in smc_listen_rdma_reg() argument
1568 struct smc_connection *conn = &new_smc->conn; in smc_listen_rdma_reg()
1574 smc_rmb_sync_sg_for_device(&new_smc->conn); in smc_listen_rdma_reg()
1579 static int smc_find_rdma_v1_device_serv(struct smc_sock *new_smc, in smc_find_rdma_v1_device_serv() argument
1590 rc = smc_find_rdma_device(new_smc, ini); in smc_find_rdma_v1_device_serv()
1598 rc = smc_listen_rdma_init(new_smc, ini); in smc_find_rdma_v1_device_serv()
1601 return smc_listen_rdma_reg(new_smc, ini->first_contact_local); in smc_find_rdma_v1_device_serv()
1605 static int smc_listen_find_device(struct smc_sock *new_smc, in smc_listen_find_device() argument
1612 smc_find_ism_v2_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1620 rc = smc_listen_prfx_check(new_smc, pclc); in smc_listen_find_device()
1625 if (smc_vlan_by_tcpsk(new_smc->clcsock, ini)) in smc_listen_find_device()
1629 smc_find_ism_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1637 return smc_find_rdma_v1_device_serv(new_smc, pclc, ini); in smc_listen_find_device()
1641 static int smc_listen_rdma_finish(struct smc_sock *new_smc, in smc_listen_rdma_finish() argument
1645 struct smc_link *link = new_smc->conn.lnk; in smc_listen_rdma_finish()
1651 if (smc_rmb_rtoken_handling(&new_smc->conn, link, cclc)) in smc_listen_rdma_finish()
1659 reason_code = smcr_serv_conf_first_link(new_smc); in smc_listen_rdma_finish()
1668 struct smc_sock *new_smc = container_of(work, struct smc_sock, in smc_listen_work() local
1671 struct socket *newclcsock = new_smc->clcsock; in smc_listen_work()
1678 if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN) in smc_listen_work()
1679 return smc_listen_out_err(new_smc); in smc_listen_work()
1681 if (new_smc->use_fallback) { in smc_listen_work()
1682 smc_listen_out_connected(new_smc); in smc_listen_work()
1688 smc_switch_to_fallback(new_smc); in smc_listen_work()
1689 new_smc->fallback_rsn = SMC_CLC_DECL_PEERNOSMC; in smc_listen_work()
1690 smc_listen_out_connected(new_smc); in smc_listen_work()
1703 rc = smc_clc_wait_msg(new_smc, pclc, sizeof(*buf), in smc_listen_work()
1710 if (using_ipsec(new_smc)) { in smc_listen_work()
1722 rc = smc_listen_v2_check(new_smc, pclc, ini); in smc_listen_work()
1727 smc_close_init(new_smc); in smc_listen_work()
1728 smc_rx_init(new_smc); in smc_listen_work()
1729 smc_tx_init(new_smc); in smc_listen_work()
1732 rc = smc_listen_find_device(new_smc, pclc, ini); in smc_listen_work()
1737 rc = smc_clc_send_accept(new_smc, ini->first_contact_local, in smc_listen_work()
1749 rc = smc_clc_wait_msg(new_smc, cclc, sizeof(*buf), in smc_listen_work()
1759 rc = smc_listen_rdma_finish(new_smc, cclc, in smc_listen_work()
1765 smc_conn_save_peer_info(new_smc, cclc); in smc_listen_work()
1766 smc_listen_out_connected(new_smc); in smc_listen_work()
1772 smc_listen_decline(new_smc, rc, ini ? ini->first_contact_local : 0, in smc_listen_work()
1784 struct smc_sock *new_smc; in smc_tcp_listen_work() local
1789 rc = smc_clcsock_accept(lsmc, &new_smc); in smc_tcp_listen_work()
1792 if (!new_smc) in smc_tcp_listen_work()
1795 new_smc->listen_smc = lsmc; in smc_tcp_listen_work()
1796 new_smc->use_fallback = lsmc->use_fallback; in smc_tcp_listen_work()
1797 new_smc->fallback_rsn = lsmc->fallback_rsn; in smc_tcp_listen_work()
1799 INIT_WORK(&new_smc->smc_listen_work, smc_listen_work); in smc_tcp_listen_work()
1800 smc_copy_sock_settings_to_smc(new_smc); in smc_tcp_listen_work()
1801 new_smc->sk.sk_sndbuf = lsmc->sk.sk_sndbuf; in smc_tcp_listen_work()
1802 new_smc->sk.sk_rcvbuf = lsmc->sk.sk_rcvbuf; in smc_tcp_listen_work()
1803 sock_hold(&new_smc->sk); /* sock_put in passive closing */ in smc_tcp_listen_work()
1804 if (!queue_work(smc_hs_wq, &new_smc->smc_listen_work)) in smc_tcp_listen_work()
1805 sock_put(&new_smc->sk); in smc_tcp_listen_work()