History

netpoll: make ndo_poll_controller() optional

As diagnosed by Song Liu, ndo_poll_controller() can be very dangerous on loaded hosts, since the cpu calling ndo_poll_controller() might steal all NAPI contexts (for all RX/TX queues of the NIC). This capture can last for unlimited amount of time, since one cpu is generally not able to drain all the queues under load. It seems that all networking drivers that do use NAPI for their TX completions, should not provide a ndo_poll_controller(). NAPI drivers have netpoll support already handled in core networking stack, since netpoll_poll_dev() uses poll_napi(dev) to iterate through registered NAPI contexts for a device. This patch allows netpoll_poll_dev() to process NAPI contexts even for drivers not providing ndo_poll_controller(), allowing for following patches in NAPI drivers. Also we export netpoll_poll_dev() so that it can be called by bonding/team drivers in following patches.

Eric Dumazet committed 8 years ago

Commit ac3d9dd1 parent 16fdf8b2 files · +10 −14Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/netpoll.h+3−2
@@ -49,8 +49,9 @@ struct netpoll_info { · 48 unmodified lines
4949 };
5050
5151 #ifdef CONFIG_NETPOLL
52−extern void netpoll_poll_disable(struct net_device *dev);
53−extern void netpoll_poll_enable(struct net_device *dev);
52+void netpoll_poll_dev(struct net_device *dev);
53+void netpoll_poll_disable(struct net_device *dev);
54+void netpoll_poll_enable(struct net_device *dev);
5455 #else
5556 static inline void netpoll_poll_disable(struct net_device *dev) { return; }
5657 static inline void netpoll_poll_enable(struct net_device *dev) { return; }