Skip to content

Commit

Permalink
Revert "tcp: minor optimization in tcp_add_backlog()"
Browse files Browse the repository at this point in the history
This reverts commit d32ed7f.
  • Loading branch information
xanmod committed Nov 10, 2022
1 parent 4e2d257 commit 9f05608
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions net/ipv4/tcp_ipv4.c
Original file line number Diff line number Diff line change
Expand Up @@ -1808,7 +1808,8 @@ int tcp_v4_early_demux(struct sk_buff *skb)

bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb)
{
u32 limit, tail_gso_size, tail_gso_segs;
u32 limit = READ_ONCE(sk->sk_rcvbuf) + READ_ONCE(sk->sk_sndbuf);
u32 tail_gso_size, tail_gso_segs;
struct skb_shared_info *shinfo;
const struct tcphdr *th;
struct tcphdr *thtail;
Expand Down Expand Up @@ -1916,7 +1917,7 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb)
* to reduce memory overhead, so add a little headroom here.
* Few sockets backlog are possibly concurrently non empty.
*/
limit = READ_ONCE(sk->sk_rcvbuf) + READ_ONCE(sk->sk_sndbuf) + 64*1024;
limit += 64*1024;

if (unlikely(sk_add_backlog(sk, skb, limit))) {
bh_unlock_sock(sk);
Expand Down

0 comments on commit 9f05608

Please sign in to comment.