Skip to content

: Final set of TX multiqueue changes.

David Miller linux-wireless netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 of 31 patches 5 repliesIn review

18 of 31 patches are in this archive. The cover letter announces 31.

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
2/31: netdev: Allocate multiple queues for TX.drivers/net/bonding/bond_main.c drivers/net/hamradio/bpqether.c drivers/net/ifb.c +15 more+320 -1371 reply
4/31: pkt_sched: Remove RR scheduler.include/linux/pkt_sched.h net/sched/sch_prio.c+16 -1290 replies
6/31: net: Use queue aware tests throughout.drivers/net/cpmac.c drivers/net/igb/igb_main.c drivers/net/ixgbe/ixgbe_ethtool.c +9 more+187 -1430 replies
7/31: netdev: Kill struct net_device_subqueue and netdev->egress_subqueue*include/linux/netdevice.h+0 -120 replies
8/31: netdev: netdev_priv() can now be sane again.drivers/net/loopback.c include/linux/netdevice.h+7 -50 replies
9/31: netdev: Add netdev->select_queue() method.include/linux/netdevice.h net/core/dev.c+9 -30 replies
11/31: net: Implement simple sw TX hashing.net/core/dev.c+52 -03 replies
12/31: netdev: Convert all drivers away from netif_schedule().drivers/net/au1000_eth.c drivers/net/bfin_mac.c drivers/net/fec_mpc52xx.c +6 more+11 -110 replies
13/31: netdev: Kill plain netif_schedule()include/linux/netdevice.h+0 -50 replies
15/31: pkt_sched: Move gso_skb into Qdisc.include/linux/netdevice.h include/net/sch_generic.h net/sched/sch_generic.c+10 -110 replies
16/31: pkt_sched: Make QDISC_RUNNING a qdisc state.include/linux/netdevice.h include/net/pkt_sched.h include/net/sch_generic.h +1 more+19 -100 replies
18/31: pkt_sched: Schedule qdiscs instead of netdev_queue.include/linux/netdevice.h include/net/pkt_sched.h include/net/sch_generic.h +4 more+55 -730 replies
19/31: pkt_sched: dev_init_scheduler() does not need to lock qdisc tree.net/sched/sch_generic.c+0 -20 replies
21/31: pkt_sched: Use per-queue locking in shutdown_scheduler_queue.net/sched/sch_generic.c+4 -20 replies
22/31: pkt_sched: Remove qdisc_lock_tree usage in cls_api.cnet/sched/cls_api.c+7 -40 replies
25/31: pkt_sched: Make qdisc grafting locking more specific.net/sched/sch_api.c+29 -120 replies
29/31: pkt_sched: Add multiqueue handling to qdisc_graft().net/sched/sch_api.c+59 -420 replies
30/31: pkt_sched: Don't used locked skb_queue_purge() in __qdisc_reset_queue()include/net/sch_generic.h+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/31]: Final set of TX multiqueue changes.

I'd like to first thank Patrick McHardy for pointing out the need for shared qdisc handling, even though it meant that I had to essentially toss out the 10,000 lines of code I wrote last weekend and start all over again :-)

I'd also like to thank Johannes for help he has provided on the wireless front.

Johannes, I did everything except move the wireless mac80211 requeue work into a workqueue and then add the synchronize_net() call. If you could hack up that patch and test it I'd really appreciate it.

Next, I'd like to thank Eric Dumazet for his great feedback as well. I still have to think about how I want to make the hash modulus cheaper.

And finally I'd like to thank Jeff Kirsher for sending me the IGB multiqueue patches. He's the only person who sent me any driver work for this new infrastructure.

With these changesets, a single qdisc shared as the root of several TX queues is implemented. It is all refreshed and present in:

	kernel.org:/pub/scm/linux/kernel/git/davem/net-tx-2.6.git

which is a clone of current net-next-2.6 as usual.

The default qdisc has changed to one that is simple enough to not require sharing. It's a completely dumb fifo, and pfifo_fast is gone. We can look at borrowing the sch_fifo.c code for this, but that would require a few changes, for example we'd need to build it in even when NET_SCHED is not set.

The locking is now completely refreshed. This was the largest hurdle in the new work of allowing shared qdiscs. It basically comes down to three things:

1) RCU is used more aggressively for qdisc destruction. We can queue into a qdisc after qdisc_destroy() is called, up until the RCU handler is invoked.

This allows us to relax several things tremendously. It means that dev_queue->qdisc can be accessed purely with RCU locking and then we continue to use that sampled qdisc pointer as long as preemption is disabled (via BH's etc.) or when we have some other reason to know the qdisc isn't going away.

As a result, and the intended main consequence, is that the we are divorced from having to spinlock in order to synchronize with root qdisc changes in the packet processing paths.

2) qdisc_lock_tree() and all of that crap is now gone.

Instead, we lock qdisc roots of the tree we wish to operate on.

Someone anticipated this kind of change, which is why we had these sch_tree_lock and tbf_tree_lock macros already. This allowed these changes to be smaller than they otherwise would have been.

3) We schedule qdiscs, not netdev_queues. So when a TX queue wakes up, we signal it's attached qdisc. The qdisc we sample is used consistently all the way down into qdisc_restart() so all of that "resample the qdisc after grabbing lock" code is no longer necessary.

Initially all TX queues get the simple FIFO qdisc.

But once any qdisc root change operation is performed, we use one shared qdisc amongst the queues until the root qdisc is deleted, at which point we go back to the default.

Note that this new setup means that we can add funky things like have qdiscs, classifiers, meta match, and tc actions that modify the SKB TX queue mapping.

Unless I hear a huge objection, I intend to pull this work into net-next-2.6 tomorrow so I can toss it all to Linus this coming Sunday.