From owner-freebsd-current@FreeBSD.ORG Fri Nov 5 13:37:34 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 24A8116A4CE for ; Fri, 5 Nov 2004 13:37:34 +0000 (GMT) Received: from ns.novakom.com.ua (ns.novakom.com.ua [217.196.173.70]) by mx1.FreeBSD.org (Postfix) with SMTP id 25ADE43D1D for ; Fri, 5 Nov 2004 13:37:31 +0000 (GMT) (envelope-from valera@novakom.dp.ua) Received: (qmail 43726 invoked from network); 5 Nov 2004 13:37:27 -0000 Received: from post.local (HELO novakom.dp.ua) (192.168.1.254) by fpost.local with SMTP; 5 Nov 2004 13:37:27 -0000 Received: (qmail 87330 invoked by uid 98); 5 Nov 2004 13:37:26 -0000 Received: from valera@novakom.dp.ua by post.novakom.dp.ua by uid 82 with qmail-scanner-1.20 ( Clear:RC:1(192.168.1.210):. Processed in 0.131143 secs); 05 Nov 2004 13:37:26 -0000 X-Qmail-Scanner-Mail-From: valera@novakom.dp.ua via post.novakom.dp.ua X-Qmail-Scanner: 1.20 (Clear:RC:1(192.168.1.210):. Processed in 0.131143 secs) Received: from goliath.novakom.dp.ua (HELO ?192.168.1.210?) (192.168.1.210) by post.novakom.dp.ua with SMTP; 5 Nov 2004 13:37:26 -0000 Message-ID: <418BD598.8090806@novakom.dp.ua> Date: Fri, 05 Nov 2004 21:33:44 +0200 From: "Valery V.Chikalov" User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.7.1) Gecko/20040806 X-Accept-Language: ru-ru, ru, en-us, en MIME-Version: 1.0 To: current@freebsd.org, peadar.edwards@gmail.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Fri, 05 Nov 2004 14:10:46 +0000 Subject: Re: if_sk patch to get more info from people with problems X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Nov 2004 13:37:34 -0000 >In article <34cb7c8404110209563fc01498@mail.gmail.com> you write: > >>Ok, I don't have this hardware, but dumb question: >> >>A (very) quick look at the source reveals that buffers are allocated >>via sk_rxeof()->sk_newbuf()->sk_jalloc() in the interrupt receive >>function, with the softc lock held in sk_rxeof(). >> >>They're freed by the mbuf system via a call to sk_jfree(), but that >>doesn't hold the SK_LOCK. Is this possibly the source of the >>corruption problems? What am I missing? >>This compiles, anyway :-) >> >>--- /tmp/if_sk.c Tue Nov 2 17:49:26 2004 >>+++ if_sk.c Tue Nov 2 17:52:20 2004 >>@@ -1115,12 +1115,14 @@ >> if ((i < 0) || (i >= SK_JSLOTS)) >> panic("sk_jfree: asked to free buffer that we don't manage!"); >> >>+ SK_LOCK(sc_if->sk_softc); >> entry = SLIST_FIRST(&sc_if->sk_jinuse_listhead); >> if (entry == NULL) >> panic("sk_jfree: buffer not in use!"); >> entry->slot = i; >> SLIST_REMOVE_HEAD(&sc_if->sk_jinuse_listhead, jpool_entries); >> SLIST_INSERT_HEAD(&sc_if->sk_jfree_listhead, entry, jpool_entries); >>+ SK_UNLOCK(sc_if->sk_softc); >> >> return; >> } > >Thank you very much! This patch seems to fix the network corruption >problems I have reported in kern/73038. I'll do some more testing, >because sometimes the problems only appear after some time. But for now, >I can use if_sk.c without debug.mpsafenet="0" on 5.3-RC2. > >Arjan Yes, it works for me too. After aplying this patch the problem was solved for me. I meen after the patch ftp 2GB file throw sk interface with debug.mpsafenet="1" took place at 11.03MB/s in contrast to 60KB/s before. Great thanks! #uname -rm 5.3-STABLE i386 HyperThreading (3GHz) system whith UP kernel. $ dmesg | grep sk skc0: port 0xa400-0xa4ff mem 0xfb100000-0xfb103fff irq 20 at device 9.0 on pci2 skc0: Yukon Gigabit Ethernet 10/100/1000Base-T Adapter sk0: on skc0 sk0: Ethernet address: 00:0d:61:9a:59:e1 miibus1: on sk0 Valera.