Skip to contentSkip to conversation

Any good documentation on RTNL

DISCUSSION Ben Greear 2 participants 2 messages Dec 12, 2012

Subsystems (2)
lore
Share & tools
lore

Ben Greear

author
#0 lore raw

I'm wondering if anyone could point me to some documentation on the finer points of what the rtnl_lock() does? I can't find anything overly useful in google or the kernel docs.

For instance, can the packet rx-logic run (on other threads?) while rtnl is held?

How about tx-logic?

In particular, I'm interested to know if it is valid to have this state:

thread 1 holds RTNL, and blocks on thread 2 due to trying to flush a work-queue.

thread 2 is processing an item on that work-queue, and the work item is sending packets
(and blocking for up to 200ms timeout trying to flush a wifi driver's queues).

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
#1 lore raw
Quoted 7 lines · Ben Greear

I'm wondering if anyone could point me to some documentation on the finer points of what the rtnl_lock() does? I can't find anything overly useful in google or the kernel docs.

For instance, can the packet rx-logic run (on other threads?) while rtnl is held?

How about tx-logic?

rtnl_lock() is just mutex_lock() on a particular global mutex. Since the RX and TX paths obviously don't take such a mutex, it has no effect on them.

All rtnetlink operations and most net device ioctls are serialised by this mutex (it's the BKL of networking!).

Quoted 7 lines

In particular, I'm interested to know if it is valid to have this state:

thread 1 holds RTNL, and blocks on thread 2 due to trying to flush a work-queue.

thread 2 is processing an item on that work-queue, and the work item is sending packets
(and blocking for up to 200ms timeout trying to flush a wifi driver's queues).

So long as the workqueue is private (if you're flushing it, I suppose it must be) then I don't see any problem with that.

Ben.

Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.