generic: 6.6: refresh pending patches
[openwrt/staging/981213.git] / target / linux / generic / pending-6.6 / 760-net-core-add-optional-threading-for-backlog-processi.patch
index bb9149a66833562d559d3a4daf3aed64356a0004..013005f053826f46c84e790808c7a636b08ae699 100644 (file)
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/include/linux/netdevice.h
 +++ b/include/linux/netdevice.h
-@@ -543,6 +543,7 @@ static inline bool napi_complete(struct
+@@ -558,6 +558,7 @@ static inline bool napi_complete(struct
  }
  
  int dev_set_threaded(struct net_device *dev, bool threaded);
@@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
  /**
   *    napi_disable - prevent NAPI from scheduling
-@@ -3129,6 +3130,7 @@ struct softnet_data {
+@@ -3238,6 +3239,7 @@ struct softnet_data {
        /* stats */
        unsigned int            processed;
        unsigned int            time_squeeze;
@@ -30,7 +30,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #endif
 --- a/net/core/dev.c
 +++ b/net/core/dev.c
-@@ -4625,7 +4625,7 @@ static int napi_schedule_rps(struct soft
+@@ -4729,7 +4729,7 @@ static void napi_schedule_rps(struct sof
        struct softnet_data *mysd = this_cpu_ptr(&softnet_data);
  
  #ifdef CONFIG_RPS
@@ -39,7 +39,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                sd->rps_ipi_next = mysd->rps_ipi_list;
                mysd->rps_ipi_list = sd;
  
-@@ -5806,6 +5806,8 @@ static DEFINE_PER_CPU(struct work_struct
+@@ -5848,6 +5848,8 @@ static DEFINE_PER_CPU(struct work_struct
  /* Network device is going away, flush any packets still pending */
  static void flush_backlog(struct work_struct *work)
  {
@@ -48,7 +48,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        struct sk_buff *skb, *tmp;
        struct softnet_data *sd;
  
-@@ -5820,8 +5822,17 @@ static void flush_backlog(struct work_st
+@@ -5862,8 +5864,17 @@ static void flush_backlog(struct work_st
                        input_queue_head_incr(sd);
                }
        }
@@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
        skb_queue_walk_safe(&sd->process_queue, skb, tmp) {
                if (skb->dev->reg_state == NETREG_UNREGISTERING) {
                        __skb_unlink(skb, &sd->process_queue);
-@@ -5829,7 +5840,16 @@ static void flush_backlog(struct work_st
+@@ -5871,7 +5882,16 @@ static void flush_backlog(struct work_st
                        input_queue_head_incr(sd);
                }
        }
@@ -83,7 +83,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  }
  
  static bool flush_required(int cpu)
-@@ -5961,6 +5981,7 @@ static int process_backlog(struct napi_s
+@@ -6003,6 +6023,7 @@ static int process_backlog(struct napi_s
                }
  
                rps_lock_irq_disable(sd);
@@ -91,7 +91,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                if (skb_queue_empty(&sd->input_pkt_queue)) {
                        /*
                         * Inline a custom version of __napi_complete().
-@@ -5970,7 +5991,8 @@ static int process_backlog(struct napi_s
+@@ -6012,7 +6033,8 @@ static int process_backlog(struct napi_s
                         * We can use a plain write instead of clear_bit(),
                         * and we dont need an smp_mb() memory barrier.
                         */
@@ -101,7 +101,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                        again = false;
                } else {
                        skb_queue_splice_tail_init(&sd->input_pkt_queue,
-@@ -6386,6 +6408,55 @@ int dev_set_threaded(struct net_device *
+@@ -6426,6 +6448,55 @@ int dev_set_threaded(struct net_device *
  }
  EXPORT_SYMBOL(dev_set_threaded);
  
@@ -157,7 +157,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  void netif_napi_add_weight(struct net_device *dev, struct napi_struct *napi,
                           int (*poll)(struct napi_struct *, int), int weight)
  {
-@@ -11168,6 +11239,9 @@ static int dev_cpu_dead(unsigned int old
+@@ -11348,6 +11419,9 @@ static int dev_cpu_dead(unsigned int old
        raise_softirq_irqoff(NET_TX_SOFTIRQ);
        local_irq_enable();
  
@@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #ifdef CONFIG_RPS
        remsd = oldsd->rps_ipi_list;
        oldsd->rps_ipi_list = NULL;
-@@ -11480,6 +11554,7 @@ static int __init net_dev_init(void)
+@@ -11663,6 +11737,7 @@ static int __init net_dev_init(void)
                INIT_CSD(&sd->defer_csd, trigger_rx_softirq, sd);
                spin_lock_init(&sd->defer_lock);
  
@@ -177,7 +177,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
                sd->backlog.weight = weight_p;
 --- a/net/core/sysctl_net_core.c
 +++ b/net/core/sysctl_net_core.c
-@@ -29,6 +29,7 @@ static int int_3600 = 3600;
+@@ -30,6 +30,7 @@ static int int_3600 = 3600;
  static int min_sndbuf = SOCK_MIN_SNDBUF;
  static int min_rcvbuf = SOCK_MIN_RCVBUF;
  static int max_skb_frags = MAX_SKB_FRAGS;
@@ -185,7 +185,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  
  static int net_msg_warn;      /* Unused, but still a sysctl */
  
-@@ -112,6 +113,23 @@ static int rps_sock_flow_sysctl(struct c
+@@ -188,6 +189,23 @@ static int rps_sock_flow_sysctl(struct c
  }
  #endif /* CONFIG_RPS */
  
@@ -209,7 +209,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
  #ifdef CONFIG_NET_FLOW_LIMIT
  static DEFINE_MUTEX(flow_limit_update_mutex);
  
-@@ -473,6 +491,15 @@ static struct ctl_table net_core_table[]
+@@ -532,6 +550,15 @@ static struct ctl_table net_core_table[]
                .proc_handler   = rps_sock_flow_sysctl
        },
  #endif