On Fri, 9 Apr 2010, Jack F Vogel wrote:

Author: jfv
Date: Fri Apr  9 18:42:15 2010
New Revision: 206429
URL: http://svn.freebsd.org/changeset/base/206429

Log:
 Incorporate suggested improvements from yongari.

 Also, from feedback, make the multiqueue code an
 option (EM_MULTIQUEUE) that is off by default.
 Problems have been seen with UDP when its on.

Modified:
 head/sys/dev/e1000/if_em.c
 head/sys/dev/e1000/if_em.h

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c  Fri Apr  9 18:02:19 2010        (r206428)
+++ head/sys/dev/e1000/if_em.c  Fri Apr  9 18:42:15 2010        (r206429)
..
@@ -1427,28 +1443,23 @@ em_handle_que(void *context, int pending
        struct ifnet    *ifp = adapter->ifp;
        struct tx_ring  *txr = adapter->tx_rings;
        struct rx_ring  *rxr = adapter->rx_rings;
-       u32             loop = EM_MAX_LOOP;
-       bool            more_rx, more_tx;
+       bool            more_rx;


        if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+               more_rx = em_rxeof(rxr, adapter->rx_process_limit);
                EM_TX_LOCK(txr);
-               do {
-                       more_rx = em_rxeof(rxr, adapter->rx_process_limit);

Booting with NFS root I got a panic:

 208089 Trying to mount root from nfs:
..
 208107 panic: mutex em0:rx(0) not owned at 
/zoo/bz/HEAD_clean.svn/sys/dev/e1000/if_em.c:4093
..
 208138 db> where
 208139 Tracing pid 0 tid 100050 td 0xffffff0001c43ab0
 208140 kdb_enter() at kdb_enter+0x3d
 208141 panic() at panic+0x1cc
 208142 _mtx_assert() at _mtx_assert+0x7d
 208143 em_rxeof() at em_rxeof+0x3b
 208144 em_handle_que() at em_handle_que+0x4a
 208145 taskqueue_run() at taskqueue_run+0xeb
 208146 taskqueue_thread_loop() at taskqueue_thread_loop+0x50
 208147 fork_exit() at fork_exit+0x14a
 208148 fork_trampoline() at fork_trampoline+0xe
 208149 --- trap 0, rip = 0, rsp = 0xffffff80001c9d30, rbp = 0 ---


Not sure if this would be the correct fix locking wise but it might;
at least this is where em_rxeof() get's called w/o the locking and
triggers the assert.


Index: sys/dev/e1000/if_em.c
===================================================================
--- sys/dev/e1000/if_em.c       (revision 206455)
+++ sys/dev/e1000/if_em.c       (working copy)
@@ -1447,7 +1447,9 @@ em_handle_que(void *context, int pending)


        if (ifp->if_drv_flags & IFF_DRV_RUNNING) {
+               EM_RX_LOCK(rxr);
                more_rx = em_rxeof(rxr, adapter->rx_process_limit);
+               EM_RX_UNLOCK(rxr);
                EM_TX_LOCK(txr);
                em_txeof(txr);
 #ifdef EM_MULTIQUEUE


--
Bjoern A. Zeeb         It will not break if you know what you are doing.
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to