[PATCH mptcp-next v2 2/3] mptcp: allow overridden write_space to be invoked

Geliang Tang posted 3 patches 4 days, 12 hours ago
[PATCH mptcp-next v2 2/3] mptcp: allow overridden write_space to be invoked
Posted by Geliang Tang 4 days, 12 hours ago
From: Geliang Tang <tanggeliang@kylinos.cn>

psock may override its own sk_write_space functions. This patch ensures
that the overridden sk_write_space can be invoked by MPTCP.

Note: This patch was initially included in the NVME MPTCP set.

Suggested-by: Paolo Abeni <pabeni@redhat.com>
Co-developed-by: Gang Yan <yangang@kylinos.cn>
Signed-off-by: Gang Yan <yangang@kylinos.cn>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
 net/mptcp/protocol.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index cd5266099993..f5d4d7d030f2 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1014,7 +1014,7 @@ static inline void mptcp_write_space(struct sock *sk)
 	/* pairs with memory barrier in mptcp_poll */
 	smp_mb();
 	if (mptcp_stream_memory_free(sk, 1))
-		sk_stream_write_space(sk);
+		INDIRECT_CALL_1(sk->sk_write_space, sk_stream_write_space, sk);
 }
 
 static inline void __mptcp_sync_sndbuf(struct sock *sk)
-- 
2.51.0