net: dismiss sk_forward_alloc_get()
After the previous patch we can remove the forward_alloc_get proto callback, basically reverting commitpull/1188/head292e6077b0("net: introduce sk_forward_alloc_get()") and commit66d58f046c("net: use sk_forward_alloc_get() in sk_get_meminfo()"). Signed-off-by: Paolo Abeni <pabeni@redhat.com> Acked-by: Mat Martineau <martineau@kernel.org> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org> Link: https://patch.msgid.link/20250218-net-next-mptcp-rx-path-refactor-v1-5-4a47d90d7998@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
parent
6639498ed8
commit
c8802ded46
|
|
@ -1285,10 +1285,6 @@ struct proto {
|
|||
unsigned int inuse_idx;
|
||||
#endif
|
||||
|
||||
#if IS_ENABLED(CONFIG_MPTCP)
|
||||
int (*forward_alloc_get)(const struct sock *sk);
|
||||
#endif
|
||||
|
||||
bool (*stream_memory_free)(const struct sock *sk, int wake);
|
||||
bool (*sock_is_readable)(struct sock *sk);
|
||||
/* Memory pressure */
|
||||
|
|
@ -1349,15 +1345,6 @@ int sock_load_diag_module(int family, int protocol);
|
|||
|
||||
INDIRECT_CALLABLE_DECLARE(bool tcp_stream_memory_free(const struct sock *sk, int wake));
|
||||
|
||||
static inline int sk_forward_alloc_get(const struct sock *sk)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_MPTCP)
|
||||
if (sk->sk_prot->forward_alloc_get)
|
||||
return sk->sk_prot->forward_alloc_get(sk);
|
||||
#endif
|
||||
return READ_ONCE(sk->sk_forward_alloc);
|
||||
}
|
||||
|
||||
static inline bool __sk_stream_memory_free(const struct sock *sk, int wake)
|
||||
{
|
||||
if (READ_ONCE(sk->sk_wmem_queued) >= READ_ONCE(sk->sk_sndbuf))
|
||||
|
|
|
|||
|
|
@ -3882,7 +3882,7 @@ void sk_get_meminfo(const struct sock *sk, u32 *mem)
|
|||
mem[SK_MEMINFO_RCVBUF] = READ_ONCE(sk->sk_rcvbuf);
|
||||
mem[SK_MEMINFO_WMEM_ALLOC] = sk_wmem_alloc_get(sk);
|
||||
mem[SK_MEMINFO_SNDBUF] = READ_ONCE(sk->sk_sndbuf);
|
||||
mem[SK_MEMINFO_FWD_ALLOC] = sk_forward_alloc_get(sk);
|
||||
mem[SK_MEMINFO_FWD_ALLOC] = READ_ONCE(sk->sk_forward_alloc);
|
||||
mem[SK_MEMINFO_WMEM_QUEUED] = READ_ONCE(sk->sk_wmem_queued);
|
||||
mem[SK_MEMINFO_OPTMEM] = atomic_read(&sk->sk_omem_alloc);
|
||||
mem[SK_MEMINFO_BACKLOG] = READ_ONCE(sk->sk_backlog.len);
|
||||
|
|
|
|||
|
|
@ -153,7 +153,7 @@ void inet_sock_destruct(struct sock *sk)
|
|||
WARN_ON_ONCE(atomic_read(&sk->sk_rmem_alloc));
|
||||
WARN_ON_ONCE(refcount_read(&sk->sk_wmem_alloc));
|
||||
WARN_ON_ONCE(sk->sk_wmem_queued);
|
||||
WARN_ON_ONCE(sk_forward_alloc_get(sk));
|
||||
WARN_ON_ONCE(sk->sk_forward_alloc);
|
||||
|
||||
kfree(rcu_dereference_protected(inet->inet_opt, 1));
|
||||
dst_release(rcu_dereference_protected(sk->sk_dst_cache, 1));
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
|
|||
struct inet_diag_meminfo minfo = {
|
||||
.idiag_rmem = sk_rmem_alloc_get(sk),
|
||||
.idiag_wmem = READ_ONCE(sk->sk_wmem_queued),
|
||||
.idiag_fmem = sk_forward_alloc_get(sk),
|
||||
.idiag_fmem = READ_ONCE(sk->sk_forward_alloc),
|
||||
.idiag_tmem = sk_wmem_alloc_get(sk),
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ META_COLLECTOR(int_sk_fwd_alloc)
|
|||
*err = -1;
|
||||
return;
|
||||
}
|
||||
dst->value = sk_forward_alloc_get(sk);
|
||||
dst->value = READ_ONCE(sk->sk_forward_alloc);
|
||||
}
|
||||
|
||||
META_COLLECTOR(int_sk_sndbuf)
|
||||
|
|
|
|||
Loading…
Reference in New Issue