Date: Wed, 8 Apr 2015 23:55:01 +0300 From: Gleb Smirnoff <glebius@FreeBSD.org> To: "George V. Neville-Neil" <gnn@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r281276 - head/sys/net Message-ID: <20150408205501.GW64665@FreeBSD.org> In-Reply-To: <201504082025.t38KPqU0019878@svn.freebsd.org> References: <201504082025.t38KPqU0019878@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Apr 08, 2015 at 08:25:51PM +0000, George V. Neville-Neil wrote: G> Author: gnn G> Date: Wed Apr 8 20:25:51 2015 G> New Revision: 281276 G> URL: https://svnweb.freebsd.org/changeset/base/281276 G> G> Log: G> Add support for a netisr polling tunable, which allows run time switching of G> device polling rather than having it only be controlled by the compile G> time option. G> G> Summary: Rubicon Communications (Netgate) G> Reviewers: #network, hiren G> Reviewed By: #network, hiren G> Subscribers: hiren G> Differential Revision: https://reviews.freebsd.org/D2258 You gave very short time to review it :( First, the sysctl namespace for device polling is kern.polling. The polling(4) has two additional (to hardclock) modes of polling: netisr polling and idle polling. The idle polling was always contolled by sysctl in kern.polling namespace. Thus, the new sysctl should reside in this namespace. The second important thing is whether sysctl isn't needed at all? What does Rubicon Communications (Netgate) need to achieve? My guess is that they got DEVICE_POLLING in the kernel, but zero interfaces with the IFCAP_POLLING bit set. And they don't want the poll_mtx to be locked routinely. If my guess is true, then the patch should be simple reverted, and in the kern/kern_poll.c, in the netisr_poll() and netisr_pollmore() there should be put: if (poll_handlers == 0) return; And that's all. Note that this is already done for hardclock polling. Accessing this value without poll_mtx held is entirely okay, since we don't care about a race on enabling/disabling polling for NIC. If my guess is wrong, and Rubicon Communications (Netgate) want to run hardclock polling, but have netisr polling disabled, then again the patch should be reverted, and then re-applied to kern_poll.c, moving the netisr_polling variable there and the checks as well, and fixing sysctl namespace. -- Totus tuus, Glebius.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150408205501.GW64665>