misc/164130: broken netisr initialization

Eugen Konkov kes-kes at yandex.ru
Sat Jan 14 21:10:20 UTC 2012

>Number:         164130
>Category:       misc
>Synopsis:       broken netisr initialization
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 14 21:10:15 UTC 2012
>Originator:     Eugen Konkov
>Release:        10.0-CURRENT
ISP FreeLine
# uname -a
FreeBSD meta-up 10.0-CURRENT FreeBSD 10.0-CURRENT #8 r230107M: Sat Jan 14 21:02:14 EET 2012     adm at meta-up:/usr/obj/usr/src.svn/head10/sys/KES_KERN_v10  i386

netisr has been broken in r230059

and after booting there are conflicting values in sysctl net.isr
just run:
#sysctl net.isr
# sysctl net.isr
net.isr.direct: 0
net.isr.direct_force: 0
net.isr.dispatch: direct

for net.isr.dispatch=direct is conflicting with values direct=0 and direct_force=0

you must call netisr_dispatch_policy_compat() in any case dispite on net.isr.dispatch is set or not in /boot/loader.conf

Index: src/sys/net/netisr.c
--- src/sys/net/netisr.c        (revision 230107)
+++ src/sys/net/netisr.c        (working copy)
@@ -1201,13 +1201,14 @@
                        error = EINVAL;
                if (error == 0) {
                        netisr_dispatch_policy = dispatch_policy;
-                       netisr_dispatch_policy_compat();
                } else
                            "%s: invalid dispatch policy %s, using default\n",
                            __func__, tmp);

+       netisr_dispatch_policy_compat();
        netisr_start_swi(curcpu, pcpu_find(curcpu));
 SYSINIT(netisr_init, SI_SUB_SOFTINTR, SI_ORDER_FIRST, netisr_init, NULL);

or send way: you must setup default values for direct and direct_force to 1 because of default dispatcher is 'direct'
Index: src/sys/net/netisr.c
--- src/sys/net/netisr.c        (revision 230107)
+++ src/sys/net/netisr.c        (working copy)
@@ -158,11 +158,11 @@
  * dispatch policy state.  Now, we provide read-only export via them so that
  * older netstat binaries work.  At some point they can be garbage collected.
-static int     netisr_direct_force;
+static int     netisr_direct_force = 1;
 SYSCTL_INT(_net_isr, OID_AUTO, direct_force, CTLFLAG_RD,
     &netisr_direct_force, 0, "compat: force direct dispatch");

-static int     netisr_direct;
+static int     netisr_direct = 1;
 SYSCTL_INT(_net_isr, OID_AUTO, direct, CTLFLAG_RD, &netisr_direct, 0,
     "compat: enable direct dispatch");

But I think first way is more right way

*Sponsored by ISP FreeLine, Eugen Konkov


More information about the freebsd-bugs mailing list