Lines Matching refs:new_smc

816 static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc)  in smc_clcsock_accept()  argument
828 *new_smc = NULL; in smc_clcsock_accept()
832 *new_smc = smc_sk(new_sk); in smc_clcsock_accept()
845 *new_smc = NULL; in smc_clcsock_accept()
849 (*new_smc)->clcsock = new_clcsock; in smc_clcsock_accept()
999 static void smc_listen_out(struct smc_sock *new_smc) in smc_listen_out() argument
1001 struct smc_sock *lsmc = new_smc->listen_smc; in smc_listen_out()
1002 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out()
1018 static void smc_listen_out_connected(struct smc_sock *new_smc) in smc_listen_out_connected() argument
1020 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_connected()
1026 smc_listen_out(new_smc); in smc_listen_out_connected()
1030 static void smc_listen_out_err(struct smc_sock *new_smc) in smc_listen_out_err() argument
1032 struct sock *newsmcsk = &new_smc->sk; in smc_listen_out_err()
1035 sock_put(&new_smc->sk); /* passive closing */ in smc_listen_out_err()
1037 smc_conn_free(&new_smc->conn); in smc_listen_out_err()
1039 smc_listen_out(new_smc); in smc_listen_out_err()
1043 static void smc_listen_decline(struct smc_sock *new_smc, int reason_code, in smc_listen_decline() argument
1048 smc_lgr_forget(new_smc->conn.lgr); in smc_listen_decline()
1050 smc_listen_out_err(new_smc); in smc_listen_decline()
1053 smc_conn_free(&new_smc->conn); in smc_listen_decline()
1054 new_smc->use_fallback = true; in smc_listen_decline()
1055 new_smc->fallback_rsn = reason_code; in smc_listen_decline()
1057 if (smc_clc_send_decline(new_smc, reason_code) < 0) { in smc_listen_decline()
1058 smc_listen_out_err(new_smc); in smc_listen_decline()
1062 smc_listen_out_connected(new_smc); in smc_listen_decline()
1066 static int smc_listen_rdma_check(struct smc_sock *new_smc, in smc_listen_rdma_check() argument
1070 struct socket *newclcsock = new_smc->clcsock; in smc_listen_rdma_check()
1080 static int smc_listen_rdma_init(struct smc_sock *new_smc, in smc_listen_rdma_init() argument
1086 *local_contact = smc_conn_create(new_smc, false, 0, ibdev, ibport, in smc_listen_rdma_init()
1095 if (smc_buf_create(new_smc, false)) in smc_listen_rdma_init()
1102 static int smc_listen_ism_init(struct smc_sock *new_smc, in smc_listen_ism_init() argument
1110 *local_contact = smc_conn_create(new_smc, true, 0, NULL, 0, NULL, in smc_listen_ism_init()
1119 if (smc_ism_cantalk(new_smc->conn.lgr->peer_gid, in smc_listen_ism_init()
1120 new_smc->conn.lgr->vlan_id, in smc_listen_ism_init()
1121 new_smc->conn.lgr->smcd)) { in smc_listen_ism_init()
1123 smc_lgr_forget(new_smc->conn.lgr); in smc_listen_ism_init()
1124 smc_conn_free(&new_smc->conn); in smc_listen_ism_init()
1129 if (smc_buf_create(new_smc, true)) { in smc_listen_ism_init()
1131 smc_lgr_forget(new_smc->conn.lgr); in smc_listen_ism_init()
1132 smc_conn_free(&new_smc->conn); in smc_listen_ism_init()
1140 static int smc_listen_rdma_reg(struct smc_sock *new_smc, int local_contact) in smc_listen_rdma_reg() argument
1142 struct smc_link *link = &new_smc->conn.lgr->lnk[SMC_SINGLE_LINK]; in smc_listen_rdma_reg()
1145 if (!new_smc->conn.rmb_desc->reused) { in smc_listen_rdma_reg()
1146 if (smc_reg_rmb(link, new_smc->conn.rmb_desc, true)) in smc_listen_rdma_reg()
1150 smc_rmb_sync_sg_for_device(&new_smc->conn); in smc_listen_rdma_reg()
1156 static int smc_listen_rdma_finish(struct smc_sock *new_smc, in smc_listen_rdma_finish() argument
1160 struct smc_link *link = &new_smc->conn.lgr->lnk[SMC_SINGLE_LINK]; in smc_listen_rdma_finish()
1166 if (smc_rmb_rtoken_handling(&new_smc->conn, cclc)) { in smc_listen_rdma_finish()
1177 reason_code = smc_serv_conf_first_link(new_smc); in smc_listen_rdma_finish()
1185 smc_listen_decline(new_smc, reason_code, local_contact); in smc_listen_rdma_finish()
1192 struct smc_sock *new_smc = container_of(work, struct smc_sock, in smc_listen_work() local
1194 struct socket *newclcsock = new_smc->clcsock; in smc_listen_work()
1207 if (new_smc->use_fallback) { in smc_listen_work()
1208 smc_listen_out_connected(new_smc); in smc_listen_work()
1214 new_smc->use_fallback = true; in smc_listen_work()
1215 new_smc->fallback_rsn = SMC_CLC_DECL_PEERNOSMC; in smc_listen_work()
1216 smc_listen_out_connected(new_smc); in smc_listen_work()
1224 reason_code = smc_clc_wait_msg(new_smc, pclc, SMC_CLC_MAX_LEN, in smc_listen_work()
1227 smc_listen_decline(new_smc, reason_code, 0); in smc_listen_work()
1232 if (using_ipsec(new_smc)) { in smc_listen_work()
1233 smc_listen_decline(new_smc, SMC_CLC_DECL_IPSEC, 0); in smc_listen_work()
1238 smc_close_init(new_smc); in smc_listen_work()
1239 smc_rx_init(new_smc); in smc_listen_work()
1240 smc_tx_init(new_smc); in smc_listen_work()
1244 !smc_check_ism(new_smc, &ismdev) && in smc_listen_work()
1245 !smc_listen_ism_init(new_smc, pclc, ismdev, &local_contact)) { in smc_listen_work()
1252 smc_vlan_by_tcpsk(new_smc->clcsock, &vlan) || in smc_listen_work()
1253 smc_check_rdma(new_smc, &ibdev, &ibport, vlan, NULL) || in smc_listen_work()
1254 smc_listen_rdma_check(new_smc, pclc) || in smc_listen_work()
1255 smc_listen_rdma_init(new_smc, pclc, ibdev, ibport, in smc_listen_work()
1257 smc_listen_rdma_reg(new_smc, local_contact))) { in smc_listen_work()
1260 smc_listen_decline(new_smc, SMC_CLC_DECL_MODEUNSUPP, in smc_listen_work()
1266 rc = smc_clc_send_accept(new_smc, local_contact); in smc_listen_work()
1269 smc_listen_decline(new_smc, rc, local_contact); in smc_listen_work()
1274 reason_code = smc_clc_wait_msg(new_smc, &cclc, sizeof(cclc), in smc_listen_work()
1278 smc_listen_decline(new_smc, reason_code, local_contact); in smc_listen_work()
1284 if (smc_listen_rdma_finish(new_smc, &cclc, local_contact)) in smc_listen_work()
1287 smc_conn_save_peer_info(new_smc, &cclc); in smc_listen_work()
1289 smc_listen_out_connected(new_smc); in smc_listen_work()
1297 struct smc_sock *new_smc; in smc_tcp_listen_work() local
1302 rc = smc_clcsock_accept(lsmc, &new_smc); in smc_tcp_listen_work()
1305 if (!new_smc) in smc_tcp_listen_work()
1308 new_smc->listen_smc = lsmc; in smc_tcp_listen_work()
1309 new_smc->use_fallback = lsmc->use_fallback; in smc_tcp_listen_work()
1310 new_smc->fallback_rsn = lsmc->fallback_rsn; in smc_tcp_listen_work()
1312 INIT_WORK(&new_smc->smc_listen_work, smc_listen_work); in smc_tcp_listen_work()
1313 smc_copy_sock_settings_to_smc(new_smc); in smc_tcp_listen_work()
1314 new_smc->sk.sk_sndbuf = lsmc->sk.sk_sndbuf; in smc_tcp_listen_work()
1315 new_smc->sk.sk_rcvbuf = lsmc->sk.sk_rcvbuf; in smc_tcp_listen_work()
1316 sock_hold(&new_smc->sk); /* sock_put in passive closing */ in smc_tcp_listen_work()
1317 if (!schedule_work(&new_smc->smc_listen_work)) in smc_tcp_listen_work()
1318 sock_put(&new_smc->sk); in smc_tcp_listen_work()