Skip to content

Commit 7c8bcfb

Browse files
Jon Paul Maloydavem330
authored andcommitted
tipc: re-enable compensation for socket receive buffer double counting
In the refactoring commit d570d86 ("tipc: enqueue arrived buffers in socket in separate function") we did by accident replace the test if (sk->sk_backlog.len == 0) atomic_set(&tsk->dupl_rcvcnt, 0); with if (sk->sk_backlog.len) atomic_set(&tsk->dupl_rcvcnt, 0); This effectively disables the compensation we have for the double receive buffer accounting that occurs temporarily when buffers are moved from the backlog to the socket receive queue. Until now, this has gone unnoticed because of the large receive buffer limits we are applying, but becomes indispensable when we reduce this buffer limit later in this series. We now fix this by inverting the mentioned condition. Acked-by: Ying Xue <ying.xue@windriver.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2b84af9 commit 7c8bcfb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎net/tipc/socket.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1748,7 +1748,7 @@ static void tipc_sk_enqueue(struct sk_buff_head *inputq, struct sock *sk,
17481748

17491749
/* Try backlog, compensating for double-counted bytes */
17501750
dcnt = &tipc_sk(sk)->dupl_rcvcnt;
1751-
if (sk->sk_backlog.len)
1751+
if (!sk->sk_backlog.len)
17521752
atomic_set(dcnt, 0);
17531753
lim = rcvbuf_limit(sk, skb) + atomic_read(dcnt);
17541754
if (likely(!sk_add_backlog(sk, skb, lim)))

0 commit comments

Comments
 (0)