Skip to content

Commit 5c4b460

Browse files
Jakub Kicinskidavem330
authored andcommitted
net/tls: fix socket wmem accounting on fallback with netem
netem runs skb_orphan_partial() which "disconnects" the skb from normal TCP write memory accounting. We should not adjust sk->sk_wmem_alloc on the fallback path for such skbs. Fixes: e8f6979 ("net/tls: Add generic NIC offload infrastructure") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5a4cea2 commit 5c4b460

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/tls/tls_device_fallback.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,10 @@ static void complete_skb(struct sk_buff *nskb, struct sk_buff *skb, int headln)
209209

210210
update_chksum(nskb, headln);
211211

212+
/* sock_efree means skb must gone through skb_orphan_partial() */
213+
if (nskb->destructor == sock_efree)
214+
return;
215+
212216
delta = nskb->truesize - skb->truesize;
213217
if (likely(delta < 0))
214218
WARN_ON_ONCE(refcount_sub_and_test(-delta, &sk->sk_wmem_alloc));

0 commit comments

Comments
 (0)