Lines Matching refs:smc
24 void smc_clcsock_release(struct smc_sock *smc) in smc_clcsock_release() argument
28 if (smc->listen_smc && current_work() != &smc->smc_listen_work) in smc_clcsock_release()
29 cancel_work_sync(&smc->smc_listen_work); in smc_clcsock_release()
30 mutex_lock(&smc->clcsock_release_lock); in smc_clcsock_release()
31 if (smc->clcsock) { in smc_clcsock_release()
32 tcp = smc->clcsock; in smc_clcsock_release()
33 smc->clcsock = NULL; in smc_clcsock_release()
36 mutex_unlock(&smc->clcsock_release_lock); in smc_clcsock_release()
49 static void smc_close_stream_wait(struct smc_sock *smc, long timeout) in smc_close_stream_wait() argument
52 struct sock *sk = &smc->sk; in smc_close_stream_wait()
57 if (!smc_tx_prepared_sends(&smc->conn)) in smc_close_stream_wait()
60 smc->wait_close_tx_prepared = 1; in smc_close_stream_wait()
66 !smc_tx_prepared_sends(&smc->conn) || in smc_close_stream_wait()
69 smc->conn.killed, in smc_close_stream_wait()
75 smc->wait_close_tx_prepared = 0; in smc_close_stream_wait()
78 void smc_close_wake_tx_prepared(struct smc_sock *smc) in smc_close_wake_tx_prepared() argument
80 if (smc->wait_close_tx_prepared) in smc_close_wake_tx_prepared()
82 smc->sk.sk_state_change(&smc->sk); in smc_close_wake_tx_prepared()
111 static void smc_close_cancel_work(struct smc_sock *smc) in smc_close_cancel_work() argument
113 struct sock *sk = &smc->sk; in smc_close_cancel_work()
116 cancel_work_sync(&smc->conn.close_work); in smc_close_cancel_work()
117 cancel_delayed_work_sync(&smc->conn.tx_work); in smc_close_cancel_work()
124 void smc_close_active_abort(struct smc_sock *smc) in smc_close_active_abort() argument
126 struct sock *sk = &smc->sk; in smc_close_active_abort()
129 if (sk->sk_state != SMC_INIT && smc->clcsock && smc->clcsock->sk) { in smc_close_active_abort()
131 if (smc->clcsock && smc->clcsock->sk) in smc_close_active_abort()
132 tcp_abort(smc->clcsock->sk, ECONNABORTED); in smc_close_active_abort()
139 smc_close_cancel_work(smc); in smc_close_active_abort()
149 smc_close_cancel_work(smc); in smc_close_active_abort()
153 smc_conn_free(&smc->conn); in smc_close_active_abort()
160 smc_close_cancel_work(smc); in smc_close_active_abort()
164 smc_conn_free(&smc->conn); in smc_close_active_abort()
178 smc_clcsock_release(smc); in smc_close_active_abort()
189 int smc_close_active(struct smc_sock *smc) in smc_close_active() argument
192 &smc->conn.local_tx_ctrl.conn_state_flags; in smc_close_active()
193 struct smc_connection *conn = &smc->conn; in smc_close_active()
194 struct sock *sk = &smc->sk; in smc_close_active()
213 if (smc->clcsock && smc->clcsock->sk) { in smc_close_active()
214 smc->clcsock->sk->sk_data_ready = smc->clcsk_data_ready; in smc_close_active()
215 smc->clcsock->sk->sk_user_data = NULL; in smc_close_active()
216 rc = kernel_sock_shutdown(smc->clcsock, SHUT_RDWR); in smc_close_active()
220 flush_work(&smc->tcp_listen_work); in smc_close_active()
224 smc_close_stream_wait(smc, timeout); in smc_close_active()
236 if (smc->clcsock && smc->clcsock->sk) { in smc_close_active()
237 rc1 = kernel_sock_shutdown(smc->clcsock, in smc_close_active()
258 smc_close_stream_wait(smc, timeout); in smc_close_active()
305 static void smc_close_passive_abort_received(struct smc_sock *smc) in smc_close_passive_abort_received() argument
308 &smc->conn.local_tx_ctrl.conn_state_flags; in smc_close_passive_abort_received()
309 struct sock *sk = &smc->sk; in smc_close_passive_abort_received()
324 !smc_close_sent_any_close(&smc->conn)) in smc_close_passive_abort_received()
354 struct smc_sock *smc = container_of(conn, struct smc_sock, conn); in smc_close_passive_work() local
357 struct sock *sk = &smc->sk; in smc_close_passive_work()
366 smc_close_passive_abort_received(smc); in smc_close_passive_work()
430 if (smc->clcsock) in smc_close_passive_work()
436 smc_clcsock_release(smc); in smc_close_passive_work()
440 int smc_close_shutdown_write(struct smc_sock *smc) in smc_close_shutdown_write() argument
442 struct smc_connection *conn = &smc->conn; in smc_close_shutdown_write()
443 struct sock *sk = &smc->sk; in smc_close_shutdown_write()
456 smc_close_stream_wait(smc, timeout); in smc_close_shutdown_write()
469 smc_close_stream_wait(smc, timeout); in smc_close_shutdown_write()
496 void smc_close_init(struct smc_sock *smc) in smc_close_init() argument
498 INIT_WORK(&smc->conn.close_work, smc_close_passive_work); in smc_close_init()