Skip to content

Commit 0943404

Browse files
edumazetkuba-moo
authored andcommitted
net: do not delay zero-copy skbs in skb_attempt_defer_free()
After the blamed commit, TCP tx zero copy notifications could be arbitrarily delayed and cause regressions in applications waiting for them. Signed-off-by: Eric Dumazet <[email protected]> Fixes: e20dfba ("net: fix napi_consume_skb() with alien skbs") Reviewed-by: Jason Xing <[email protected]> Reviewed-by: Willem de Bruijn <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6e980df commit 0943404

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

net/core/skbuff.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7266,10 +7266,15 @@ void skb_attempt_defer_free(struct sk_buff *skb)
72667266
{
72677267
struct skb_defer_node *sdn;
72687268
unsigned long defer_count;
7269-
int cpu = skb->alloc_cpu;
72707269
unsigned int defer_max;
72717270
bool kick;
7271+
int cpu;
72727272

7273+
/* zero copy notifications should not be delayed. */
7274+
if (skb_zcopy(skb))
7275+
goto nodefer;
7276+
7277+
cpu = skb->alloc_cpu;
72737278
if (cpu == raw_smp_processor_id() ||
72747279
WARN_ON_ONCE(cpu >= nr_cpu_ids) ||
72757280
!cpu_online(cpu)) {

0 commit comments

Comments
 (0)