kernel: bump 5.15 to 5.15.115
[openwrt/staging/stintel.git] / target / linux / generic / backport-5.15 / 603-v5.19-page_pool-Add-recycle-stats-to-page_pool_put_page_bu.patch
index 6ae3fb71331b1b38c6c2b5f9458c9717333ddb75..f438ef3a5997944991009d6eee23a848a25a5fcd 100644 (file)
@@ -16,7 +16,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 
 --- a/net/core/page_pool.c
 +++ b/net/core/page_pool.c
-@@ -36,6 +36,12 @@
+@@ -59,6 +59,12 @@ static void page_pool_producer_unlock(st
                this_cpu_inc(s->__stat);                                                \
        } while (0)
  
@@ -29,7 +29,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  bool page_pool_get_stats(struct page_pool *pool,
                         struct page_pool_stats *stats)
  {
-@@ -63,6 +69,7 @@ EXPORT_SYMBOL(page_pool_get_stats);
+@@ -86,6 +92,7 @@ EXPORT_SYMBOL(page_pool_get_stats);
  #else
  #define alloc_stat_inc(pool, __stat)
  #define recycle_stat_inc(pool, __stat)
@@ -37,9 +37,9 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  #endif
  
  static int page_pool_init(struct page_pool *pool,
-@@ -569,9 +576,13 @@ void page_pool_put_page_bulk(struct page
+@@ -593,9 +600,13 @@ void page_pool_put_page_bulk(struct page
        /* Bulk producer into ptr_ring page_pool cache */
-       page_pool_ring_lock(pool);
+       in_softirq = page_pool_producer_lock(pool);
        for (i = 0; i < bulk_len; i++) {
 -              if (__ptr_ring_produce(&pool->ring, data[i]))
 -                      break; /* ring full */
@@ -50,6 +50,6 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
 +              }
        }
 +      recycle_stat_add(pool, ring, i);
-       page_pool_ring_unlock(pool);
+       page_pool_producer_unlock(pool, in_softirq);
  
        /* Hopefully all pages was return into ptr_ring */