kernel: add support for kernel 5.4
[openwrt/staging/wigyori.git] / target / linux / generic / hack-5.4 / 662-remove_pfifo_fast.patch
index e49507a5904472a6ed5cbf753b8cc84d94927c76..149a923dcb42b9bc664c0e393018ef08916217a5 100644 (file)
@@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 
 --- a/net/sched/sch_generic.c
 +++ b/net/sched/sch_generic.c
-@@ -612,207 +612,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
+@@ -594,211 +594,6 @@ struct Qdisc_ops noqueue_qdisc_ops __rea
        .owner          =       THIS_MODULE,
  };
  
@@ -49,14 +49,14 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 -
 -      err = skb_array_produce(q, skb);
 -
--      if (unlikely(err))
--              return qdisc_drop_cpu(skb, qdisc, to_free);
+-      if (unlikely(err)) {
+-              if (qdisc_is_percpu_stats(qdisc))
+-                      return qdisc_drop_cpu(skb, qdisc, to_free);
+-              else
+-                      return qdisc_drop(skb, qdisc, to_free);
+-      }
 -
--      qdisc_qstats_atomic_qlen_inc(qdisc);
--      /* Note: skb can not be used after skb_array_produce(),
--       * so we better not use qdisc_qstats_cpu_backlog_inc()
--       */
--      this_cpu_add(qdisc->cpu_qstats->backlog, pkt_len);
+-      qdisc_update_stats_at_enqueue(qdisc, pkt_len);
 -      return NET_XMIT_SUCCESS;
 -}
 -
@@ -75,9 +75,9 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 -              skb = __skb_array_consume(q);
 -      }
 -      if (likely(skb)) {
--              qdisc_qstats_cpu_backlog_dec(qdisc, skb);
--              qdisc_bstats_cpu_update(qdisc, skb);
--              qdisc_qstats_atomic_qlen_dec(qdisc);
+-              qdisc_update_stats_at_dequeue(qdisc, skb);
+-      } else {
+-              WRITE_ONCE(qdisc->empty, true);
 -      }
 -
 -      return skb;
@@ -117,10 +117,14 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 -                      kfree_skb(skb);
 -      }
 -
--      for_each_possible_cpu(i) {
--              struct gnet_stats_queue *q = per_cpu_ptr(qdisc->cpu_qstats, i);
+-      if (qdisc_is_percpu_stats(qdisc)) {
+-              for_each_possible_cpu(i) {
+-                      struct gnet_stats_queue *q;
 -
--              q->backlog = 0;
+-                      q = per_cpu_ptr(qdisc->cpu_qstats, i);
+-                      q->backlog = 0;
+-                      q->qlen = 0;
+-              }
 -      }
 -}
 -
@@ -215,6 +219,6 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
 -};
 -EXPORT_SYMBOL(pfifo_fast_ops);
 -
- static struct lock_class_key qdisc_tx_busylock;
- static struct lock_class_key qdisc_running_key;
+ struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
+                         const struct Qdisc_ops *ops,
+                         struct netlink_ext_ack *extack)