net: sched: calls synchronize_net() only when needed
authorEric Dumazet <edumazet@google.com>
Thu, 9 Jan 2025 17:18:50 +0000 (17:18 +0000)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 14 Jan 2025 09:17:53 +0000 (10:17 +0100)
commit88df16f851ad8473ae89aba36d07e76b11c798ca
treeb0cd7903874bdd65fe95e4b6dcae2a5a0ed1299a
parenta833fb852e96c778bff1d14866f1db2c346b3d2e
net: sched: calls synchronize_net() only when needed

dev_deactivate_many() role is to remove the qdiscs
of a network device.

When/if a qdisc is dismantled, an rcu grace period
is needed to make sure all outstanding qdisc enqueue
are done before we proceed with a qdisc reset.

Most virtual devices do not have a qdisc.

We can call the expensive synchronize_net() only
if needed.

Note that dev_deactivate_many() does not have to deal
with qdisc-less dev_queue_xmit, as an old comment
was claiming.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250109171850.2871194-1-edumazet@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
net/sched/sch_generic.c