Re: [PATCH v5] netpoll: protect napi_poll and poll_controller during dev_[open|close]
From: David Miller <davem@davemloft.net>
Date: 2013-02-05 02:06:46
From: David Miller <davem@davemloft.net>
Date: 2013-02-05 02:06:46
From: Neil Horman <nhorman@tuxdriver.com> Date: Mon, 4 Feb 2013 12:40:44 -0500
+ /* + * Block netpoll from trying to do any rx path servicing. + * If we don't do this there is a chance ndo_poll_controller + * or ndo_poll may be running while we open the device + */
Please format comments: /* Like * this. */
+ /* + * Don't do any rx activity if the dev_lock mutex is held + * the dev_open/close paths use this to block netpoll activity + * while changing device state + */
Same here.
+int netpoll_rx_disable(struct net_device *dev)
+{
+ struct netpoll_info *ni;
+ int idx;
+ might_sleep();
+ idx = srcu_read_lock(&netpoll_srcu);
+ ni = srcu_dereference(dev->npinfo, &netpoll_srcu);A lot of interesting indentation going on here.