net/sched: taprio: delete peek() implementation
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 7 Feb 2023 13:54:26 +0000 (15:54 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 8 Feb 2023 09:48:52 +0000 (09:48 +0000)
There isn't any code in the network stack which calls taprio_peek().
We only see qdisc->ops->peek() being called on child qdiscs of other
classful qdiscs, never from the generic qdisc code. Whereas taprio is
never a child qdisc, it is always root.

This snippet of a comment from qdisc_peek_dequeued() seems to confirm:

/* we can reuse ->gso_skb because peek isn't called for root qdiscs */

Since I've been known to be wrong many times though, I'm not completely
removing it, but leaving a stub function in place which emits a warning.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_taprio.c

index 1c95785932b950b4a231933ce3bafa83dbcf5550..d9e26ddaa7f23f1218cc77fb725773da60b1d399 100644 (file)
@@ -499,50 +499,9 @@ static int taprio_enqueue(struct sk_buff *skb, struct Qdisc *sch,
        return taprio_enqueue_one(skb, sch, child, to_free);
 }
 
-/* Will not be called in the full offload case, since the TX queues are
- * attached to the Qdisc created using qdisc_create_dflt()
- */
 static struct sk_buff *taprio_peek(struct Qdisc *sch)
 {
-       struct taprio_sched *q = qdisc_priv(sch);
-       struct net_device *dev = qdisc_dev(sch);
-       struct sched_entry *entry;
-       struct sk_buff *skb;
-       u32 gate_mask;
-       int i;
-
-       rcu_read_lock();
-       entry = rcu_dereference(q->current_entry);
-       gate_mask = entry ? entry->gate_mask : TAPRIO_ALL_GATES_OPEN;
-       rcu_read_unlock();
-
-       if (!gate_mask)
-               return NULL;
-
-       for (i = 0; i < dev->num_tx_queues; i++) {
-               struct Qdisc *child = q->qdiscs[i];
-               int prio;
-               u8 tc;
-
-               if (unlikely(!child))
-                       continue;
-
-               skb = child->ops->peek(child);
-               if (!skb)
-                       continue;
-
-               if (TXTIME_ASSIST_IS_ENABLED(q->flags))
-                       return skb;
-
-               prio = skb->priority;
-               tc = netdev_get_prio_tc_map(dev, prio);
-
-               if (!(gate_mask & BIT(tc)))
-                       continue;
-
-               return skb;
-       }
-
+       WARN_ONCE(1, "taprio only supports operating as root qdisc, peek() not implemented");
        return NULL;
 }