From nobody@FreeBSD.org  Sat Jan 14 21:02:44 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4291C1065677
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 14 Jan 2012 21:02:44 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 132938FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 14 Jan 2012 21:02:44 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q0EL2hdq036279
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 14 Jan 2012 21:02:43 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q0EL2h0R036278;
	Sat, 14 Jan 2012 21:02:43 GMT
	(envelope-from nobody)
Message-Id: <201201142102.q0EL2h0R036278@red.freebsd.org>
Date: Sat, 14 Jan 2012 21:02:43 GMT
From: Eugen Konkov <kes-kes@yandex.ru>
To: freebsd-gnats-submit@FreeBSD.org
Subject: broken netisr initialization
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         164130
>Category:       kern
>Synopsis:       [netisr] broken netisr initialization
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    rwatson
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 14 21:10:15 UTC 2012
>Closed-Date:    
>Last-Modified:  Fri Apr  4 17:30:00 UTC 2014
>Originator:     Eugen Konkov
>Release:        10.0-CURRENT
>Organization:
ISP FreeLine
>Environment:
# uname -a
FreeBSD meta-up 10.0-CURRENT FreeBSD 10.0-CURRENT #8 r230107M: Sat Jan 14 21:02:14 EET 2012     adm@meta-up:/usr/obj/usr/src.svn/head10/sys/KES_KERN_v10  i386

>Description:
netisr has been broken in r230059

and after booting there are conflicting values in sysctl net.isr
>How-To-Repeat:
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

>Fix:
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
                        printf(
                            "%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

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->rwatson 
Responsible-Changed-By: bz 
Responsible-Changed-When: Sat Jan 14 21:26:00 UTC 2012 
Responsible-Changed-Why:  
This is in addition to emails on current@ . I think it's yours. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=164130 

From: Mark Linimon <linimon@lonesome.com>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/164130: [netisr] broken netisr initialization
Date: Tue, 17 Jan 2012 16:32:52 -0600

 ----- Forwarded message from "Robert N. M. Watson" <rwatson@FreeBSD.org> -----
 
 Thanks for your (multiple) e-mails. I will catch up on the remainder of
 the thread tomorrow, having returned from travel today, but wanted to
 point you at "netstat -Q", which will allow you to more directly test
 what dispatch policy is being implemented. It allows you to directly
 inspect counters for directly dispatched vs. deferred packets with each
 netisr thread. Relying on sampled CPU use can be quite misleading, as
 dispatch policies can have counter-intuitive effects on performance and
 CPU use; directly monitoring the cause, rather than the effect, would
 be more reliable for debugging purposes.
 
 Robert
 
 > 
 >  PID USERNAME   PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
 >   11 root       155 ki31     0K    32K RUN     1  25:02 87.16% idle{idle: cpu1}
 >   11 root       155 ki31     0K    32K CPU0    0  25:08 86.72% idle{idle: cpu0}
 >   11 root       155 ki31     0K    32K CPU2    2  24:23 83.50% idle{idle: cpu2}
 >   11 root       155 ki31     0K    32K CPU3    3  24:47 81.93% idle{idle: cpu3}
 >   12 root       -92    -     0K   248K WAIT    3   0:59  6.54% intr{irq266: re0}
 > 3375 root        40    0 15468K  6504K select  2   1:03  4.98% snmpd
 >   12 root       -72    -     0K   248K WAIT    3   0:28  3.12% intr{swi1: netisr 1}
 >   12 root       -60    -     0K   248K WAIT    0   0:34  1.71% intr{swi4: clock}
 >   12 root       -72    -     0K   248K WAIT    3   0:27  1.71% intr{swi1: netisr 3}
 >   12 root       -72    -     0K   248K WAIT    1   0:20  1.37% intr{swi1: netisr 0}
 >    0 root       -92    0     0K   152K -       2   0:30  0.98% kernel{dummynet}
 >   12 root       -72    -     0K   248K WAIT    3   0:13  0.88% intr{swi1: netisr 2}
 >   13 root       -92    -     0K    32K sleep   1   0:11  0.24% ng_queue{ng_queue3}
 >   13 root       -92    -     0K    32K sleep   1   0:11  0.10% ng_queue{ng_queue0}
 >   13 root       -92    -     0K    32K sleep   1   0:11  0.10% ng_queue{ng_queue1}
 > 
 > 
 > 2. There is no cpu load differences between dispatch methods. I have
 > tested two: direct and deferred (see on picture)
 > 
 > http://piccy.info/view3/2482121/cc6464fbe959fd65ecb5a8b94a23ec38/orig/
 > 
 > 'deferred' method works same as 'direct' method!
 > 
 > 
 
 _______________________________________________
 freebsd-bugs@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
 To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org"
 
 
 ----- End forwarded message -----

From: hiren panchasara <hiren@FreeBSD.org>
To: bug-followup@FreeBSD.org, kes-kes@yandex.ru, rwatson@freebsd.org
Cc:  
Subject: Re: kern/164130: [netisr] broken netisr initialization
Date: Fri, 4 Apr 2014 17:26:53 +0000

 I believe the code around reported problem has been reworked and the
 issue no longer exists.
>Unformatted:
