netdev_set_master question

From: Dan Eble (dane@aiinet.com)
Date: Tue Jan 28 2003 - 16:15:42 EST


Greetings everyone,

I'm pretty new to Linux network programming. I've written a few device
drivers but never looked into the networking core before. Now I am
desiging a multiplexing driver (a bit like the bridge driver, but
upside-down: it will have one slave device and present multiple devices on
the top side). I have a question about the following part of
netdev_set_master() ...

1869 br_write_lock_bh(BR_NETPROTO_LOCK);
1870 slave->master = master;
1871 br_write_unlock_bh(BR_NETPROTO_LOCK);
1872
1873 if (old)
1874 dev_put(old);
1875
1876 if (master)
1877 slave->flags |= IFF_SLAVE;
1878 else
1879 slave->flags &= ~IFF_SLAVE;

Should the write to slave->flags be guarded by the same lock as the
write to slave->master? If no, why not?

Is there documentation somewhere that explains the major locks in the
networking code (RTNL, BR_NETPROTO_LOCK, dev_hold(), what else?), or do
you guys enjoy explaining it to every newbie who wanders in here? ;-)
I've googled but all I get is mountains of patches!

Thanks in advance.

-- 
Dan Eble <dane@aiinet.com>  _____  .
                           |  _  |/|
Applied Innovation Inc.    | |_| | |
http://www.aiinet.com/     |__/|_|_|

- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html



This archive was generated by hypermail 2b29 : Fri Jan 31 2003 - 22:00:02 EST