Skip to content

Commit a072806

Browse files
Paolo Abeniintel-lab-lkp
authored andcommitted
net: dismiss sk_forward_alloc_get()
After the previous patch we can remove the forward_alloc_get proto callback, basically reverting commit 292e607 ("net: introduce sk_forward_alloc_get()") and commit 66d58f0 ("net: use sk_forward_alloc_get() in sk_get_meminfo()"). Signed-off-by: Paolo Abeni <[email protected]>
1 parent f4252ea commit a072806

File tree

5 files changed

+4
-17
lines changed

5 files changed

+4
-17
lines changed

include/net/sock.h

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,10 +1283,6 @@ struct proto {
12831283
unsigned int inuse_idx;
12841284
#endif
12851285

1286-
#if IS_ENABLED(CONFIG_MPTCP)
1287-
int (*forward_alloc_get)(const struct sock *sk);
1288-
#endif
1289-
12901286
bool (*stream_memory_free)(const struct sock *sk, int wake);
12911287
bool (*sock_is_readable)(struct sock *sk);
12921288
/* Memory pressure */
@@ -1347,15 +1343,6 @@ int sock_load_diag_module(int family, int protocol);
13471343

13481344
INDIRECT_CALLABLE_DECLARE(bool tcp_stream_memory_free(const struct sock *sk, int wake));
13491345

1350-
static inline int sk_forward_alloc_get(const struct sock *sk)
1351-
{
1352-
#if IS_ENABLED(CONFIG_MPTCP)
1353-
if (sk->sk_prot->forward_alloc_get)
1354-
return sk->sk_prot->forward_alloc_get(sk);
1355-
#endif
1356-
return READ_ONCE(sk->sk_forward_alloc);
1357-
}
1358-
13591346
static inline bool __sk_stream_memory_free(const struct sock *sk, int wake)
13601347
{
13611348
if (READ_ONCE(sk->sk_wmem_queued) >= READ_ONCE(sk->sk_sndbuf))

net/core/sock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3858,7 +3858,7 @@ void sk_get_meminfo(const struct sock *sk, u32 *mem)
38583858
mem[SK_MEMINFO_RCVBUF] = READ_ONCE(sk->sk_rcvbuf);
38593859
mem[SK_MEMINFO_WMEM_ALLOC] = sk_wmem_alloc_get(sk);
38603860
mem[SK_MEMINFO_SNDBUF] = READ_ONCE(sk->sk_sndbuf);
3861-
mem[SK_MEMINFO_FWD_ALLOC] = sk_forward_alloc_get(sk);
3861+
mem[SK_MEMINFO_FWD_ALLOC] = READ_ONCE(sk->sk_forward_alloc);
38623862
mem[SK_MEMINFO_WMEM_QUEUED] = READ_ONCE(sk->sk_wmem_queued);
38633863
mem[SK_MEMINFO_OPTMEM] = atomic_read(&sk->sk_omem_alloc);
38643864
mem[SK_MEMINFO_BACKLOG] = READ_ONCE(sk->sk_backlog.len);

net/ipv4/af_inet.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ void inet_sock_destruct(struct sock *sk)
153153
WARN_ON_ONCE(atomic_read(&sk->sk_rmem_alloc));
154154
WARN_ON_ONCE(refcount_read(&sk->sk_wmem_alloc));
155155
WARN_ON_ONCE(sk->sk_wmem_queued);
156-
WARN_ON_ONCE(sk_forward_alloc_get(sk));
156+
WARN_ON_ONCE(sk->sk_forward_alloc);
157157

158158
kfree(rcu_dereference_protected(inet->inet_opt, 1));
159159
dst_release(rcu_dereference_protected(sk->sk_dst_cache, 1));

net/ipv4/inet_diag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
282282
struct inet_diag_meminfo minfo = {
283283
.idiag_rmem = sk_rmem_alloc_get(sk),
284284
.idiag_wmem = READ_ONCE(sk->sk_wmem_queued),
285-
.idiag_fmem = sk_forward_alloc_get(sk),
285+
.idiag_fmem = READ_ONCE(sk->sk_forward_alloc),
286286
.idiag_tmem = sk_wmem_alloc_get(sk),
287287
};
288288

net/sched/em_meta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ META_COLLECTOR(int_sk_fwd_alloc)
460460
*err = -1;
461461
return;
462462
}
463-
dst->value = sk_forward_alloc_get(sk);
463+
dst->value = READ_ONCE(sk->sk_forward_alloc);
464464
}
465465

466466
META_COLLECTOR(int_sk_sndbuf)

0 commit comments

Comments
 (0)