diff options
author | Guoqing Jiang <guoqing.jiang@linux.dev> | 2023-11-13 19:57:22 +0800 |
---|---|---|
committer | Leon Romanovsky <leon@kernel.org> | 2023-11-15 15:58:14 +0200 |
commit | a410a7327870264da2a1a3eed704380053ffdf9f (patch) | |
tree | aa2e4e557c966757c636ebe3c532d815f8973c3f /drivers/infiniband/sw/siw/siw_cm.c | |
parent | 77b59bd932a026b64303d313d966decb0e9225fa (diff) |
RDMA/siw: Remove siw_sk_save_upcalls
Let's move it into siw_sk_assign_cm_upcalls, then we only
need to get sk_callback_lock once.
Acked-by: Bernard Metzler <bmt@zurich.ibm.com>
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Link: https://lore.kernel.org/r/20231113115726.12762-14-guoqing.jiang@linux.dev
Signed-off-by: Leon Romanovsky <leon@kernel.org>
Diffstat (limited to 'drivers/infiniband/sw/siw/siw_cm.c')
-rw-r--r-- | drivers/infiniband/sw/siw/siw_cm.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/infiniband/sw/siw/siw_cm.c b/drivers/infiniband/sw/siw/siw_cm.c index 5e9a591eec58..5c0f9f8bf3db 100644 --- a/drivers/infiniband/sw/siw/siw_cm.c +++ b/drivers/infiniband/sw/siw/siw_cm.c @@ -41,16 +41,6 @@ static int siw_cm_upcall(struct siw_cep *cep, enum iw_cm_event_type reason, static void siw_sk_assign_cm_upcalls(struct sock *sk) { - write_lock_bh(&sk->sk_callback_lock); - sk->sk_state_change = siw_cm_llp_state_change; - sk->sk_data_ready = siw_cm_llp_data_ready; - sk->sk_write_space = siw_cm_llp_write_space; - sk->sk_error_report = siw_cm_llp_error_report; - write_unlock_bh(&sk->sk_callback_lock); -} - -static void siw_sk_save_upcalls(struct sock *sk) -{ struct siw_cep *cep = sk_to_cep(sk); write_lock_bh(&sk->sk_callback_lock); @@ -58,6 +48,11 @@ static void siw_sk_save_upcalls(struct sock *sk) cep->sk_data_ready = sk->sk_data_ready; cep->sk_write_space = sk->sk_write_space; cep->sk_error_report = sk->sk_error_report; + + sk->sk_state_change = siw_cm_llp_state_change; + sk->sk_data_ready = siw_cm_llp_data_ready; + sk->sk_write_space = siw_cm_llp_write_space; + sk->sk_error_report = siw_cm_llp_error_report; write_unlock_bh(&sk->sk_callback_lock); } @@ -156,7 +151,6 @@ static void siw_cep_socket_assoc(struct siw_cep *cep, struct socket *s) siw_cep_get(cep); s->sk->sk_user_data = cep; - siw_sk_save_upcalls(s->sk); siw_sk_assign_cm_upcalls(s->sk); } |