@@ -16,29 +16,35 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
1616
1717--- a/net/core/page_pool.c
1818+++ b/net/core/page_pool.c
19- @@ -1124,7 +1124,7 @@ static void page_pool_release_retry(stru
19+ @@ -1123,8 +1123,9 @@ static void page_pool_release_retry(stru
20+ {
2021 struct delayed_work *dwq = to_delayed_work(wq);
2122 struct page_pool *pool = container_of(dwq, typeof(*pool), release_dw);
23+ + unsigned long flags;
2224 void *netdev;
2325- int inflight;
2426+ int cpu, inflight;
2527
2628 inflight = page_pool_release(pool);
2729 /* In rare cases, a driver bug may cause inflight to go negative.
28- @@ -1136,6 +1136,17 @@ static void page_pool_release_retry(stru
30+ @@ -1136,6 +1137,21 @@ static void page_pool_release_retry(stru
2931 if (inflight <= 0)
3032 return;
3133
3234+ /* Run NET_RX_SOFTIRQ in order to free pending skbs in softnet_data
3335+ * defer_list that can stay in the list until we have enough queued
3436+ * traffic.
3537+ */
38+ + local_irq_save(flags);
3639+ for_each_online_cpu(cpu) {
3740+ struct softnet_data *sd = &per_cpu(softnet_data, cpu);
3841+
39- + if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1))
42+ + if (cpu == raw_smp_processor_id())
43+ + raise_softirq_irqoff(NET_RX_SOFTIRQ);
44+ + else if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1))
4045+ smp_call_function_single_async(cpu, &sd->defer_csd);
4146+ }
47+ + local_irq_restore(flags);
4248+
4349 /* Periodic warning for page pools the user can't see */
4450 netdev = READ_ONCE(pool->slow.netdev);
0 commit comments