From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 05:36:16 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9916C1065670; Sun, 24 Oct 2010 05:36:16 +0000 (UTC) (envelope-from max@laiers.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.freebsd.org (Postfix) with ESMTP id EB4438FC18; Sun, 24 Oct 2010 05:36:15 +0000 (UTC) Received: from [192.168.8.55] (75-147-189-33-Washington.hfc.comcastbusiness.net [75.147.189.33]) by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis) id 0M6yZd-1OO7gm25WH-00xOIZ; Sun, 24 Oct 2010 07:36:14 +0200 Message-ID: <4CC3C5C9.7040904@laiers.net> Date: Sat, 23 Oct 2010 22:36:09 -0700 From: Max Laier User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Ermal_Lu=E7i?= References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:3GO4GtN/62TDwzY0Xbay35RMxVi/XIbn17GVxkMK23d SizeeVdR86CrcnodTxv39S3PdzjCJ7ibEB+9kcnd86ovCD/x8J nACOGUmbeoGcvuS+93QcUvPlgimDw9pyGmbdRbS2l4kj13CXSg NIvtkkIL/u3g/Ru/VHbcW1xXn3uSWSQkJWYaMDOJX0YxbAgLH4 d0Ng7Uf0tjPOLSsWyyZ/g== Cc: freebsd-net , freebsd-pf@freebsd.org Subject: Re: [PATCH] pf(4) patch from OpenBSD 4.5 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 05:36:16 -0000 C'mon ... where are the testers at? On 18.10.2010 11:10, Ermal Luçi wrote: > Feedback is very welcome. Is there no-one testing Ermal's exciting patch? Let's help getting this tested ... before we put it into SVN! fetch http://people.freebsd.org/~eri/pf45_1.diff patch -p1 < pf45_1.diff make buildworld buildkernel etc. ... Let's go!!! And do not forget to reply if it works just, too. Thank you, Max From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 07:11:32 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D532C106566C for ; Sun, 24 Oct 2010 07:11:32 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms16-1.1blu.de (ms16-1.1blu.de [89.202.0.34]) by mx1.freebsd.org (Postfix) with ESMTP id 6C3F78FC15 for ; Sun, 24 Oct 2010 07:11:32 +0000 (UTC) Received: from [93.104.125.203] (helo=current.Sisis.de) by ms16-1.1blu.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1P9t5h-0006F5-KG; Sun, 24 Oct 2010 07:25:57 +0200 Received: from current.Sisis.de (current [127.0.0.1]) by current.Sisis.de (8.14.3/8.14.3) with ESMTP id o9O5Q557002026; Sun, 24 Oct 2010 07:26:05 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by current.Sisis.de (8.14.3/8.14.3/Submit) id o9O5Q4II002025; Sun, 24 Oct 2010 07:26:04 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: current.Sisis.de: guru set sender to guru@unixarea.de using -f Date: Sun, 24 Oct 2010 07:25:59 +0200 From: Matthias Apitz To: freebsd-net@freebsd.org Message-ID: <20101024052559.GA1971@current.Sisis.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: FreeBSD 8.0-CURRENT (i386) User-Agent: Mutt/1.5.19 (2009-01-05) X-Con-Id: 51246 X-Originating-IP: 93.104.125.203 Cc: freebsd-hackers@freebsd.org Subject: Broadcom BCM4310 / bwi(4) and interface bwi0 is not showing up X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 07:11:33 -0000 Hello, I have a new laptop Acer Aspire One D250 and I want to install a 8-CURRENT as of CVS from May 2009 (as I use this on all my laptops). The laptop comes with as Wifi chip: none2@pci0:1:0:0: class=0x028000 card=0xe01b105b chip=0x431514e4 rev=0x01 hdr=0x00 vendor = 'Broadcom Corporation' device = 'BCM4310 USB Controller' class = network I learned after searching around that it should be supported by bwi(4) and one should install the firmware kmod from the ports. I have in loader.conf: if_bwi_load="YES" bwi_v3_ucode_load="YES" and a kldstat shows that both are loaded. But the bwi0 interface is not showing up. If I do a kldunload/kldload it says: pci0: driver added found-> vendor=0x8086, dev=0x27d8, revid=0x02 domain=0, bus=0, slot=27, func=0 class=04-03-00, hdrtype=0x00, mfdev=0 cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=16 powerspec 2 supports D0 D3 current D0 MSI supports 1 message, 64 bit pci0:0:27:0: reprobing on driver added found-> vendor=0x8086, dev=0x27da, revid=0x02 domain=0, bus=0, slot=31, func=3 class=0c-05-00, hdrtype=0x00, mfdev=0 cmdreg=0x0001, statreg=0x0280, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=b, irq=17 pci0:0:31:3: reprobing on driver added pci1: driver added found-> vendor=0x14e4, dev=0x4315, revid=0x01 domain=0, bus=1, slot=0, func=0 class=02-80-00, hdrtype=0x00, mfdev=0 cmdreg=0x0006, statreg=0x0010, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=16 powerspec 3 supports D0 D1 D2 D3 current D0 MSI supports 1 message, 64 bit pci0:1:0:0: reprobing on driver added pci2: driver added pci3: driver added found-> vendor=0x1969, dev=0x1062, revid=0xc0 domain=0, bus=3, slot=0, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0010, cachelnsz=0 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=18 powerspec 3 supports D0 D3 current D0 MSI supports 1 message, 64 bit pci0:3:0:0: reprobing on driver added pci4: driver added pci5: driver added and a 'dmesg | fgrep bwi' shows: Preloaded elf module "/boot/kernel/if_bwi.ko" at 0xc10ed228. Preloaded elf module "/boot/modules/bwi_v3_ucode.ko" at 0xc10ed2d4. firmware: 'bwi_v3_ucode' version 0: 0 bytes loaded at 0xc10d33d4 firmware: 'bwi_v3_ucode11' version 0: 21680 bytes loaded at 0xc10d33d4 firmware: 'bwi_v3_ucode2' version 0: 16360 bytes loaded at 0xc10d8884 firmware: 'bwi_v3_ucode4' version 0: 20096 bytes loaded at 0xc10dc86c firmware: 'bwi_v3_ucode5' version 0: 22280 bytes loaded at 0xc10e16ec firmware: 'bwi_v3_a0g0bsinitvals2' version 0: 18 bytes loaded at 0xc10e6df4 firmware: 'bwi_v3_a0g0bsinitvals5' version 0: 158 bytes loaded at 0xc10e6e06 firmware: 'bwi_v3_a0g0initvals2' version 0: 2520 bytes loaded at 0xc10e6ea4 firmware: 'bwi_v3_a0g0initvals5' version 0: 1818 bytes loaded at 0xc10e787c firmware: 'bwi_v3_a0g1bsinitvals5' version 0: 158 bytes loaded at 0xc10e7f96 firmware: 'bwi_v3_a0g1initvals5' version 0: 1818 bytes loaded at 0xc10e8034 firmware: 'bwi_v3_b0g0bsinitvals2' version 0: 18 bytes loaded at 0xc10e874e firmware: 'bwi_v3_b0g0bsinitvals5' version 0: 158 bytes loaded at 0xc10e8760 firmware: 'bwi_v3_b0g0initvals2' version 0: 2520 bytes loaded at 0xc10e87fe firmware: 'bwi_v3_b0g0initvals5' version 0: 1818 bytes loaded at 0xc10e91d6 firmware: 'bwi_v3_pcm4' version 0: 1320 bytes loaded at 0xc10e98f0 firmware: 'bwi_v3_pcm5' version 0: 1320 bytes loaded at 0xc10e9e18 What I am missing here? Thanks matthias -- Matthias Apitz t +49-89-61308 351 - f +49-89-61308 399 - m +49-170-4527211 e - w http://www.unixarea.de/ From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 08:48:14 2010 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D596F106566B for ; Sun, 24 Oct 2010 08:48:14 +0000 (UTC) (envelope-from julian@freebsd.org) Received: from out-0.mx.aerioconnect.net (outy.internet-mail-service.net [216.240.47.248]) by mx1.freebsd.org (Postfix) with ESMTP id B82DC8FC13 for ; Sun, 24 Oct 2010 08:48:14 +0000 (UTC) Received: from idiom.com (postfix@mx0.idiom.com [216.240.32.160]) by out-0.mx.aerioconnect.net (8.13.8/8.13.8) with ESMTP id o9O8mDnR026236; Sun, 24 Oct 2010 01:48:13 -0700 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by idiom.com (Postfix) with ESMTP id 8FC2D2D6019; Sun, 24 Oct 2010 01:48:12 -0700 (PDT) Message-ID: <4CC3F307.70909@freebsd.org> Date: Sun, 24 Oct 2010 01:49:11 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 MIME-Version: 1.0 To: Max Laier , FreeBSD Net References: <4CC3C5C9.7040904@laiers.net> In-Reply-To: <4CC3C5C9.7040904@laiers.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.67 on 216.240.47.51 Cc: Subject: Re: [PATCH] pf(4) patch from OpenBSD 4.5 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 08:48:14 -0000 On 10/23/10 10:36 PM, Max Laier wrote: > C'mon ... where are the testers at? > > On 18.10.2010 11:10, Ermal Luçi wrote: >> Feedback is very welcome. > > Is there no-one testing Ermal's exciting patch? Let's help getting > this tested ... before we put it into SVN! I vote for just putting it in SVN if it works for you and THEN there will be testers! > > fetch http://people.freebsd.org/~eri/pf45_1.diff > patch -p1 < pf45_1.diff > make buildworld buildkernel > etc. ... > > Let's go!!! And do not forget to reply if it works just, too. > > Thank you, > Max > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 09:36:42 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EC401065673; Sun, 24 Oct 2010 09:36:42 +0000 (UTC) (envelope-from Greg.Hennessy@nviz.net) Received: from mail2.jellyfishnet.co.uk (mail2.jellyfishnet.co.uk [93.91.20.10]) by mx1.freebsd.org (Postfix) with ESMTP id DF29B8FC1D; Sun, 24 Oct 2010 09:36:41 +0000 (UTC) Received: from pemexhub02.jellyfishnet.co.uk.local (93.91.20.3) by mail2.jellyfishnet.co.uk (93.91.20.10) with Microsoft SMTP Server (TLS) id 8.1.393.1; Sun, 24 Oct 2010 10:25:56 +0100 Received: from PEMEXMBXVS02.jellyfishnet.co.uk.local ([192.168.65.37]) by pemexhub02.jellyfishnet.co.uk.local ([192.168.65.8]) with mapi; Sun, 24 Oct 2010 10:25:48 +0100 From: Greg Hennessy To: Max Laier , =?iso-8859-1?Q?Ermal_Lu=E7i?= Date: Sun, 24 Oct 2010 10:25:47 +0100 Thread-Topic: [PATCH] pf(4) patch from OpenBSD 4.5 Thread-Index: ActzPX7DFNIAiNKjQ0aow52Pve4xMAAH8KSg Message-ID: <9E8D76EC267C9444AC737F649CBBAD90276A7E594E@PEMEXMBXVS02.jellyfishnet.co.uk.local> References: <4CC3C5C9.7040904@laiers.net> In-Reply-To: <4CC3C5C9.7040904@laiers.net> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-GB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: freebsd-net , "freebsd-pf@freebsd.org" Subject: RE: [PATCH] pf(4) patch from OpenBSD 4.5 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 09:36:42 -0000 It doesn't appear to patch cleanly against CURRENT gw2:/usr/src # find . -name \*.rej ./contrib/pf/pfctl/pfctl_table.c.rej ./contrib/pf/pfctl/parse.y.rej ./contrib/pf/pfctl/pfctl.c.rej ./contrib/pf/pfctl/pfctl_parser.h.rej ./contrib/pf/pfctl/pfctl.8.rej ./contrib/pf/pfctl/pfctl.h.rej ./sys/contrib/pf/net/pf_norm.c.rej ./sys/contrib/pf/net/if_pflog.c.rej ./sys/contrib/pf/net/pf_osfp.c.rej Can post/email the contents of the above if required.=20 Greg > -----Original Message----- > From: owner-freebsd-pf@freebsd.org [mailto:owner-freebsd- > pf@freebsd.org] On Behalf Of Max Laier > Sent: 24 October 2010 6:36 AM > To: Ermal Lu=E7i > Cc: freebsd-net; freebsd-pf@freebsd.org > Subject: Re: [PATCH] pf(4) patch from OpenBSD 4.5 >=20 > C'mon ... where are the testers at? >=20 > On 18.10.2010 11:10, Ermal Lu=E7i wrote: > > Feedback is very welcome. >=20 > Is there no-one testing Ermal's exciting patch? Let's help getting this > tested ... before we put it into SVN! >=20 > fetch http://people.freebsd.org/~eri/pf45_1.diff > patch -p1 < pf45_1.diff > make buildworld buildkernel > etc. ... >=20 > Let's go!!! And do not forget to reply if it works just, too. >=20 > Thank you, > Max > _______________________________________________ > freebsd-pf@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-pf > To unsubscribe, send any mail to "freebsd-pf-unsubscribe@freebsd.org" From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 09:55:46 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C3C8E106564A; Sun, 24 Oct 2010 09:55:46 +0000 (UTC) (envelope-from freebsd-listen@fabiankeil.de) Received: from smtprelay03.ispgateway.de (smtprelay03.ispgateway.de [80.67.18.15]) by mx1.freebsd.org (Postfix) with ESMTP id 4F85F8FC12; Sun, 24 Oct 2010 09:55:46 +0000 (UTC) Received: from [78.34.145.129] (helo=r500.local) by smtprelay03.ispgateway.de with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.68) (envelope-from ) id 1P9x3J-00069h-GI; Sun, 24 Oct 2010 11:39:48 +0200 Date: Sun, 24 Oct 2010 11:39:43 +0200 From: Fabian Keil To: Max Laier Message-ID: <20101024113943.3cc0d659@r500.local> In-Reply-To: <4CC3C5C9.7040904@laiers.net> References: <4CC3C5C9.7040904@laiers.net> X-Mailer: Claws Mail 3.7.6 (GTK+ 2.20.1; amd64-portbld-freebsd9.0) X-PGP-KEY-URL: http://www.fabiankeil.de/gpg-keys/freebsd-listen-2008-08-18.asc Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/svSC+F=4tHHhCo+JTSVJg5H"; protocol="application/pgp-signature" X-Df-Sender: 775067 Cc: Ermal =?ISO-8859-1?Q?Lu=E7i?= , freebsd-net , freebsd-pf@freebsd.org Subject: Re: [PATCH] pf(4) patch from OpenBSD 4.5 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 09:55:46 -0000 --Sig_/svSC+F=4tHHhCo+JTSVJg5H Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Max Laier wrote: > C'mon ... where are the testers at? >=20 > On 18.10.2010 11:10, Ermal Lu=E7i wrote: > > Feedback is very welcome. >=20 > Is there no-one testing Ermal's exciting patch? Let's help getting this= =20 > tested ... before we put it into SVN! >=20 > fetch http://people.freebsd.org/~eri/pf45_1.diff > patch -p1 < pf45_1.diff I think that should be -p0. > make buildworld buildkernel > etc. ... >=20 > Let's go!!! And do not forget to reply if it works just, too. I got a bunch of rejections: fk@r500 /usr/src $patch -C -p0 < /home/fk/test/freebsd/pf45_1.diff 2>&1 | g= rep .rej 1 out of 6 hunks failed--saving rejects to contrib/pf/pfctl/pfctl_table.c.r= ej 1 out of 114 hunks failed--saving rejects to contrib/pf/pfctl/parse.y.rej 1 out of 37 hunks failed--saving rejects to contrib/pf/pfctl/pfctl.c.rej 1 out of 4 hunks failed--saving rejects to contrib/pf/pfctl/pfctl_parser.h.= rej 1 out of 15 hunks failed--saving rejects to contrib/pf/pfctl/pfctl.8.rej 1 out of 6 hunks failed--saving rejects to contrib/pf/pfctl/pfctl.h.rej 1 out of 56 hunks failed--saving rejects to sys/contrib/pf/net/pf_norm.c.rej 1 out of 16 hunks failed--saving rejects to sys/contrib/pf/net/if_pflog.c.r= ej 1 out of 15 hunks failed--saving rejects to sys/contrib/pf/net/pf_osfp.c.rej They can be fixed by running the files through perl -i'' -pe 's@\$FreeBSD[^\$]+\$@\$FreeBSD\$@' * before applying the patch. Afterwards the patch applies cleanly. However the build still fails for me: /usr/obj/usr/src/make.amd64/make -V CFILES -V SYSTEM_CFILES -V GEN_CFILES |= MKDEP_CPP=3D"cc -E" CC=3D"cc" xargs mkdep -a -f .newdep -O2 -frename-regi= sters -pipe -fno-strict-aliasing -std=3Dc99 -g -Wall -Wredundant-decls -Wn= ested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wi= nline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -nostdinc = -I. -I/usr/src/sys -I/usr/src/sys/contrib/altq -I/usr/src/sys/contrib/ipfi= lter -I/usr/src/sys/contrib/pf -I/usr/src/sys/dev/ath -I/usr/src/sys/dev/at= h/ath_hal -I/usr/src/sys/contrib/ngatm -I/usr/src/sys/dev/twa -I/usr/src/sy= s/gnu/fs/xfs/FreeBSD -I/usr/src/sys/gnu/fs/xfs/FreeBSD/support -I/usr/src/s= ys/gnu/fs/xfs -I/usr/src/sys/contrib/opensolaris/compat -I/usr/src/sys/dev/= cxgb -D_KERNEL -DHAVE_KERNEL_OPTION_HEADERS -include opt_global.h -fno-comm= on -finline-limit=3D8000 --param inline-unit-growth=3D100 --param large-fun= ction-growth=3D1000 -fno-omit-frame-pointer -mcmodel=3Dkernel -mno-red-zon= e -mfpmath=3D387 -mno-sse -mno-sse2 -mno-sse3 -mno-mmx -mno-3dnow -msoft-= float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector /usr/src/sys/contrib/pf/net/pf.c:149:26: error: net/if_pflow.h: No such fil= e or directory mkdep: compile failed *** Error code 1 Stop in /usr/obj/usr/src/sys/ZOEY. *** Error code 1 Stop in /usr/src. *** Error code 1 Stop in /usr/src. I'm using HEAD from yesterday and if_pflow.h indeed doesn't seem to exist. Fabian --Sig_/svSC+F=4tHHhCo+JTSVJg5H Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (FreeBSD) iEYEARECAAYFAkzD/uQACgkQBYqIVf93VJ3jLQCgqUP61qe9WF0zBD2XbiCbnF76 +zAAn1zPE43YCnXL1+M9tTp5fcyyoCw0 =jEYJ -----END PGP SIGNATURE----- --Sig_/svSC+F=4tHHhCo+JTSVJg5H-- From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 09:58:36 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 43715106564A; Sun, 24 Oct 2010 09:58:36 +0000 (UTC) (envelope-from Greg.Hennessy@nviz.net) Received: from mail1.jellyfishnet.co.uk (mail1.jellyfishnet.co.uk [93.91.20.9]) by mx1.freebsd.org (Postfix) with ESMTP id CF1038FC14; Sun, 24 Oct 2010 09:58:35 +0000 (UTC) Received: from pemexhub01.jellyfishnet.co.uk.local (93.91.20.3) by mail1.jellyfishnet.co.uk (93.91.20.9) with Microsoft SMTP Server (TLS) id 8.1.393.1; Sun, 24 Oct 2010 10:58:40 +0100 Received: from PEMEXMBXVS02.jellyfishnet.co.uk.local ([192.168.65.37]) by pemexhub01.jellyfishnet.co.uk.local ([192.168.65.7]) with mapi; Sun, 24 Oct 2010 10:58:34 +0100 From: Greg Hennessy To: Greg Hennessy , Max Laier , =?iso-8859-1?Q?Ermal_Lu=E7i?= Date: Sun, 24 Oct 2010 10:58:33 +0100 Thread-Topic: [PATCH] pf(4) patch from OpenBSD 4.5 Thread-Index: ActzPX7DFNIAiNKjQ0aow52Pve4xMAAH8KSgAAEsUgA= Message-ID: <9E8D76EC267C9444AC737F649CBBAD90276A7E5955@PEMEXMBXVS02.jellyfishnet.co.uk.local> References: <4CC3C5C9.7040904@laiers.net> <9E8D76EC267C9444AC737F649CBBAD90276A7E594E@PEMEXMBXVS02.jellyfishnet.co.uk.local> In-Reply-To: <9E8D76EC267C9444AC737F649CBBAD90276A7E594E@PEMEXMBXVS02.jellyfishnet.co.uk.local> Accept-Language: en-US, en-GB Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US, en-GB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Cc: freebsd-net , "freebsd-pf@freebsd.org" Subject: RE: [PATCH] pf(4) patch from OpenBSD 4.5 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 09:58:36 -0000 s/CURRENT/HEAD/ below, wasn't quite awake yet when I sent it. :-) > -----Original Message----- > From: owner-freebsd-pf@freebsd.org [mailto:owner-freebsd- > pf@freebsd.org] On Behalf Of Greg Hennessy > Sent: 24 October 2010 10:26 AM > To: Max Laier; Ermal Lu=E7i > Cc: freebsd-net; freebsd-pf@freebsd.org > Subject: RE: [PATCH] pf(4) patch from OpenBSD 4.5 >=20 > It doesn't appear to patch cleanly against CURRENT >=20 > gw2:/usr/src # find . -name \*.rej > ./contrib/pf/pfctl/pfctl_table.c.rej > ./contrib/pf/pfctl/parse.y.rej > ./contrib/pf/pfctl/pfctl.c.rej > ./contrib/pf/pfctl/pfctl_parser.h.rej > ./contrib/pf/pfctl/pfctl.8.rej > ./contrib/pf/pfctl/pfctl.h.rej > ./sys/contrib/pf/net/pf_norm.c.rej > ./sys/contrib/pf/net/if_pflog.c.rej > ./sys/contrib/pf/net/pf_osfp.c.rej >=20 >=20 > Can post/email the contents of the above if required. >=20 >=20 > Greg >=20 >=20 > > -----Original Message----- > > From: owner-freebsd-pf@freebsd.org [mailto:owner-freebsd- > > pf@freebsd.org] On Behalf Of Max Laier > > Sent: 24 October 2010 6:36 AM > > To: Ermal Lu=E7i > > Cc: freebsd-net; freebsd-pf@freebsd.org > > Subject: Re: [PATCH] pf(4) patch from OpenBSD 4.5 > > > > C'mon ... where are the testers at? > > > > On 18.10.2010 11:10, Ermal Lu=E7i wrote: > > > Feedback is very welcome. > > > > Is there no-one testing Ermal's exciting patch? Let's help getting thi= s > > tested ... before we put it into SVN! > > > > fetch http://people.freebsd.org/~eri/pf45_1.diff > > patch -p1 < pf45_1.diff > > make buildworld buildkernel > > etc. ... > > > > Let's go!!! And do not forget to reply if it works just, too. > > > > Thank you, > > Max > > _______________________________________________ > > freebsd-pf@freebsd.org mailing list > > http://lists.freebsd.org/mailman/listinfo/freebsd-pf > > To unsubscribe, send any mail to "freebsd-pf-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-pf@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-pf > To unsubscribe, send any mail to "freebsd-pf-unsubscribe@freebsd.org" From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 11:19:19 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CBDE31065670; Sun, 24 Oct 2010 11:19:19 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A14CC8FC0A; Sun, 24 Oct 2010 11:19:19 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9OBJJQl073869; Sun, 24 Oct 2010 11:19:19 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9OBJJo5073865; Sun, 24 Oct 2010 11:19:19 GMT (envelope-from linimon) Date: Sun, 24 Oct 2010 11:19:19 GMT Message-Id: <201010241119.o9OBJJo5073865@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-net@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/151681: [nfs] NFS mount via IPv6 leads to hang on client with "ipfw: pullup failed" X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 11:19:19 -0000 Old Synopsis: NFS mount via IPv6 leads to hang on client with "ipfw: pullup failed" New Synopsis: [nfs] NFS mount via IPv6 leads to hang on client with "ipfw: pullup failed" Responsible-Changed-From-To: freebsd-bugs->freebsd-net Responsible-Changed-By: linimon Responsible-Changed-When: Sun Oct 24 11:18:57 UTC 2010 Responsible-Changed-Why: Sounds like something in the networking layer. http://www.freebsd.org/cgi/query-pr.cgi?pr=151681 From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 14:53:04 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B6511065670; Sun, 24 Oct 2010 14:53:04 +0000 (UTC) (envelope-from dimitar.vassilev@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id C573B8FC0C; Sun, 24 Oct 2010 14:53:03 +0000 (UTC) Received: by iwn39 with SMTP id 39so3115453iwn.13 for ; Sun, 24 Oct 2010 07:53:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=2T7r4HUfZEkB0Co3wuC81Ot28w+73yQJ4GjoctB0zhA=; b=ChE6x6OJO73mYh7A+ImXruIUmOrWZPirX/NU2NfjU1Yw2yn1VwwqFRz0lbqScX0Qi1 swfx35/iE9KSfECXn/FsNHkuMWlmiFTrqXZe+RM2YNeKimI4O6w+eWvf8QcT+WE5KMLV SDIsJAZyoKyWcPsnOLMkINcR6fmcZ7JSu2Ib4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=LYHk4SJLW6hoJ2VvYdi1LlAA4wyglGsySz+L4PrCBa+4L4cRhkXzoXJciPjn6pUCWT KftUl4s3WU8P6qsDYSqX74MAaF5JHbd9+5J8llkO9CZiTtPUsfy7J22FK0E7uHYzbfJK FicFcUixe0++tSShJjnLlqziORLC/TvpD1xPg= MIME-Version: 1.0 Received: by 10.231.34.6 with SMTP id j6mr4665769ibd.93.1287930470444; Sun, 24 Oct 2010 07:27:50 -0700 (PDT) Received: by 10.229.181.84 with HTTP; Sun, 24 Oct 2010 07:27:50 -0700 (PDT) In-Reply-To: <9E8D76EC267C9444AC737F649CBBAD90276A7E5955@PEMEXMBXVS02.jellyfishnet.co.uk.local> References: <4CC3C5C9.7040904@laiers.net> <9E8D76EC267C9444AC737F649CBBAD90276A7E594E@PEMEXMBXVS02.jellyfishnet.co.uk.local> <9E8D76EC267C9444AC737F649CBBAD90276A7E5955@PEMEXMBXVS02.jellyfishnet.co.uk.local> Date: Sun, 24 Oct 2010 17:27:50 +0300 Message-ID: From: Dimitar Vassilev To: Greg Hennessy Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: =?UTF-8?Q?Ermal_Lu=C3=A7i?= , freebsd-net , Max Laier , "freebsd-pf@freebsd.org" Subject: Re: [PATCH] pf(4) patch from OpenBSD 4.5 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 14:53:04 -0000 2010/10/24 Greg Hennessy : > s/CURRENT/HEAD/ below, =C2=A0wasn't quite awake yet when I sent it. :-) Out of curiousity, any plans to include pf 4.7 support in the next 1-2 year= s? I'm not actively looking the freebsd-net list, so my apologies if this has been already spoken of. Best regards, Dimitar From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 18:20:18 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEF63106564A; Sun, 24 Oct 2010 18:20:18 +0000 (UTC) (envelope-from remko@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B4F6E8FC15; Sun, 24 Oct 2010 18:20:18 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9OIKI20011192; Sun, 24 Oct 2010 18:20:18 GMT (envelope-from remko@freefall.freebsd.org) Received: (from remko@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9OIKIT9011183; Sun, 24 Oct 2010 18:20:18 GMT (envelope-from remko) Date: Sun, 24 Oct 2010 18:20:18 GMT Message-Id: <201010241820.o9OIKIT9011183@freefall.freebsd.org> To: remko@FreeBSD.org, freebsd-www@FreeBSD.org, freebsd-net@FreeBSD.org From: remko@FreeBSD.org Cc: Subject: Re: kern/151690: network connectivity won't work until dhclient is run manually X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 18:20:19 -0000 Synopsis: network connectivity won't work until dhclient is run manually Responsible-Changed-From-To: freebsd-www->freebsd-net Responsible-Changed-By: remko Responsible-Changed-When: Sun Oct 24 18:20:01 UTC 2010 Responsible-Changed-Why: Reassign to network team http://www.freebsd.org/cgi/query-pr.cgi?pr=151690 From owner-freebsd-net@FreeBSD.ORG Sun Oct 24 18:50:26 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B56C2106564A; Sun, 24 Oct 2010 18:50:26 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 8DE7C8FC0C; Sun, 24 Oct 2010 18:50:26 +0000 (UTC) Received: from fledge.watson.org (fledge.watson.org [65.122.17.41]) by cyrus.watson.org (Postfix) with ESMTPS id 2F02F46B99; Sun, 24 Oct 2010 14:50:26 -0400 (EDT) Date: Sun, 24 Oct 2010 19:50:26 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Lawrence Stewart In-Reply-To: <4CC2254C.7070104@freebsd.org> Message-ID: References: <4CA5D1F0.3000307@freebsd.org> <4CA9B6AC.20403@freebsd.org> <4CBB6CE9.1030009@freebsd.org> <4CC2254C.7070104@freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org, Andre Oppermann , Sriram Gorti Subject: Re: Question on TCP reassembly counter X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Oct 2010 18:50:26 -0000 On Sat, 23 Oct 2010, Lawrence Stewart wrote: >> One observation though: net.inet.tcp.reass.cursegments was non-zero (it was >> just 1) after 30 rounds, where each round is (as earlier) 15-concurrent >> instances of netperf for 20s. This was on the netserver side. And, it was >> zero before the netperf runs. On the other hand, Andre told me (in a >> separate mail) that this counter is not relevant anymore - so, should I >> just ignore it ? > > It's relevant, just not guaranteed to be 100% accurate at any given point in > time. The value is calculated based on synchronised access to UMA zone stats > and unsynchronised access to UMA per-cpu zone stats. The latter is safe, but > causes the overall result to potentially be inaccurate due to use of stale > data. The accuracy vs overhead tradeoff was deemed worthwhile for > informational counters like this one. > > That being said, I would not expect the value to remain persistently at 1 > after all TCP activity has finished on the machine. It won't affect > performance, but I'm curious to know if the calculation method has a flaw. > I'll try to reproduce locally, but can you please confirm if the value stays > at 1 even after many minutes of no TCP activity? It's possible we should revisit the current synchronisation model for per-CPU caches in this regard. We switched to soft critical sessions when the P4 Xeon was a popular CPU line -- it had extortionately expensive atomic operations, even when a cache line was in the local cache. If we were to move back to mutexes for per-CPU caches, then we could acquire all the locks in sequence and get an atomic snapshot across them all (if desired). This isn't a hard technical change, but would require very careful performance evaluation. Robert From owner-freebsd-net@FreeBSD.ORG Mon Oct 25 06:19:12 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71C5E1065675 for ; Mon, 25 Oct 2010 06:19:12 +0000 (UTC) (envelope-from nr1c0re@gmail.com) Received: from mail-iw0-f182.google.com (mail-iw0-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 39DF18FC08 for ; Mon, 25 Oct 2010 06:19:11 +0000 (UTC) Received: by iwn39 with SMTP id 39so3968049iwn.13 for ; Sun, 24 Oct 2010 23:19:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=OLHGqCRCTqGZryL+p+CDLt23iMEQMVwy/N/xU22t0Rc=; b=v8UFhqCsDPLPXWyen4KzIBuXQOMglxGxDjoP9c0/DNYrYKnwKssmke4TNkbEOD6Ryc CAbptC4E0l85jOxo+mzONKtvVSOkOSrFanTMA0BF/s7cbo0ZoH3ydSaRS1m4sQSh0E5k tlYFwwTZScccvIoBUSVBGl/GDQQsAWjJFOwXA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=fv+5M5VM7oJvZg0Bn+fV3OrE92I2W+eA7CRfzrHSQGqchL2OLASBCzF3QDprNl/wqR eWxgvq2JLjm7xaNYleERgIkSQlY+eGQQ4ergOvabsJUTFpymFXlIuKuCWw1K63SruEEk X0UL6i2f+8Ib/WPQGnI9lJG0fFuFawNu9g+x4= MIME-Version: 1.0 Received: by 10.231.150.7 with SMTP id w7mr5350092ibv.14.1287987551542; Sun, 24 Oct 2010 23:19:11 -0700 (PDT) Received: by 10.229.217.20 with HTTP; Sun, 24 Oct 2010 23:19:11 -0700 (PDT) In-Reply-To: References: Date: Mon, 25 Oct 2010 10:19:11 +0400 Message-ID: From: c0re To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: carp and arp_rtrequest: bad gateway 1.1.1.5 (!AF_LINK) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 06:19:12 -0000 It's strange... No log messages about moving from BACKUP to MASTER. Oct 23 04:00:05 carp2 kernel: arp_rtrequest: bad gateway 1.1.1.5 (!AF_LINK) Oct 23 04:00:05 carp2 kernel: arp_rtrequest: bad gateway 1.1.1.6 (!AF_LINK) Oct 23 04:00:05 carp2 kernel: arp_rtrequest: bad gateway 1.1.1.9 (!AF_LINK) Oct 23 04:00:06 carp2 kernel: carp0: MASTER -> BACKUP (more frequent advertisement received) Oct 24 00:10:18 carp2 kernel: arp_rtrequest: bad gateway 1.1.1.5 (!AF_LINK) Oct 24 00:10:18 carp2 kernel: arp_rtrequest: bad gateway 1.1.1.6 (!AF_LINK) Oct 24 00:10:18 carp2 kernel: arp_rtrequest: bad gateway 1.1.1.9 (!AF_LINK) Oct 24 00:10:18 carp2 kernel: carp0: MASTER -> BACKUP (more frequent advertisement received) 2010/10/20 c0re : > I got 2 servers with CARP enabled. One is MASTER, second - BACKUP. > CARP is for HA of running some service on that servers. > > All works fine, but today I've got interesting case: > Service was not responding for 5 minutes. Can't tell more details > because it was said by not IT guy. > > Okay, I went to check logs on master and backup servers. All was fine > except dmesg and messages: > > Master server has no recored in messages for about 1 hour. > > But on slave server I saw that: > > Oct 20 12:15:00 carp-backup kernel: arp_rtrequest: bad gateway 1.1.1.5 > (!AF_LINK) > Oct 20 12:15:00 carp-backup kernel: arp_rtrequest: bad gateway 1.1.1.6 > (!AF_LINK) > Oct 20 12:15:00 carp-backup kernel: arp_rtrequest: bad gateway 1.1.1.9 > (!AF_LINK) > .................. > Oct 20 12:49:58 carp-backup kernel: arp_rtrequest: bad gateway 1.1.1.5 > (!AF_LINK) > Oct 20 12:49:58 carp-backup kernel: arp_rtrequest: bad gateway 1.1.1.6 > (!AF_LINK) > Oct 20 12:49:58 carp-backup kernel: arp_rtrequest: bad gateway 1.1.1.9 > (!AF_LINK) > > Total about 300 records. > > Can anyone comment something about it? What was that? Backup server > was loosing connectivity with Master server? > > In sysctl.conf I've got only net.inet.carp.preempt=1.Now I tuned log > to net.inet.carp.log=2. This should log carp info messages. > > Am I right about loosing connectivity between master-backup servers or > there can be another reason? > From owner-freebsd-net@FreeBSD.ORG Mon Oct 25 06:40:14 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 617B11065673; Mon, 25 Oct 2010 06:40:14 +0000 (UTC) (envelope-from gsriram@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 26BEA8FC15; Mon, 25 Oct 2010 06:40:13 +0000 (UTC) Received: by pvc22 with SMTP id 22so412180pvc.13 for ; Sun, 24 Oct 2010 23:40:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=+i0dxNVoYEwsIUqTTJakfLKu9nvmZOgHWxdNd2S2VMA=; b=QE90uAS7zI6zU4LXijMzogFytkDkTheG34ZB+kUIcdGeJn/g+ClqfJ2PnJ5tJK2Tnt 6IxQ5K1zNULSCdh6KzW0qvln7jXUr/RNTqlmEjuI0j5v4caSgB3QbL9mwYBfuXTs57kU Y0V5suUbhUbyh4E+9oSqyR2Gs6zOyrbMXEG7U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=kpGjDgEN6ISJiY9PPHa2upzTAEN3zVg6VkzSu1/vMaiX23rW8OvzS76m4qaksDkD4P P71R0TbFMmsydKhnchnT2b0Jdh0hj8qTvRsycw5O/ibQBJD4uXMFLzBEOduDZoR6Dp9l lz4dKQV33q1amp5/G5kYh7i2SiT3cpY+TQHOw= MIME-Version: 1.0 Received: by 10.142.136.12 with SMTP id j12mr5107117wfd.148.1287988813617; Sun, 24 Oct 2010 23:40:13 -0700 (PDT) Received: by 10.143.156.8 with HTTP; Sun, 24 Oct 2010 23:40:13 -0700 (PDT) In-Reply-To: <4CC2254C.7070104@freebsd.org> References: <4CA5D1F0.3000307@freebsd.org> <4CA9B6AC.20403@freebsd.org> <4CBB6CE9.1030009@freebsd.org> <4CC2254C.7070104@freebsd.org> Date: Mon, 25 Oct 2010 12:10:13 +0530 Message-ID: From: Sriram Gorti To: Lawrence Stewart Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org, Andre Oppermann Subject: Re: Question on TCP reassembly counter X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 06:40:14 -0000 Hi, On Sat, Oct 23, 2010 at 5:29 AM, Lawrence Stewart wrote: > On 10/22/10 18:10, Sriram Gorti wrote: >> Hi, >> >> On Mon, Oct 18, 2010 at 3:08 AM, Lawrence Stewart wrote: >> >> Thanks for the fix. Tried it on XLR/XLS and the earlier tests pass >> now. net.inet.tcp.reass.overflows was always zero after the tests (and >> in the samples I took while the tests were running). > > Great, thanks for testing. > >> One observation though: net.inet.tcp.reass.cursegments was non-zero >> (it was just 1) after 30 rounds, where each round is (as earlier) >> 15-concurrent instances of netperf for 20s. This was on the netserver >> side. And, it was zero before the netperf runs. On the other hand, >> Andre told me (in a separate mail) that this counter is not relevant >> anymore - so, should I just ignore it ? > > It's relevant, just not guaranteed to be 100% accurate at any given > point in time. The value is calculated based on synchronised access to > UMA zone stats and unsynchronised access to UMA per-cpu zone stats. The > latter is safe, but causes the overall result to potentially be > inaccurate due to use of stale data. The accuracy vs overhead tradeoff > was deemed worthwhile for informational counters like this one. > > That being said, I would not expect the value to remain persistently at > 1 after all TCP activity has finished on the machine. It won't affect > performance, but I'm curious to know if the calculation method has a > flaw. I'll try to reproduce locally, but can you please confirm if the > value stays at 1 even after many minutes of no TCP activity? > This behavior does repeat easily but finally it did. Even after leaving the system alone (other than for background NFS messages) for a few mins, the value persists. After a little more investigation, it is observed that one of the spawned netserver's has not terminated and when it is explicitly terminated, the sysctl of interest drops back to zero. Does that mean the TCP reassembly portion is doing okay ? But, it opens up the question of why the netserver has not terminated. I will dig further into it but if you have any quick suggestions, they are most welcome. thanks, Sriram From owner-freebsd-net@FreeBSD.ORG Mon Oct 25 06:55:16 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 75B7D1065697 for ; Mon, 25 Oct 2010 06:55:16 +0000 (UTC) (envelope-from vl.varlog@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 085DE8FC20 for ; Mon, 25 Oct 2010 06:55:15 +0000 (UTC) Received: by eyb7 with SMTP id 7so1233426eyb.13 for ; Sun, 24 Oct 2010 23:55:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:x-priority :message-id:to:subject:mime-version:content-type :content-transfer-encoding; bh=sJX9CNd5aElWgmYoMJM/ORG7VPv+QSJbB5OnV+KaFcg=; b=Tk+qTR0xk9KbPXfSifwoHtgaaretZufc+lly26abmxGjBfydbiw6MGZQCUC2d1KHAI 0De4yS3OJi65Yg2ebcMC/e9HaiuBoETn5cne35JcnW659xhpmDOmEYB5PrSiPK4143sa qN+thcMr2fomwBABAh3YLG/WJwDcOQdv6hTN4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:x-priority:message-id:to:subject:mime-version :content-type:content-transfer-encoding; b=iC1+oSa5a0xFWZDsLhVGukP7QYou1Th6jTaWJ2TgNaE2bUHjMRmKj6mWVForBsPmG1 4AIpcqQ5oYbPKgNGG1/m0kVckYg1UJzaE8T6+HFiPZtH0aJh+H6pF+NbBRCY70kAzMiz zuS66DcSdPqhuyonEv17Uuhja5YIIukeDx6qc= Received: by 10.213.101.20 with SMTP id a20mr1578507ebo.50.1287988234298; Sun, 24 Oct 2010 23:30:34 -0700 (PDT) Received: from v-grigorov-xp.mail.msk ([195.218.191.171]) by mx.google.com with ESMTPS id b52sm6997212eei.7.2010.10.24.23.30.32 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 24 Oct 2010 23:30:33 -0700 (PDT) Date: Mon, 25 Oct 2010 10:28:46 +0400 From: Vladimir Grigorov X-Priority: 3 (Normal) Message-ID: <1078951221.20101025102846@gmail.com> To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: quoted-printable Subject: re: Strange problem with sk0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 06:55:16 -0000 May be ypotr switch try to negotiate spanning tree ? I have same problems w= ith other cards, not only sk. Try to disavle spanning tree negotiation on y= our switch. On cisco Catalyst this is done by 'spanning-tree porfast' comma= nd on interface --=20 =D1 =F3=E2=E0=E6=E5=ED=E8=E5=EC, Vladimir mailto:vl.varlog@gmail.com From owner-freebsd-net@FreeBSD.ORG Mon Oct 25 09:56:24 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBD57106564A; Mon, 25 Oct 2010 09:56:24 +0000 (UTC) (envelope-from bschmidt@techwires.net) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4B69B8FC19; Mon, 25 Oct 2010 09:56:23 +0000 (UTC) Received: by fxm17 with SMTP id 17so2727429fxm.13 for ; Mon, 25 Oct 2010 02:56:23 -0700 (PDT) Received: by 10.103.212.2 with SMTP id o2mr7917222muq.136.1287998988948; Mon, 25 Oct 2010 02:29:48 -0700 (PDT) Received: from jessie.localnet (p5B0E216B.dip0.t-ipconnect.de [91.14.33.107]) by mx.google.com with ESMTPS id r22sm2744372fax.45.2010.10.25.02.29.46 (version=SSLv3 cipher=RC4-MD5); Mon, 25 Oct 2010 02:29:46 -0700 (PDT) Sender: Bernhard Schmidt From: Bernhard Schmidt To: Matthias Apitz Date: Mon, 25 Oct 2010 11:29:43 +0200 User-Agent: KMail/1.13.2 (Linux/2.6.32-25-generic; KDE/4.4.2; i686; ; ) References: <20101024052559.GA1971@current.Sisis.de> In-Reply-To: <20101024052559.GA1971@current.Sisis.de> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_I4UxMQlRq0osoBA" Message-Id: <201010251129.44262.bschmidt@freebsd.org> Cc: freebsd-net@freebsd.org, freebsd-hackers@freebsd.org Subject: Re: Broadcom BCM4310 / bwi(4) and interface bwi0 is not showing up X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: bschmidt@freebsd.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 09:56:25 -0000 --Boundary-00=_I4UxMQlRq0osoBA Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit On Sunday, October 24, 2010 07:25:59 Matthias Apitz wrote: > Hello, > > I have a new laptop Acer Aspire One D250 and I want to install a > 8-CURRENT as of CVS from May 2009 (as I use this on all my laptops). > The laptop comes with as Wifi chip: > > none2@pci0:1:0:0: class=0x028000 card=0xe01b105b chip=0x431514e4 > rev=0x01 hdr=0x00 > vendor = 'Broadcom Corporation' > device = 'BCM4310 USB Controller' > class = network > > I learned after searching around that it should be supported by bwi(4) > and one should install the firmware kmod from the ports. I have in > loader.conf: > [..] Please try attached patch, I'm not sure if it is that simple.. worth a try though. -- Bernhard --Boundary-00=_I4UxMQlRq0osoBA Content-Type: text/x-patch; charset="UTF-8"; name="bwi_4315.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="bwi_4315.diff" --- a/sys/dev/bwi/if_bwi_pci.c +++ b/sys/dev/bwi/if_bwi_pci.c @@ -85,6 +85,7 @@ static const struct bwi_dev { { PCI_VENDOR_BROADCOM, 0x4311,"Broadcom BCM4311 802.11b/g Wireless Lan" }, { PCI_VENDOR_BROADCOM, 0x4312,"Broadcom BCM4312 802.11a/b/g Wireless Lan" }, { PCI_VENDOR_BROADCOM, 0x4313,"Broadcom BCM4312 802.11a Wireless Lan" }, + { PCI_VENDOR_BROADCOM, 0x4315,"Broadcom BCM4312 802.11b/g Wireless Lan"}, { PCI_VENDOR_BROADCOM, 0x4320,"Broadcom BCM4306 802.11b/g Wireless Lan"}, { PCI_VENDOR_BROADCOM, 0x4321,"Broadcom BCM4306 802.11a Wireless Lan"}, { PCI_VENDOR_BROADCOM, 0x4325,"Broadcom BCM4306 802.11b/g Wireless Lan"}, --Boundary-00=_I4UxMQlRq0osoBA-- From owner-freebsd-net@FreeBSD.ORG Mon Oct 25 11:07:05 2010 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2E6710656A5 for ; Mon, 25 Oct 2010 11:07:05 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id BF5798FC46 for ; Mon, 25 Oct 2010 11:07:05 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9PB75fT088835 for ; Mon, 25 Oct 2010 11:07:05 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9PB74Gh088833 for freebsd-net@FreeBSD.org; Mon, 25 Oct 2010 11:07:04 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 25 Oct 2010 11:07:04 GMT Message-Id: <201010251107.o9PB74Gh088833@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-net@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-net@FreeBSD.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 11:07:05 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o kern/151690 net network connectivity won't work until dhclient is run o kern/151681 net [nfs] NFS mount via IPv6 leads to hang on client with o kern/151593 net [igb] [panic] Kernel panic when bringing up igb networ o kern/151441 net [iwi] iwi module not work properly using HP nc6220 o kern/150920 net [ixgbe][igb] Panic when packets are dropped with heade o kern/150557 net [igb] igb0: Watchdog timeout -- resetting o kern/150257 net [msk] watchdog timeout o kern/150251 net [patch] [ixgbe] Late cable insertion broken o kern/150249 net [ixgbe] Media type detection broken o kern/150247 net [patch] [ixgbe] Version in -current won't build on 7.x o bin/150224 net ppp(8) does not reassign static IP after kill -KILL co o kern/150148 net [ath] Atheros 5424/2424 - AR2425 stopped working with o kern/150052 net [wi] wi(4) driver does not work with wlan(4) driver fo f kern/149969 net [wlan] [ral] ralink rt2661 fails to maintain connectio o kern/149937 net [ipfilter] [patch] kernel panic in ipfilter IP fragmen o kern/149786 net [bwn] bwn on Dell Inspiron 1150: connections stall o kern/149643 net [rum] device not sending proper beacon frames in ap mo o kern/149609 net [panic] reboot after adding second default route o kern/149539 net [ath] atheros ar9287 is not supported by ath_hal o kern/149516 net [ath] ath(4) hostap with fake MAC/BSSID results in sta o kern/149373 net [realtek/atheros]: None of my network card working o kern/149307 net [ath] Doesn't work Atheros 9285 o kern/149306 net [alc] Doesn't work Atheros AR8131 PCIe Gigabit Etherne o kern/149117 net [inet] [patch] in_pcbbind: redundant test o kern/149086 net [multicast] Generic multicast join failure in 8.1 o kern/148862 net [panic] page fault while in kernel mode at _mtx_lock_s o kern/148322 net [ath] Triggering atheros wifi beacon misses in hostap o kern/148317 net [ath] FreeBSD 7.x hostap memory leak in net80211 or At o kern/148078 net [ath] wireless networking stops functioning o kern/147985 net [alc] alc network driver + tso ( + vlan ? ) does not w o kern/147894 net [ipsec] IPv6-in-IPv4 does not work inside an ESP-only o kern/147862 net [wpi] Possible bug in the wpi driver. Network Manager o kern/147155 net [ip6] setfb not work with ipv6 o kern/146845 net [libc] close(2) returns error 54 (connection reset by o kern/146792 net [flowtable] flowcleaner 100% cpu's core load o kern/146759 net [cxgb] [patch] cxgb panic calling cxgb_set_lro() witho o kern/146719 net [pf] [panic] PF or dumynet kernel panic o kern/146534 net [icmp6] wrong source address in echo reply o kern/146517 net [ath] [wlan] device timeouts for ath wlan device on re o kern/146427 net [mwl] Additional virtual access points don't work on m o kern/146426 net [mwl] 802.11n rates not possible on mwl o kern/146425 net [mwl] mwl dropping all packets during and after high u f kern/146394 net [vlan] IP source address for outgoing connections o bin/146377 net [ppp] [tun] Interface doesn't clear addresses when PPP o kern/146358 net [vlan] wrong destination MAC address o kern/146165 net [wlan] [panic] Setting bssid in adhoc mode causes pani o kern/146082 net [ng_l2tp] a false invaliant check was performed in ng_ o kern/146037 net [panic] mpd + CoA = kernel panic o bin/145934 net [patch] add count option to netstat(1) o kern/145826 net [ath] Unable to configure adhoc mode on ath0/wlan0 o kern/145825 net [panic] panic: soabort: so_count o kern/145777 net [wpi] Intel 3945ABG driver breaks the connection after o kern/145728 net [lagg] Stops working lagg between two servers. o amd64/145654 net amd64-curent memory leak in kernel o kern/144987 net [wpi] [panic] injecting packets with wlaninject using o kern/144882 net MacBookPro =>4.1 does not connect to BSD in hostap wit o kern/144874 net [if_bridge] [patch] if_bridge frees mbuf after pfil ho o conf/144700 net [rc.d] async dhclient breaks stuff for too many people o kern/144642 net [rum] [panic] Enabling rum interface causes panic o kern/144616 net [nat] [panic] ip_nat panic FreeBSD 7.2 o kern/144572 net [carp] CARP preemption mode traffic partially goes to f kern/144315 net [ipfw] [panic] freebsd 8-stable reboot after add ipfw o kern/143939 net [ipfw] [em] ipfw nat and em interface rxcsum problem o kern/143874 net [wpi] Wireless 3945ABG error. wpi0 could not allocate o kern/143868 net [ath] [patch] [request] allow Atheros watchdog timeout o kern/143846 net [gif] bringing gif3 tunnel down causes gif0 tunnel to s kern/143673 net [stf] [request] there should be a way to support multi s kern/143666 net [ip6] [request] PMTU black hole detection not implemen o kern/143622 net [pfil] [patch] unlock pfil lock while calling firewall o kern/143595 net [wpi] [panic] Creating virtual interface over wpi0 in o kern/143593 net [ipsec] When using IPSec, tcpdump doesn't show outgoin o kern/143591 net [ral] RT2561C-based DLink card (DWL-510) fails to work o kern/143208 net [ipsec] [gif] IPSec over gif interface not working o conf/143079 net hostapd(8) startup missing multi wlan functionality o kern/143074 net [wi]: wi driver triggers panic o kern/143034 net [panic] system reboots itself in tcp code [regression] o kern/142907 net [wpi] if_wpi unstable on ibm/lenovo x60 -- suspect fir o kern/142877 net [hang] network-related repeatable 8.0-STABLE hard hang o kern/142774 net Problem with outgoing connections on interface with mu o kern/142772 net [libc] lla_lookup: new lle malloc failed o kern/142018 net [iwi] [patch] Possibly wrong interpretation of beacon- o kern/141861 net [wi] data garbled with WEP and wi(4) with Prism 2.5 o kern/141777 net [rum] [patch] Support usbdevs / rum(4) for Buffalo WLI f kern/141741 net Etherlink III NIC won't work after upgrade to FBSD 8, o kern/141023 net [carp] CARP arp replays with wrong src mac o kern/140796 net [ath] [panic] privileged instruction fault o kern/140742 net rum(4) Two asus-WL167G adapters cannot talk to each ot o kern/140682 net [netgraph] [panic] random panic in netgraph o kern/140634 net [vlan] destroying if_lagg interface with if_vlan membe o kern/140619 net [ifnet] [patch] refine obsolete if_var.h comments desc o kern/140564 net [wpi] Problem with Intel(R) PRO/Wireless 3945ABG o kern/140346 net [wlan] High bandwidth use causes loss of wlan connecti o kern/140245 net [ath] [panic] Kernel panic during network activity on o kern/140142 net [ip6] [panic] FreeBSD 7.2-amd64 panic w/IPv6 o kern/140066 net [bwi] install report for 8.0 RC 2 (multiple problems) o kern/139565 net [ipfilter] ipfilter ioctl SIOCDELST broken o kern/139387 net [ipsec] Wrong lenth of PF_KEY messages in promiscuous o bin/139346 net [patch] arp(8) add option to remove static entries lis o kern/139268 net [if_bridge] [patch] allow if_bridge to forward just VL o kern/139204 net [arp] DHCP server replies rejected, ARP entry lost bef o kern/139117 net [lagg] + wlan boot timing (EBUSY) o kern/139079 net [wpi] Failure to attach wpi(4) o kern/139058 net [ipfilter] mbuf cluster leak on FreeBSD 7.2 o kern/138850 net [dummynet] dummynet doesn't work correctly on a bridge o kern/138782 net [panic] sbflush_internal: cc 0 || mb 0xffffff004127b00 o kern/138739 net [wpi] wpi(4) does not work very well under 8.0-BETA4 o amd64/138688 net [rum] possibly broken on 8 Beta 4 amd64: able to wpa a o kern/138678 net [lo] FreeBSD does not assign linklocal address to loop o kern/138620 net [lagg] [patch] lagg port bpf-writes blocked o kern/138427 net [wpi] [panic] Kernel panic after trying set monitor wl o kern/138407 net [gre] gre(4) interface does not come up after reboot o kern/138332 net [tun] [lor] ifconfig tun0 destroy causes LOR if_adata/ o kern/138266 net [panic] kernel panic when udp benchmark test used as r o kern/138177 net [ipfilter] FreeBSD crashing repeatedly in ip_nat.c:257 o kern/137881 net [netgraph] [panic] ng_pppoe fatal trap 12 o bin/137841 net [patch] wpa_supplicant(8) cannot verify SHA256 signed o kern/137776 net [rum] panic in rum(4) driver on 8.0-BETA2 o kern/137775 net [netgraph] [patch] Add XMIT_FAILOVER to ng_one2many o bin/137641 net ifconfig(8): various problems with "vlan_device.vlan_i o kern/137592 net [ath] panic - 7-STABLE (Aug 7, 2009 UTC) crashes on ne o bin/137484 net [patch] Integer overflow in wpa_supplicant(8) base64 e o kern/137392 net [ip] [panic] crash in ip_nat.c line 2577 o kern/137372 net [ral] FreeBSD doesn't support wireless interface from o kern/137089 net [lagg] lagg falsely triggers IPv6 duplicate address de o bin/136994 net [patch] ifconfig(8) print carp mac address o kern/136943 net [wpi] [lor] wpi0_com_lock / wpi0 o kern/136911 net [netgraph] [panic] system panic on kldload ng_bpf.ko t o kern/136836 net [ath] atheros card stops functioning after about 12 ho o bin/136661 net [patch] ndp(8) ignores -f option o kern/136618 net [pf][stf] panic on cloning interface without unit numb o kern/136426 net [panic] spawning several dhclients in parallel panics o kern/135502 net [periodic] Warning message raised by rtfree function i o kern/134931 net [route] Route messages sent to all socket listeners re o kern/134583 net [hang] Machine with jail freezes after random amount o o kern/134531 net [route] [panic] kernel crash related to routes/zebra o kern/134168 net [ral] ral driver problem on RT2525 2.4GHz transceiver o kern/134157 net [dummynet] dummynet loads cpu for 100% and make a syst o kern/133969 net [dummynet] [panic] Fatal trap 12: page fault while in o kern/133968 net [dummynet] [panic] dummynet kernel panic o kern/133736 net [udp] ip_id not protected ... o kern/133613 net [wpi] [panic] kernel panic in wpi(4) o kern/133595 net [panic] Kernel Panic at pcpu.h:195 o kern/133572 net [ppp] [hang] incoming PPTP connection hangs the system o kern/133490 net [bpf] [panic] 'kmem_map too small' panic on Dell r900 o kern/133235 net [netinet] [patch] Process SIOCDLIFADDR command incorre o kern/133218 net [carp] [hang] use of carp(4) causes system to freeze f kern/133213 net arp and sshd errors on 7.1-PRERELEASE o kern/133060 net [ipsec] [pfsync] [panic] Kernel panic with ipsec + pfs o kern/132889 net [ndis] [panic] NDIS kernel crash on load BCM4321 AGN d o kern/132885 net [wlan] 802.1x broken after SVN rev 189592 o conf/132851 net [patch] rc.conf(5): allow to setfib(1) for service run o kern/132734 net [ifmib] [panic] panic in net/if_mib.c o kern/132722 net [ath] Wifi ath0 associates fine with AP, but DHCP or I o kern/132705 net [libwrap] [patch] libwrap - infinite loop if hosts.all o kern/132672 net [ndis] [panic] ndis with rt2860.sys causes kernel pani o kern/132554 net [ipl] There is no ippool start script/ipfilter magic t o kern/132354 net [nat] Getting some packages to ipnat(8) causes crash o kern/132285 net [carp] alias gives incorrect hash in dmesg o kern/132277 net [crypto] [ipsec] poor performance using cryptodevice f o kern/132107 net [carp] carp(4) advskew setting ignored when carp IP us o kern/131781 net [ndis] ndis keeps dropping the link o kern/131776 net [wi] driver fails to init o kern/131753 net [altq] [panic] kernel panic in hfsc_dequeue o bin/131567 net [socket] [patch] Update for regression/sockets/unix_cm o kern/131549 net ifconfig(8) can't clear 'monitor' mode on the wireless o bin/131365 net route(8): route add changes interpretation of network f kern/130820 net [ndis] wpa_supplicant(8) returns 'no space on device' o kern/130628 net [nfs] NFS / rpc.lockd deadlock on 7.1-R o conf/130555 net [rc.d] [patch] No good way to set ipfilter variables a o kern/130525 net [ndis] [panic] 64 bit ar5008 ndisgen-erated driver cau o kern/130311 net [wlan_xauth] [panic] hostapd restart causing kernel pa o kern/130109 net [ipfw] Can not set fib for packets originated from loc f kern/130059 net [panic] Leaking 50k mbufs/hour f kern/129750 net [ath] Atheros AR5006 exits on "cannot map register spa f kern/129719 net [nfs] [panic] Panic during shutdown, tcp_ctloutput: in o kern/129517 net [ipsec] [panic] double fault / stack overflow o kern/129508 net [carp] [panic] Kernel panic with EtherIP (may be relat o kern/129219 net [ppp] Kernel panic when using kernel mode ppp o kern/129197 net [panic] 7.0 IP stack related panic o bin/128954 net ifconfig(8) deletes valid routes o kern/128917 net [wpi] [panic] if_wpi and wpa+tkip causing kernel panic o bin/128602 net [an] wpa_supplicant(8) crashes with an(4) o kern/128448 net [nfs] 6.4-RC1 Boot Fails if NFS Hostname cannot be res o conf/128334 net [request] use wpa_cli in the "WPA DHCP" situation o bin/128295 net [patch] ifconfig(8) does not print TOE4 or TOE6 capabi o bin/128001 net wpa_supplicant(8), wlan(4), and wi(4) issues o kern/127826 net [iwi] iwi0 driver has reduced performance and connecti o kern/127815 net [gif] [patch] if_gif does not set vlan attributes from o kern/127724 net [rtalloc] rtfree: 0xc5a8f870 has 1 refs f bin/127719 net [arp] arp: Segmentation fault (core dumped) f kern/127528 net [icmp]: icmp socket receives icmp replies not owned by o bin/127192 net routed(8) removes the secondary alias IP of interface f kern/127145 net [wi]: prism (wi) driver crash at bigger traffic o kern/127102 net [wpi] Intel 3945ABG low throughput o kern/127057 net [udp] Unable to send UDP packet via IPv6 socket to IPv o kern/127050 net [carp] ipv6 does not work on carp interfaces [regressi o kern/126945 net [carp] CARP interface destruction with ifconfig destro o kern/126895 net [patch] [ral] Add antenna selection (marked as TBD) o kern/126874 net [vlan]: Zebra problem if ifconfig vlanX destroy o kern/126714 net [carp] CARP interface renaming makes system no longer o kern/126695 net rtfree messages and network disruption upon use of if_ o kern/126475 net [ath] [panic] ath pcmcia card inevitably panics under o kern/126339 net [ipw] ipw driver drops the connection o kern/126214 net [ath] txpower problem with Atheros wifi card o kern/126075 net [inet] [patch] internet control accesses beyond end of o bin/125922 net [patch] Deadlock in arp(8) o kern/125920 net [arp] Kernel Routing Table loses Ethernet Link status o kern/125845 net [netinet] [patch] tcp_lro_rx() should make use of hard o kern/125816 net [carp] [if_bridge] carp stuck in init when using bridg o kern/125721 net [ath] Terrible throughput/high ping latency with Ubiqu o kern/125617 net [ath] [panic] ath(4) related panic f kern/125502 net [ral] ifconfig ral0 scan produces no output unless in o kern/125501 net [ath] atheros cardbus driver hangs f kern/125332 net [ath] [panic] crash under any non-tiny networking unde o kern/125258 net [socket] socket's SO_REUSEADDR option does not work o kern/125239 net [gre] kernel crash when using gre o kern/124767 net [iwi] Wireless connection using iwi0 driver (Intel 220 o kern/124753 net [ieee80211] net80211 discards power-save queue packets o kern/124341 net [ral] promiscuous mode for wireless device ral0 looses o kern/124225 net [ndis] [patch] ndis network driver sometimes loses net o kern/124160 net [libc] connect(2) function loops indefinitely o kern/124021 net [ip6] [panic] page fault in nd6_output() o kern/123968 net [rum] [panic] rum driver causes kernel panic with WPA. o kern/123892 net [tap] [patch] No buffer space available o kern/123890 net [ppp] [panic] crash & reboot on work with PPP low-spee o kern/123858 net [stf] [patch] stf not usable behind a NAT o kern/123796 net [ipf] FreeBSD 6.1+VPN+ipnat+ipf: port mapping does not o kern/123758 net [panic] panic while restarting net/freenet6 o bin/123633 net ifconfig(8) doesn't set inet and ether address in one o kern/123559 net [iwi] iwi periodically disassociates/associates [regre o bin/123465 net [ip6] route(8): route add -inet6 -interfac o kern/123463 net [ipsec] [panic] repeatable crash related to ipsec-tool o kern/123429 net [nfe] [hang] "ifconfig nfe up" causes a hard system lo o conf/123330 net [nsswitch.conf] Enabling samba wins in nsswitch.conf c o kern/123256 net [wpi] panic: blockable sleep lock with wpi(4) o kern/123160 net [ip] Panic and reboot at sysctl kern.polling.enable=0 o kern/122989 net [swi] [panic] 6.3 kernel panic in swi1: net o kern/122954 net [lagg] IPv6 EUI64 incorrectly chosen for lagg devices f kern/122780 net [lagg] tcpdump on lagg interface during high pps wedge o kern/122697 net [ath] Atheros card is not well supported o kern/122685 net It is not visible passing packets in tcpdump(1) o kern/122319 net [wi] imposible to enable ad-hoc demo mode with Orinoco o kern/122290 net [netgraph] [panic] Netgraph related "kmem_map too smal o kern/122033 net [ral] [lor] Lock order reversal in ral0 at bootup ieee o bin/121895 net [patch] rtsol(8)/rtsold(8) doesn't handle managed netw o kern/121872 net [wpi] driver fails to attach on a fujitsu-siemens s711 s kern/121774 net [swi] [panic] 6.3 kernel panic in swi1: net o kern/121706 net [netinet] [patch] "rtfree: 0xc4383870 has 1 refs" emit o kern/121555 net [panic] Fatal trap 12: current process = 12 (swi1: net o kern/121443 net [gif] [lor] icmp6_input/nd6_lookup o kern/121437 net [vlan] Routing to layer-2 address does not work on VLA o bin/121359 net [patch] [security] ppp(8): fix local stack overflow in o kern/121257 net [tcp] TSO + natd -> slow outgoing tcp traffic o kern/121181 net [panic] Fatal trap 3: breakpoint instruction fault whi o kern/120966 net [rum] kernel panic with if_rum and WPA encryption p docs/120945 net [patch] ip6(4) man page lacks documentation for TCLASS o kern/120566 net [request]: ifconfig(8) make order of arguments more fr o kern/120304 net [netgraph] [patch] netgraph source assumes 32-bit time o kern/120266 net [udp] [panic] gnugk causes kernel panic when closing U o kern/120130 net [carp] [panic] carp causes kernel panics in any conste o bin/120060 net routed(8) deletes link-level routes in the presence of o kern/119945 net [rum] [panic] rum device in hostap mode, cause kernel o kern/119791 net [nfs] UDP NFS mount of aliased IP addresses from a Sol o kern/119617 net [nfs] nfs error on wpa network when reseting/shutdown f kern/119516 net [ip6] [panic] _mtx_lock_sleep: recursed on non-recursi o kern/119432 net [arp] route add -host -iface causes arp e o kern/119225 net [wi] 7.0-RC1 no carrier with Prism 2.5 wifi card [regr o kern/118727 net [netgraph] [patch] [request] add new ng_pf module s kern/117717 net [panic] Kernel panic with Bittorrent client. o kern/117448 net [carp] 6.2 kernel crash [regression] o kern/117423 net [vlan] Duplicate IP on different interfaces o bin/117339 net [patch] route(8): loading routing management commands o kern/117271 net [tap] OpenVPN TAP uses 99% CPU on releng_6 when if_tap o kern/116747 net [ndis] FreeBSD 7.0-CURRENT crash with Dell TrueMobile o bin/116643 net [patch] [request] fstat(1): add INET/INET6 socket deta o kern/116185 net [iwi] if_iwi driver leads system to reboot o kern/115239 net [ipnat] panic with 'kmem_map too small' using ipnat o kern/115019 net [netgraph] ng_ether upper hook packet flow stops on ad o kern/115002 net [wi] if_wi timeout. failed allocation (busy bit). ifco o kern/114915 net [patch] [pcn] pcn (sys/pci/if_pcn.c) ethernet driver f o kern/113432 net [ucom] WARNING: attempt to net_add_domain(netgraph) af o kern/112722 net [ipsec] [udp] IP v4 udp fragmented packet reject o kern/112686 net [patm] patm driver freezes System (FreeBSD 6.2-p4) i38 o bin/112557 net [patch] ppp(8) lock file should not use symlink name o kern/112528 net [nfs] NFS over TCP under load hangs with "impossible p o kern/111457 net [ral] ral(4) freeze o kern/109470 net [wi] Orinoco Classic Gold PC Card Can't Channel Hop o kern/109308 net [pppd] [panic] Multiple panics kernel ppp suspected [r o bin/108895 net pppd(8): PPPoE dead connections on 6.2 [regression] o kern/107944 net [wi] [patch] Forget to unlock mutex-locks f kern/107279 net [ath] [panic] ath_start: attempted use of a free mbuf! o conf/107035 net [patch] bridge(8): bridge interface given in rc.conf n o kern/106444 net [netgraph] [panic] Kernel Panic on Binding to an ip to o kern/106438 net [ipf] ipfilter: keep state does not seem to allow repl o kern/106316 net [dummynet] dummynet with multipass ipfw drops packets o kern/105945 net Address can disappear from network interface s kern/105943 net Network stack may modify read-only mbuf chain copies o bin/105925 net problems with ifconfig(8) and vlan(4) [regression] f kern/105348 net [ath] ath device stopps TX o kern/104851 net [inet6] [patch] On link routes not configured when usi o kern/104751 net [netgraph] kernel panic, when getting info about my tr o kern/103191 net Unpredictable reboot o kern/103135 net [ipsec] ipsec with ipfw divert (not NAT) encodes a pac o kern/102540 net [netgraph] [patch] supporting vlan(4) by ng_fec(4) o conf/102502 net [netgraph] [patch] ifconfig name does't rename netgrap o kern/102035 net [plip] plip networking disables parallel port printing o kern/101948 net [ipf] [panic] Kernel Panic Trap No 12 Page Fault - cau o kern/100709 net [libc] getaddrinfo(3) should return TTL info o kern/100519 net [netisr] suggestion to fix suboptimal network polling o kern/98978 net [ipf] [patch] ipfilter drops OOW packets under 6.1-Rel o kern/98597 net [inet6] Bug in FreeBSD 6.1 IPv6 link-local DAD procedu o bin/98218 net wpa_supplicant(8) blacklist not working f bin/97392 net ppp(8) hangs instead terminating o kern/97306 net [netgraph] NG_L2TP locks after connection with failed f kern/96268 net [socket] TCP socket performance drops by 3000% if pack o kern/95519 net [ral] ral0 could not map mbuf o kern/95288 net [pppd] [tty] [panic] if_ppp panic in sys/kern/tty_subr o kern/95277 net [netinet] [patch] IP Encapsulation mask_match() return o kern/95267 net packet drops periodically appear f kern/93886 net [ath] Atheros/D-Link DWL-G650 long delay to associate f kern/93378 net [tcp] Slow data transfer in Postfix and Cyrus IMAP (wo o kern/93019 net [ppp] ppp and tunX problems: no traffic after restarti o kern/92880 net [libc] [patch] almost rewritten inet_network(3) functi s kern/92279 net [dc] Core faults everytime I reboot, possible NIC issu o kern/91859 net [ndis] if_ndis does not work with Asus WL-138 s kern/91777 net [ipf] [patch] wrong behaviour with skip rule inside an o kern/91364 net [ral] [wep] WF-511 RT2500 Card PCI and WEP o kern/91311 net [aue] aue interface hanging s kern/90086 net [hang] 5.4p8 on supermicro P8SCT hangs during boot if o kern/87521 net [ipf] [panic] using ipfilter "auth" keyword leads to k o kern/87421 net [netgraph] [panic]: ng_ether + ng_eiface + if_bridge s kern/86920 net [ndis] ifconfig: SIOCS80211: Invalid argument [regress o kern/86871 net [tcp] [patch] allocation logic for PCBs in TIME_WAIT s o kern/86427 net [lor] Deadlock with FASTIPSEC and nat o kern/86103 net [ipf] Illegal NAT Traversal in IPFilter o kern/85780 net 'panic: bogus refcnt 0' in routing/ipv6 o bin/85445 net ifconfig(8): deprecated keyword to ifconfig inoperativ o bin/82975 net route change does not parse classfull network as given o kern/82881 net [netgraph] [panic] ng_fec(4) causes kernel panic after o bin/82185 net [patch] ndp(8) can delete the incorrect entry o kern/81095 net IPsec connection stops working if associated network i o kern/79895 net [ipf] 5.4-RC2 breaks ipfilter NAT when using netgraph o bin/79228 net [patch] extend arp(8) to be able to create blackhole r o kern/78968 net FreeBSD freezes on mbufs exhaustion (network interface o kern/78090 net [ipf] ipf filtering on bridged packets doesn't work if o kern/77341 net [ip6] problems with IPV6 implementation o kern/77273 net [ipf] ipfilter breaks ipv6 statefull filtering on 5.3 s kern/77195 net [ipf] [patch] ipfilter ioctl SIOCGNATL does not match o kern/75873 net Usability problem with non-RFC-compliant IP spoof prot s kern/75407 net [an] an(4): no carrier after short time a kern/71474 net [route] route lookup does not skip interfaces marked d o kern/71469 net default route to internet magically disappears with mu o kern/70904 net [ipf] ipfilter ipnat problem with h323 proxy support o kern/66225 net [netgraph] [patch] extend ng_eiface(4) control message o kern/65616 net IPSEC can't detunnel GRE packets after real ESP encryp s kern/60293 net [patch] FreeBSD arp poison patch a kern/56233 net IPsec tunnel (ESP) over IPv6: MTU computation is wrong o kern/54383 net [nfs] [patch] NFS root configurations without dynamic s bin/41647 net ifconfig(8) doesn't accept lladdr along with inet addr s kern/39937 net ipstealth issue a kern/38554 net [patch] changing interface ipaddress doesn't seem to w o kern/34665 net [ipf] [hang] ipfilter rcmd proxy "hangs". o kern/31647 net [libc] socket calls can return undocumented EINVAL o kern/30186 net [libc] getaddrinfo(3) does not handle incorrect servna o kern/27474 net [ipf] [ppp] Interactive use of user PPP and ipfilter c o conf/23063 net [arp] [patch] for static ARP tables in rc.network 366 problems total. From owner-freebsd-net@FreeBSD.ORG Mon Oct 25 11:53:14 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2C2A1065675 for ; Mon, 25 Oct 2010 11:53:14 +0000 (UTC) (envelope-from nr1c0re@gmail.com) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5533B8FC16 for ; Mon, 25 Oct 2010 11:53:13 +0000 (UTC) Received: by qyk33 with SMTP id 33so1291315qyk.13 for ; Mon, 25 Oct 2010 04:53:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=b3kYCOjCCEPkquhi8dWLCYStNdNjWoiN02Eu8ZXHGFk=; b=SGUKifCHXkO8UlqX1hFbalWRN/nES9J+gggZMdrGR9As9JhpOjVFTUCgDcIjpU3g0Z inrenqomy+Z930oPagLeKoPfsgNbd7fWJn2ZzP0G5Is+Sl0csA/R4I7wy9Qmd8HLysI9 3XLRn/1Mk5Lzvu/8B5TXF+QFaBcJMt/18Vuuo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=pKguMb98SXtANp+FYDMPuQ68RBKIBC9kPDBEVPcFN1ZngyZ9Z2PTsT0gF4GJEYfzyp n+XD98pXqEO2UbvGU1Ei92/o41j7QZjIZGtL79grzLh34/fbtacHhJ/pVNIiB28sfQS7 wSjd021BE06k22X7lP5/YlE6HRFaZc7nojHLw= MIME-Version: 1.0 Received: by 10.229.214.73 with SMTP id gz9mr6235475qcb.226.1288007593069; Mon, 25 Oct 2010 04:53:13 -0700 (PDT) Received: by 10.229.217.20 with HTTP; Mon, 25 Oct 2010 04:53:12 -0700 (PDT) In-Reply-To: References: Date: Mon, 25 Oct 2010 15:53:12 +0400 Message-ID: From: c0re To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: carp and arp_rtrequest: bad gateway 1.1.1.5 (!AF_LINK) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 11:53:14 -0000 Further workaround: 1st server has advbase 1 and advskew 0 2nd server has advbase 1 and advskew 100 So 2nd server should failover after what period of time when 1st server fails? In openbsd man 8 ifconfig ( http://www.openbsd.org/cgi-bin/man.cgi?query=ifconfig&apropos=0&sektion=8&manpath=OpenBSD+Current&arch=i386&format=html ) I found that info: Taken together, the advbase and advskew indicate how frequently, in seconds, the host will advertise the fact that it considers itself master of the virtual host. The formula is advbase + (advskew / 256). If the master does not advertise within three times this interval, this host will begin advertising as master. Due to CARP be ported from openbsd I think it should be same for freebsd too. So 2nd server should take MASTER state after 3*(advbase+(advskew / 256)) = 3*(1+(100/256)) =~ 4 secs. But when I promote 1st servers CARP interface down, 2nd server became MASTER immediately, no 4 seconds holdtime/timeout occurs. Why is it so? Any tips? Want to understand why 2nd server takes master state too often while 1st server are still available in network. From owner-freebsd-net@FreeBSD.ORG Mon Oct 25 18:33:30 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 088741065670; Mon, 25 Oct 2010 18:33:30 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D20608FC12; Mon, 25 Oct 2010 18:33:29 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9PIXTun062106; Mon, 25 Oct 2010 18:33:29 GMT (envelope-from yongari@freefall.freebsd.org) Received: (from yongari@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9PIXSZ2062102; Mon, 25 Oct 2010 18:33:28 GMT (envelope-from yongari) Date: Mon, 25 Oct 2010 18:33:28 GMT Message-Id: <201010251833.o9PIXSZ2062102@freefall.freebsd.org> To: freebsd@spam.t71.org, yongari@FreeBSD.org, freebsd-net@FreeBSD.org, yongari@FreeBSD.org From: yongari@FreeBSD.org Cc: Subject: Re: kern/147985: [alc] alc network driver + tso ( + vlan ? ) does not work. X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 18:33:30 -0000 Synopsis: [alc] alc network driver + tso ( + vlan ? ) does not work. State-Changed-From-To: open->feedback State-Changed-By: yongari State-Changed-When: Mon Oct 25 18:32:39 UTC 2010 State-Changed-Why: I can't reproduce this on my box with/without VLAN. I believe this is the first report that TSO issue on alc(4) and I have no idea how this can happen. The only vague guess I have at this moment is upper stack's TSO issue. r212803 fixed a TSO issue but it was not MFCed yet due to possible side-effects. http://svn.freebsd.org/viewvc/base/head/sys/netinet/tcp_output.c?r1=212765&r2=212803&view=patch Another thing to try is using alc(4) in stable/8. http://svn.freebsd.org/viewvc/base/stable/8/sys/dev/alc/if_alc.c http://svn.freebsd.org/viewvc/base/stable/8/sys/dev/alc/if_alcreg.h http://svn.freebsd.org/viewvc/base/stable/8/sys/dev/alc/if_alcvar.h I'm not sure whether it correctly builds on 8.1-RELEASE but mostly it would work. Responsible-Changed-From-To: freebsd-net->yongari Responsible-Changed-By: yongari Responsible-Changed-When: Mon Oct 25 18:32:39 UTC 2010 Responsible-Changed-Why: Grab. http://www.freebsd.org/cgi/query-pr.cgi?pr=147985 From owner-freebsd-net@FreeBSD.ORG Mon Oct 25 19:19:58 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 384EC10656C6; Mon, 25 Oct 2010 19:19:58 +0000 (UTC) (envelope-from yongari@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 28EA88FC26; Mon, 25 Oct 2010 19:19:58 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9PJJwEF003972; Mon, 25 Oct 2010 19:19:58 GMT (envelope-from yongari@freefall.freebsd.org) Received: (from yongari@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9PJJvEX003968; Mon, 25 Oct 2010 19:19:57 GMT (envelope-from yongari) Date: Mon, 25 Oct 2010 19:19:57 GMT Message-Id: <201010251919.o9PJJvEX003968@freefall.freebsd.org> To: junk@fromru.con, yongari@FreeBSD.org, freebsd-net@FreeBSD.org, yongari@FreeBSD.org From: yongari@FreeBSD.org Cc: Subject: Re: kern/150257: [msk] watchdog timeout X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 19:19:58 -0000 Synopsis: [msk] watchdog timeout State-Changed-From-To: open->feedback State-Changed-By: yongari State-Changed-When: Mon Oct 25 19:17:29 UTC 2010 State-Changed-Why: I also have a DGE-560T but I can't reproduce this issue on my box. Because you said disabling MSI fixed the issue I vaguely guess it could be a silicon bug which controller sometimes looses Tx completion interrupts or could be trggered by inappropriately programmed event timer for the controller. It seems Yukon II controllers are very sensitive to internal timer values so it can also trigger the issue. I don't have permanent solution for these issues but you can try the patch at the following URL. http://people.freebsd.org/~yongari/msk/msk.watchdog.diff It does not fix the issue but it will show watchdog timeout message and tries to recover from that ranther than completely resetting controller. If all goes ok, it sometimes shows watchdog timeouts but it wouldn't reset controller such that you can treat the watchdog timeouts as information message. Responsible-Changed-From-To: freebsd-net->yongari Responsible-Changed-By: yongari Responsible-Changed-When: Mon Oct 25 19:17:29 UTC 2010 Responsible-Changed-Why: Grab. http://www.freebsd.org/cgi/query-pr.cgi?pr=150257 From owner-freebsd-net@FreeBSD.ORG Tue Oct 26 02:13:57 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 912EF1065670 for ; Tue, 26 Oct 2010 02:13:57 +0000 (UTC) (envelope-from lnseshan@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 4D1808FC12 for ; Tue, 26 Oct 2010 02:13:56 +0000 (UTC) Received: by qwe4 with SMTP id 4so2076598qwe.13 for ; Mon, 25 Oct 2010 19:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=UISw1bzYxG6LTgnRF6zswZTfAggOThoAEjny2DH4yv4=; b=DqEQKhofyEaWD2G6YITmFIDJu3mdyMNffAG8jLKpyhPGm8o41L5ayuoRX2kPZBmLTl q+ewysbKYZbFCvKBty8VF2RDWcoILZRJBoMQJsw9fTIeyKv7j2udvydEF+v5NOj07dbz DCYZDYY+CuLXE+u761lyESSuuw6nDa9h2eRK0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=W9eoo5nST1SJJ8eWmERuG4Z3isLOakytuYwCRjCgNROY0CKmCL2Ns2Rd54fou2zqeU yJGYeQcURae3SKp/jpumm10IgrmbahS11NSvotS1ig7HvkHxs0ii35VrvpB51mvgKz/7 L6XgsgTWbz5aBkqU2cAlqYGOWERwAHx4tKg4M= MIME-Version: 1.0 Received: by 10.229.224.137 with SMTP id io9mr7058675qcb.206.1288057933412; Mon, 25 Oct 2010 18:52:13 -0700 (PDT) Received: by 10.229.182.9 with HTTP; Mon, 25 Oct 2010 18:52:13 -0700 (PDT) Date: Mon, 25 Oct 2010 21:52:13 -0400 Message-ID: From: Lakshmi Narasimhan seshan To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Query Regarding RFC 3517/RFC 4653 Implementation X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 02:13:57 -0000 Hi RFC 4653: I am looking for an Implementation of RFC 4653(Improving Robustness of TCP for Non Congestion Events) in FreeBSD and I figured from the to-do page http://wiki.freebsd.org/Networking that it is yet to be implemented. Is that true still?(as the page seems to have been updated an year ago). RFC 3517 : Again, Is this implemented as per the RFC or FreeBSD has its own version of SACK based Loss recovery for TCP? Reason that this question is raised being that the to-do list for FreeBSD/Networking says "Review FreeBSD TCP SACK implementation against RFC 3517's Conservative SACK Recovery Scheme" Expecting your inputs, S Lakshmi Narasimhan From owner-freebsd-net@FreeBSD.ORG Tue Oct 26 02:44:18 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 17556106566B; Tue, 26 Oct 2010 02:44:18 +0000 (UTC) (envelope-from lstewart@freebsd.org) Received: from lauren.room52.net (lauren.room52.net [210.50.193.198]) by mx1.freebsd.org (Postfix) with ESMTP id 99EEC8FC0A; Tue, 26 Oct 2010 02:44:17 +0000 (UTC) Received: from lstewart.caia.swin.edu.au (lstewart.caia.swin.edu.au [136.186.229.95]) by lauren.room52.net (Postfix) with ESMTPSA id 66BC87E87B; Tue, 26 Oct 2010 13:44:15 +1100 (EST) Message-ID: <4CC6407E.4040001@freebsd.org> Date: Tue, 26 Oct 2010 13:44:14 +1100 From: Lawrence Stewart User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.9) Gecko/20101004 Lightning/1.0b2 Thunderbird/3.1.4 MIME-Version: 1.0 To: Sriram Gorti References: <4CA5D1F0.3000307@freebsd.org> <4CA9B6AC.20403@freebsd.org> <4CBB6CE9.1030009@freebsd.org> <4CC2254C.7070104@freebsd.org> In-Reply-To: X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on lauren.room52.net Cc: freebsd-net@freebsd.org, Andre Oppermann Subject: Re: Question on TCP reassembly counter X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 02:44:18 -0000 On 10/25/10 17:40, Sriram Gorti wrote: > Hi, > > On Sat, Oct 23, 2010 at 5:29 AM, Lawrence Stewart wrote: >> On 10/22/10 18:10, Sriram Gorti wrote: >>> Hi, >>> >>> On Mon, Oct 18, 2010 at 3:08 AM, Lawrence Stewart wrote: >>> >>> Thanks for the fix. Tried it on XLR/XLS and the earlier tests pass >>> now. net.inet.tcp.reass.overflows was always zero after the tests (and >>> in the samples I took while the tests were running). >> >> Great, thanks for testing. >> >>> One observation though: net.inet.tcp.reass.cursegments was non-zero >>> (it was just 1) after 30 rounds, where each round is (as earlier) >>> 15-concurrent instances of netperf for 20s. This was on the netserver >>> side. And, it was zero before the netperf runs. On the other hand, >>> Andre told me (in a separate mail) that this counter is not relevant >>> anymore - so, should I just ignore it ? >> >> It's relevant, just not guaranteed to be 100% accurate at any given >> point in time. The value is calculated based on synchronised access to >> UMA zone stats and unsynchronised access to UMA per-cpu zone stats. The >> latter is safe, but causes the overall result to potentially be >> inaccurate due to use of stale data. The accuracy vs overhead tradeoff >> was deemed worthwhile for informational counters like this one. >> >> That being said, I would not expect the value to remain persistently at >> 1 after all TCP activity has finished on the machine. It won't affect >> performance, but I'm curious to know if the calculation method has a >> flaw. I'll try to reproduce locally, but can you please confirm if the >> value stays at 1 even after many minutes of no TCP activity? >> > > This behavior does repeat easily but finally it did. Even after > leaving the system alone (other than for background NFS messages) for > a few mins, the value persists. After a little more investigation, it > is observed that one of the spawned netserver's has not terminated and > when it is explicitly terminated, the sysctl of interest drops back to > zero. Does that mean the TCP reassembly portion is doing okay ? Yes, the fact that it drops to zero after killing the process indicates everything is as I expected wrt the accounting. Thanks for confirming. > But, it opens up the question of why the netserver has not terminated. > I will dig further into it but if you have any quick suggestions, they > are most welcome. Not sure I can answer that, but I'm very interested to know why a segment appears to become stuck in the reassembly queue. It seems unlikely that an actual segment is stuck, as the connection would eventually timeout if it was waiting for a retransmit that never came. It seems more probable that the process being wedged simply causes the net.inet.tcp.reass.cursegments sysctl to continue reporting a stale value, perhaps due to the per-cpu calculation continually using the same stale data whilst the process is running. Perhaps you could try reproduce whilst using siftr(4) to capture data at the same time. That will allow you to see for sure what the state of the reass queue is amongst other things and rule out a segment really being stuck in the queue. You could then also use perhaps procstat -kk on the wedged process and/or truss/ktrace to see what it's doing. Quick-start guide for siftr (man page has full details): kldload siftr sysctl net.inet.siftr.logfile=/somewhere/with/decent/space/siftr.log sysctl net.inet.siftr.enabled=1 sysctl net.inet.siftr.enabled=0 If it takes a few attempts to reproduce, delete the siftr log file in between each reproduction attempt so we end up with a log that only covers an actual example. I think it's the last column that logs the size of the reass queue. Filter log for the connection of interest (e.g. grep "," siftr.log | tail), and check what the reass queue size is when the last packet for that connection was sent/received. Let me know how you go. Cheers, Lawrence From owner-freebsd-net@FreeBSD.ORG Tue Oct 26 07:10:08 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B989E106566B for ; Tue, 26 Oct 2010 07:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A6FAE8FC08 for ; Tue, 26 Oct 2010 07:10:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9Q7A8gX045006 for ; Tue, 26 Oct 2010 07:10:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9Q7A8Js045005; Tue, 26 Oct 2010 07:10:08 GMT (envelope-from gnats) Date: Tue, 26 Oct 2010 07:10:08 GMT Message-Id: <201010260710.o9Q7A8Js045005@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: =?UTF-8?B?0KjQsNC80LDQvdC+0LIg0JDQu9C10LrRgdC10Lk=?= Cc: Subject: Re: kern/145777: [wpi] Intel 3945ABG driver breaks the connection after about 10 minutes of inactivity X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?UTF-8?B?0KjQsNC80LDQvdC+0LIg0JDQu9C10LrRgdC10Lk=?= List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 07:10:08 -0000 The following reply was made to PR kern/145777; it has been noted by GNATS. From: =?UTF-8?B?0KjQsNC80LDQvdC+0LIg0JDQu9C10LrRgdC10Lk=?= To: bug-followup@FreeBSD.org, marcin.nowak@simplusnet.pl Cc: Subject: Re: kern/145777: [wpi] Intel 3945ABG driver breaks the connection after about 10 minutes of inactivity Date: Tue, 26 Oct 2010 12:45:02 +0600 --0016368e1f24cc5d8004937f7287 Content-Type: text/plain; charset=UTF-8 Try to use ifconfig with '-powersave' option. --0016368e1f24cc5d8004937f7287 Content-Type: text/html; charset=UTF-8 Try to use ifconfig with '-powersave' option.
--0016368e1f24cc5d8004937f7287-- From owner-freebsd-net@FreeBSD.ORG Tue Oct 26 17:55:59 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21991106566B for ; Tue, 26 Oct 2010 17:55:59 +0000 (UTC) (envelope-from prt@prt.org) Received: from smtp5.uk.umis.net (smtp5.uk.umis.net [217.65.166.40]) by mx1.freebsd.org (Postfix) with ESMTP id DBC088FC1F for ; Tue, 26 Oct 2010 17:55:58 +0000 (UTC) Received: from [109.71.168.158] (helo=emma.local) by smtp5.uk.umis.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1PAnka-0002ZZ-9x for freebsd-net@freebsd.org; Tue, 26 Oct 2010 17:55:56 +0000 Message-ID: <4CC7162C.2020806@prt.org> Date: Tue, 26 Oct 2010 18:55:56 +0100 From: Paul Thornton User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 MIME-Version: 1.0 To: freebsd-net@freebsd.org References: <4CBE0042.4090905@prt.org> <4CBE0846.1090203@freebsd.org> <4CBEFB5A.80704@prt.org> <4CBF15ED.6080606@freebsd.org> In-Reply-To: <4CBF15ED.6080606@freebsd.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: Problems with 8.1, PPPoE server, and Cisco client X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 17:55:59 -0000 I've been taking another look at this after being dragged off onto other things for a few days, and hopefully have some more information that might help point in the right direction for a fix / where to debug next. On 20/10/2010 17:16, Julian Elischer wrote: > have you tried to connect this cisco router to anything else pppoe? > (take it home and make it connect to your ISP for example?) The Cisco client does work to a Cisco router acting as a PPPoE server - I used a 891 (client) to a 3945 (server) and using an established setup that is known to work, I collected a happy tcpdump. Of course that doesn't tell us why there was such an issue with the FreeBSD ppp server and it looks very similar to me. I'm also going to give mpd a go and see if that works - but if it tries the same config options as pppoed then I may be straight back to where I am now. Thanks to everyone for their help with this. So here is the dump from a known good setup, IOS at both ends - starting from the CHAP success point again. This time, both ends play the game and agree amongst themselves what they will and won't do as expected (many thanks to Ian here for the commentary as to what was going on in the exchanges I have): > 20:29:10.200860 PPPoE [ses 0x13] CHAP, Response (0x02), id 1, Value 8f917e3cd84fd4b3a5e8b705655bf16772d0cd1462392eed8bb4ab0ccb7f75bb2d01695ac26cdc07127b4fb3435a279a01, Name VT123456789@vdsl01.v > 20:29:14.501312 PPPoE [ses 0x13] CHAP, Success (0x03), id 1, Msg > 20:29:14.501702 PPPoE [ses 0x13] IPCP, Conf-Request (0x01), id 1, length 12 > encoded length 10 (=Option(s) length 6) > 0x0000: 8021 0101 000a > IP-Addr Option (0x03), length 6: 109.71.168.123 > 0x0000: 6d47 a87b > 20:29:14.504344 PPPoE [ses 0x13] IPCP, Conf-Request (0x01), id 1, length 12 > encoded length 10 (=Option(s) length 6) > 0x0000: 8021 0101 000a > IP-Addr Option (0x03), length 6: 0.0.0.0 > 0x0000: 0000 0000 > 20:29:14.504497 PPPoE [ses 0x13] unknown PPP protocol (0x8207) > 0x0000: 0101 0004 > 20:29:14.504669 PPPoE [ses 0x13] IPCP, Conf-Ack (0x02), id 1, length 12 > encoded length 10 (=Option(s) length 6) > 0x0000: 8021 0201 000a > IP-Addr Option (0x03), length 6: 109.71.168.123 > 0x0000: 6d47 a87b > 20:29:14.505200 PPPoE [ses 0x13] IPCP, Conf-Nack (0x03), id 1, length 12 > encoded length 10 (=Option(s) length 6) > 0x0000: 8021 0301 000a > IP-Addr Option (0x03), length 6: 109.71.174.50 > 0x0000: 6d47 ae32 > 20:29:14.505290 PPPoE [ses 0x13] LCP, Prot-Reject (0x08), id 2, length 12 > encoded length 10 (=Option(s) length 6) > 0x0000: c021 0802 000a > Rejected unknown Protocol (0x8207) > Rejected Packet > 0x0000: 0101 0006 0000 0000 > 20:29:14.505800 PPPoE [ses 0x13] IPCP, Conf-Request (0x01), id 2, length 12 > encoded length 10 (=Option(s) length 6) > 0x0000: 8021 0102 000a > IP-Addr Option (0x03), length 6: 109.71.174.50 > 0x0000: 6d47 ae32 > 20:29:14.506753 PPPoE [ses 0x13] IPCP, Conf-Ack (0x02), id 2, length 12 > encoded length 10 (=Option(s) length 6) > 0x0000: 8021 0202 000a > IP-Addr Option (0x03), length 6: 109.71.174.50 > 0x0000: 6d47 ae32 > 20:29:23.247975 PPPoE [ses 0x13] IP (tos 0x0, ttl 255, id 35, offset 0, flags [none], proto ICMP (1), length 100) > 109.71.174.50 > 217.65.161.4: ICMP echo request, id 10, seq 0, length 80 > 20:29:23.257872 PPPoE [ses 0x13] IP (tos 0x0, ttl 61, id 51771, offset 0, flags [none], proto ICMP (1), length 100) > 217.65.161.4 > 109.71.174.50: ICMP echo reply, id 10, seq 0, length 80 The ping here is the start of real data flowing - I used this setup for about 30 minutes of web browsing with no problems. Paul. From owner-freebsd-net@FreeBSD.ORG Tue Oct 26 18:03:38 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE814106566B for ; Tue, 26 Oct 2010 18:03:38 +0000 (UTC) (envelope-from cwf-ml@arcor.de) Received: from mail-in-03.arcor-online.net (mail-in-03.arcor-online.net [151.189.21.43]) by mx1.freebsd.org (Postfix) with ESMTP id 94D378FC18 for ; Tue, 26 Oct 2010 18:03:38 +0000 (UTC) Received: from mail-in-21-z2.arcor-online.net (unknown [151.189.8.185]) by mx.arcor.de (Postfix) with ESMTP id 05EF4D7FF1 for ; Tue, 26 Oct 2010 19:30:21 +0200 (CEST) Received: from mail-in-15.arcor-online.net (mail-in-15.arcor-online.net [151.189.21.55]) by mail-in-21-z2.arcor-online.net (Postfix) with ESMTP id E409EEDB4E for ; Tue, 26 Oct 2010 19:30:20 +0200 (CEST) Received: from [145.253.194.41] (cassandra.tnd.lab.arcor.de [145.253.194.41]) (Authenticated sender: wefa@arcor.de) by mail-in-15.arcor-online.net (Postfix) with ESMTPA id CB3871ABAE9 for ; Tue, 26 Oct 2010 19:30:20 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-15.arcor-online.net CB3871ABAE9 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1288114220; bh=pbtvNSJPhDEMuGMX30YLMG2MX551QGaRiLjETpbm0RA=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=J5RMtCbHtvVefnRA2zrdH6rjC/UPL/Un2oO8tcv47X3VVxUFSTLaq4s743fCiOwfx +cz6eHfWYC599T2BYrC73bH+C1Hr3IvuS7p9l4w5YeADeDL01ULVbIJAIylBIJITBw YV9fA1FfEAcnsMU3+mRRZmbhxI57F+BLOjfOn8G4= Message-ID: <4CC7102B.5080209@arcor.de> Date: Tue, 26 Oct 2010 19:30:19 +0200 From: Christoph Weber-Fahr User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 MIME-Version: 1.0 To: freebsd-net@freebsd.org References: <4CAD71A8.4080602@eis.ru> In-Reply-To: <4CAD71A8.4080602@eis.ru> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: driver for broadcom 57711E X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 18:03:38 -0000 Hello, On 07.10.2010 09:07, Дмитрий ÐлекÑандров wrote: > Hi! I really need broadcom 57711E driver for my FreeBSD 8.0 i386. > Does anybody have this driver already? > > P.S. Also wanted David Christensen who had previously tried to write a driver. LOL. Welcome to the club :-) ( Though I'm afraid David, or Broadcomm, respectively, are incommunicado on this particular issue. ) Let us know if you hear something different. Regards Christoph Weber-Fahr From owner-freebsd-net@FreeBSD.ORG Tue Oct 26 18:22:58 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D7C75106564A for ; Tue, 26 Oct 2010 18:22:58 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-gy0-f182.google.com (mail-gy0-f182.google.com [209.85.160.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7775A8FC13 for ; Tue, 26 Oct 2010 18:22:58 +0000 (UTC) Received: by gya6 with SMTP id 6so3207796gya.13 for ; Tue, 26 Oct 2010 11:22:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=lS7PSprHP8CRjtFx+SuM88RaZYJX0oXJtAnozXXWGh0=; b=F2HCjYp02nc4tLE0822W/Qphvx/HyDNdMUvsvhSEFoz6Hr3/nkQ/VPKY8BvtaFKJIx 425wkkkKZPMwQGvYnUUcCnJpqGABsZXzO8PSUm+tAQwWx+J1AupYEEgcbH/+QpaYPYi6 QpdTLKoUT9CnAPKaDyJz3fQ1GWhtkHXm/9L4Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=qC+gqKj78+RAYkhhq/k5fPBR/hiOiW/FxgzVHGFIqw/CrM+mEPoLS/GY8xMFOVhegY MG224xuOtdMky6uNP3yhEWtmSPin8qfwpphqHcvd/4ogtv2WN5fDJTI0IjZG0sGCmQHa NdM/RM6s/yLAP5yf8KEhEM+i6JeQw9Aembxlk= Received: by 10.151.100.20 with SMTP id c20mr11475695ybm.227.1288117377318; Tue, 26 Oct 2010 11:22:57 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id v39sm4117797yba.19.2010.10.26.11.22.54 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 26 Oct 2010 11:22:55 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Tue, 26 Oct 2010 11:21:21 -0700 From: Pyun YongHyeon Date: Tue, 26 Oct 2010 11:21:21 -0700 To: Christoph Weber-Fahr Message-ID: <20101026182121.GD5627@michelle.cdnetworks.com> References: <4CAD71A8.4080602@eis.ru> <4CC7102B.5080209@arcor.de> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4CC7102B.5080209@arcor.de> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org, David Christensen Subject: Re: driver for broadcom 57711E X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 18:22:58 -0000 On Tue, Oct 26, 2010 at 07:30:19PM +0200, Christoph Weber-Fahr wrote: > Hello, > > On 07.10.2010 09:07, Дмитрий ÐлекÑандров wrote: > > Hi! I really need broadcom 57711E driver for my FreeBSD 8.0 i386. > > Does anybody have this driver already? > > > > P.S. Also wanted David Christensen who had previously tried to write a driver. > > LOL. Welcome to the club :-) > > ( Though I'm afraid David, or Broadcomm, respectively, are incommunicado > on this particular issue. ) > > Let us know if you hear something different. > Actually David is very responsive but I think he is somewhat busy for other work. For example, I had been working with David to support next generation Broadcom controller that would be widely available in next year. Personally I haven't have chance to try bnx(4) which was written by David to support BCM57710/57711/57711E controllers so I don't know how well it works. As David said long time ago, one of issue was testing wide variety of PHYs used in controller such that it made hard to release the driver. David, would you clarify current status of bnx(4)? From owner-freebsd-net@FreeBSD.ORG Tue Oct 26 18:41:41 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6E86F106564A; Tue, 26 Oct 2010 18:41:41 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 0091E8FC17; Tue, 26 Oct 2010 18:41:40 +0000 (UTC) Received: by qyk7 with SMTP id 7so2730994qyk.13 for ; Tue, 26 Oct 2010 11:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=rAxolNoCQc0Mofx1HQczlyG926yRGTkDSjbTNe6WGBg=; b=x35+IR48tYNgTETQWZQaQQIdnujRFS+mHrA6ZIQuuytj0rUbjIj1taj+PMe0d6ApnG lunwj1Hq2h06+qtZSEqCH09CtqYoZJX2M9ohJa+sSxWqBN/8S646xHMMnAMDhZ87Et7e HubIpILQ3ogf3r+ZaCJlwxxMF6kDOmLoMWcz0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:content-transfer-encoding :in-reply-to:user-agent; b=RWAUHr0pMLxxRZL2ZFwaNcARASGTDNkla2I6N2v+LUfSQ0+KOG7uN+Cm2IxPIOta/Q Z4lbcZNbiW1sfhHjarj2V9xwuFTGlkejyPjY/Z7D8ifXu6HfiRNjk22Fo+uiokFwGH6H yao+CG6vRWhlmXQ+OMTSOLz/GY3F3tBPjkfV8= Received: by 10.229.184.198 with SMTP id cl6mr8092063qcb.240.1288118500049; Tue, 26 Oct 2010 11:41:40 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id t35sm7643358qco.42.2010.10.26.11.41.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 26 Oct 2010 11:41:38 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Tue, 26 Oct 2010 11:40:02 -0700 From: Pyun YongHyeon Date: Tue, 26 Oct 2010 11:40:02 -0700 To: Christoph Weber-Fahr Message-ID: <20101026184002.GF5627@michelle.cdnetworks.com> References: <4CAD71A8.4080602@eis.ru> <4CC7102B.5080209@arcor.de> <20101026182121.GD5627@michelle.cdnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20101026182121.GD5627@michelle.cdnetworks.com> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org, David Christensen Subject: Re: driver for broadcom 57711E X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Oct 2010 18:41:41 -0000 On Tue, Oct 26, 2010 at 11:21:21AM -0700, Pyun YongHyeon wrote: > On Tue, Oct 26, 2010 at 07:30:19PM +0200, Christoph Weber-Fahr wrote: > > Hello, > > > > On 07.10.2010 09:07, Дмитрий ÐлекÑандров wrote: > > > Hi! I really need broadcom 57711E driver for my FreeBSD 8.0 i386. > > > Does anybody have this driver already? > > > > > > P.S. Also wanted David Christensen who had previously tried to write a driver. > > > > LOL. Welcome to the club :-) > > > > ( Though I'm afraid David, or Broadcomm, respectively, are incommunicado > > on this particular issue. ) > > > > Let us know if you hear something different. > > > > Actually David is very responsive but I think he is somewhat busy > for other work. For example, I had been working with David to > support next generation Broadcom controller that would be widely > available in next year. > Personally I haven't have chance to try bnx(4) which was written > by David to support BCM57710/57711/57711E controllers so I don't > know how well it works. As David said long time ago, one of issue > was testing wide variety of PHYs used in controller such that it > made hard to release the driver. > David, would you clarify current status of bnx(4)? Actually the driver name was bxe(4). From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 00:04:38 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DD0FE106566B for ; Wed, 27 Oct 2010 00:04:38 +0000 (UTC) (envelope-from dave.evans55@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5F68F8FC21 for ; Wed, 27 Oct 2010 00:04:37 +0000 (UTC) Received: by bwz3 with SMTP id 3so78328bwz.13 for ; Tue, 26 Oct 2010 17:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:x-enigmail-version:content-type :content-transfer-encoding; bh=Jg3j6At2uzXiE1jjgSQwAW0nuYRjTWUfgQsHoxqGsTM=; b=D1tIcbm2ONmdX6SWILytET8G72diAd63H3BN9gItYwZEWkah9NyXzCc/DudnfFFXM8 5wkBJdyDlMvBw8xVHdbNcJVg/OcsHmeiTY5MIWGYGz6CFALRuh4qEgZu6S3FgcL+coHg M/L9dnK+Ed//iLmFs5YEzjIebqRWloo5UzAoE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; b=N/R4mSVj1NgEkR7891Ax0gVMGYkiR0C/T5ka54Uqk9jNaxT+8vSrbqN4IuuIeyc8jJ kzJ7IDx97y0KhuC4PA6ycZD9vpkKBZXY7Cn8RRbqNqtVPIVzqBRg/jWMnQnKd+s83sHW diMCCBKq1RLu9+xWAIaO4D1p/8jjjYF0z1sI0= Received: by 10.204.118.12 with SMTP id t12mr6688094bkq.179.1288136190247; Tue, 26 Oct 2010 16:36:30 -0700 (PDT) Received: from two.pearl (dsl-fixed-77-44-81-131.interdsl.co.uk [77.44.81.131]) by mx.google.com with ESMTPS id r21sm6418841bkj.22.2010.10.26.16.36.28 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 26 Oct 2010 16:36:29 -0700 (PDT) Message-ID: <4CC765FA.20202@googlemail.com> Date: Wed, 27 Oct 2010 00:36:26 +0100 From: David Evans User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.11) Gecko/20101013 Lightning/1.0b2 Thunderbird/3.1.5 MIME-Version: 1.0 To: FreeBSD Net X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Bridge problems, possibly due to proxy arp on Parallels Desktop X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 00:04:38 -0000 Summary To make a ping from a OpenVPN client using TAP work, I have to set the bridge interface manually using "ifconfig bridge0 static tap0 " on the server. My setup Host 3dosexp IP 192.168.0.220 on tap0 FreeBSD 8.1, OpenVPN client using tap0 interface This is a Virtual Machine on Parallels Desktop 6.0 for Mac OS X It has one virtual NIC which is on Desktop host-only network which is used for the the encrypted channel for OpenVPN Host Eight IP 192.168.0.8 on bridge0. FreeBSD 8.1, OpenVPN server using bridged networking. This is another VM on Desktop. It has one virtual NIC on host-only networking which is used for the other end of the OpenVPN link. It has another NIC on Desktop bridged networking (not the same as OpenVPN) with IP 192.168.0.8 on interface em0 Host Two IP 192.168.0.2 on en1 Mac OS X 10.6 This is a real machine. Interface en1 is bridged by Desktop en1 is a wifi interface. It connects to:- Router One IP 192.168.0.1 Netgear DG834G wireless and 4-port router. Host 3dos IP 192.168.0.250 on vr0 PC running FreeBSD 8.1 i386 Connected via cable to the router. It is destined to become a VPN server in a small office when the networking starts working. ---------- Problem One Pinging from Host 3dosexp to Host Two does not work. Running "ifconfig bridge0 addr" on host Eight to see what interfaces are used for which ethernet address shows that all interfaces are set to em0. Setting a static interface to tap0 for the ethernet address assigned to tap0 on host 3dosexp makes the ping work. ( using "ifconfig bridge0 static tap0 <3dosexp-ethernet-address>" ) Running "ifconfig bridge0 flushall" on host Eight stops the ping working. "ifconfig bridge0 addr" shows the ethernet address for host 3dosexp is now set back to interface em0. ---------- Problem two Run the command for setting the static interface as described in problem one. Trying a ping from host 3dosexp (VPN client) to host 3dos ( attached to the router) does not work. Ping responds with "ping: sendto: Host is down" On host Eight (the VPN server) running tcpdump on interface em0 shows that there are arp requests "Who has 192.168.0.250 tell 192.168.0.220" and arp replies from host 192.168.0.250. The destination of the arp replies is the ethernet address of interface em0. The replies never get through the bridge and out onto interface tap0. That's almost true, but sometimes something seems to flip and ping starts sending ICMP echo requests. Again, looking at the interfaces with tcpdump shows ICMP requests and replies on interface em0. The replies have an ethernet destination of the ethernet address of em0. Surely they should be destined for host 3dosexp (the client). The replies do not make it through the bridge. I suspect at the moment that this is something to do with Desktop bridged networking using Proxy ARP between the virtual and real networks. ------------ ifconfig for host Eight (the VPN server) em0: flags=8943 metric 0 mtu 1500 options=98 ether 00:1c:42:01:3f:6c media: Ethernet autoselect (1000baseT ) status: active em1: flags=8843 metric 0 mtu 1500 options=9b ether 00:1c:42:f2:f0:b0 inet 10.37.129.3 netmask 0xffffff00 broadcast 10.37.129.255 media: Ethernet autoselect (1000baseT ) status: active lo0: flags=8049 metric 0 mtu 16384 options=3 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 inet6 ::1 prefixlen 128 inet 127.0.0.1 netmask 0xff000000 nd6 options=3 tap0: flags=8943 metric 0 mtu 1500 options=80000 ether 00:bd:75:26:00:00 Opened by PID 1391 bridge0: flags=8843 metric 0 mtu 1500 ether 6e:67:0a:b1:17:91 inet 192.168.0.8 netmask 0xffffff00 broadcast 192.168.0.255 id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15 maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200 root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0 member: tap0 flags=143 ifmaxaddr 0 port 4 priority 128 path cost 2000000 member: em0 flags=143 ifmaxaddr 0 port 1 priority 128 path cost 20000 --------- bridge startup script (immediately after reboot has finished) #!/bin/sh ifconfig tap0 down ifconfig bridge0 down ifconfig bridge0 destroy ifconfig tap0 destroy ifconfig tap0 create ifconfig tap0 up ifconfig em0 up ifconfig bridge0 create ifconfig bridge0 addm em0 addm tap0 up ifconfig bridge0 inet 192.168.0.8 netmask 255.255.255.0 --------- routing tables Internet: Destination Gateway Flags Refs Use Netif Expire 10.37.129.0/24 link#2 U 1 165 em1 10.37.129.3 link#2 UHS 0 0 lo0 127.0.0.1 link#3 UH 0 0 lo0 192.168.0.0/24 link#5 U 0 49 bridge 192.168.0.8 link#5 UHS 0 0 lo0 From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 01:48:33 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9256A106566B for ; Wed, 27 Oct 2010 01:48:33 +0000 (UTC) (envelope-from davidch@broadcom.com) Received: from mms1.broadcom.com (mms1.broadcom.com [216.31.210.17]) by mx1.freebsd.org (Postfix) with ESMTP id 663EF8FC08 for ; Wed, 27 Oct 2010 01:48:33 +0000 (UTC) Received: from [10.9.200.131] by mms1.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Tue, 26 Oct 2010 18:41:21 -0700 X-Server-Uuid: 02CED230-5797-4B57-9875-D5D2FEE4708A Received: from IRVEXCHCCR01.corp.ad.broadcom.com ([10.252.49.30]) by IRVEXCHHUB01.corp.ad.broadcom.com ([10.9.200.131]) with mapi; Tue, 26 Oct 2010 18:41:21 -0700 From: "David Christensen" To: "pyunyh@gmail.com" , "Christoph Weber-Fahr" Date: Tue, 26 Oct 2010 18:41:20 -0700 Thread-Topic: driver for broadcom 57711E Thread-Index: Act1Pm+MUFP8SLu+Sami1H80AaxIjwAOL+Kg Message-ID: <5D267A3F22FD854F8F48B3D2B523819360764ED6E9@IRVEXCHCCR01.corp.ad.broadcom.com> References: <4CAD71A8.4080602@eis.ru> <4CC7102B.5080209@arcor.de> <20101026182121.GD5627@michelle.cdnetworks.com> <20101026184002.GF5627@michelle.cdnetworks.com> In-Reply-To: <20101026184002.GF5627@michelle.cdnetworks.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-WSS-ID: 60D95CCB47837787000-01-01 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: base64 Cc: "freebsd-net@freebsd.org" , Gary Zambrano , David Christensen Subject: RE: driver for broadcom 57711E X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 01:48:33 -0000 PiA+ID4gPiAgSGkhIEkgcmVhbGx5IG5lZWQgYnJvYWRjb20gNTc3MTFFIGRyaXZlciBmb3IgbXkg RnJlZUJTRCA4LjANCj4gaTM4Ni4NCj4gPiA+ID4gRG9lcyBhbnlib2R5IGhhdmUgdGhpcyBkcml2 ZXIgYWxyZWFkeT8NCj4gPiA+ID4NCj4gPiA+ID4gUC5TLiBBbHNvIHdhbnRlZCBEYXZpZCBDaHJp c3RlbnNlbiB3aG8gaGFkIHByZXZpb3VzbHkgdHJpZWQgdG8NCj4gd3JpdGUgYSBkcml2ZXIuDQo+ ID4gPg0KPiA+ID4gTE9MLiBXZWxjb21lIHRvIHRoZSBjbHViIDotKQ0KPiA+ID4NCj4gPiA+ICgg VGhvdWdoIEknbSBhZnJhaWQgRGF2aWQsIG9yIEJyb2FkY29tbSwgcmVzcGVjdGl2ZWx5LCBhcmUN Cj4gaW5jb21tdW5pY2Fkbw0KPiA+ID4gb24gdGhpcyBwYXJ0aWN1bGFyIGlzc3VlLiApDQo+ID4g Pg0KPiA+IEFjdHVhbGx5IERhdmlkIGlzIHZlcnkgcmVzcG9uc2l2ZSBidXQgSSB0aGluayBoZSBp cyBzb21ld2hhdCBidXN5DQo+ID4gZm9yIG90aGVyIHdvcmsuIEZvciBleGFtcGxlLCBJIGhhZCBi ZWVuIHdvcmtpbmcgd2l0aCBEYXZpZCB0bw0KPiA+IHN1cHBvcnQgbmV4dCBnZW5lcmF0aW9uIEJy b2FkY29tIGNvbnRyb2xsZXIgdGhhdCB3b3VsZCBiZSB3aWRlbHkNCj4gPiBhdmFpbGFibGUgaW4g bmV4dCB5ZWFyLg0KPiA+IFBlcnNvbmFsbHkgSSBoYXZlbid0IGhhdmUgY2hhbmNlIHRvIHRyeSBi bngoNCkgd2hpY2ggd2FzIHdyaXR0ZW4NCj4gPiBieSBEYXZpZCB0byBzdXBwb3J0IEJDTTU3NzEw LzU3NzExLzU3NzExRSBjb250cm9sbGVycyBzbyBJIGRvbid0DQo+ID4ga25vdyBob3cgd2VsbCBp dCB3b3Jrcy4gQXMgRGF2aWQgc2FpZCBsb25nIHRpbWUgYWdvLCBvbmUgb2YgaXNzdWUNCj4gPiB3 YXMgdGVzdGluZyB3aWRlIHZhcmlldHkgb2YgUEhZcyB1c2VkIGluIGNvbnRyb2xsZXIgc3VjaCB0 aGF0IGl0DQo+ID4gbWFkZSBoYXJkIHRvIHJlbGVhc2UgdGhlIGRyaXZlci4NCj4gPiBEYXZpZCwg d291bGQgeW91IGNsYXJpZnkgY3VycmVudCBzdGF0dXMgb2YgYm54KDQpPw0KPiANCj4gQWN0dWFs bHkgdGhlIGRyaXZlciBuYW1lIHdhcyBieGUoNCkuDQoNClNvcnJ5IGZvciB0aGUgZGVsYXlzIG9u IGtlZXBpbmcgdGhlIGNvbW11bml0eSB1cGRhdGVkIG9uIHRoZQ0Kc3RhdHVzIG9mIHRoZSBieGUo NCkgZHJpdmVyLiAgSWYgc29tZW9uZSBpcyB3aWxsaW5nIHRvIHJldmlldw0KdGhlIGRyaXZlciBh bmQgaGVscCB1cyBhZGRyZXNzIHNvbWUgb2YgdGhlIHN0eWxlKDkpIHZpb2xhdGlvbnMNCmluIHRo ZSBzb3VyY2UgY29kZSwgSSdsbCBjb21taXQgdGhlIGNvZGUgd2l0aGluIHR3byB3ZWVrcy4NCg0K UGxlYXNlIGVtYWlsIG1lIG9mZi1saXN0IGlmIHlvdSdyZSBhYmxlIHRvIGhlbHAuDQoNCkRhdmUN Cg== From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 08:18:17 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32553106564A; Wed, 27 Oct 2010 08:18:17 +0000 (UTC) (envelope-from antoniok.spb@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 9ADCF8FC08; Wed, 27 Oct 2010 08:18:16 +0000 (UTC) Received: by wwb24 with SMTP id 24so378766wwb.31 for ; Wed, 27 Oct 2010 01:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:content-type; bh=b8bSEKRO6qih4JWT0D542kzi7+3UxwZbTqaEf0AW6BI=; b=LISHiBN3dkXevsARMn26qV10xqZKbMy2soFvx8njAnix8794uDMSobRaG0Kc0rtCPC HoB8Xl+p2Ztvn1g4ZbG+r+qG1GluicXY31pTT991kSfqk8zYHZBilcAOkwvcpDD19HuU 0BNeUdUl8TiovBwAV2iO+IGQVjGPJMqAk7onI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=QWwyZHqrniDrWSma5u1pRPawrwXif9lQo9V1X27cRWoIuqeRZxQXn9+1cnsr4qesn8 7RL0XZNbt+tvwABPY0zU/9fFvQ6wWgk4wSXUXEbef1Y7DCt6E9p1FZV/iLu6uBzaU/+T MLAtVGh/8GljpvGAP08gX3DkOfBej/xg9X4PU= Received: by 10.216.67.13 with SMTP id i13mr409056wed.95.1288165807478; Wed, 27 Oct 2010 00:50:07 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.20.80 with HTTP; Wed, 27 Oct 2010 00:49:47 -0700 (PDT) From: Antonio Kless Date: Wed, 27 Oct 2010 11:49:47 +0400 Message-ID: To: FreeBSD Questions , freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: FreeBSD analog of net.ipv4.tcp_fin_timeout X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 08:18:17 -0000 There is *net.ipv4.tcp_fin_timeout* in Linux sysctl. It set up timeout of TCP connection to stay in FIN_WAIT2 state. Is there something like that in FreeBSD? -- Best regards, Antonio Kless, http://kless.spb.ru/ From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 09:45:43 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 360E7106566C for ; Wed, 27 Oct 2010 09:45:43 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id D9E938FC08 for ; Wed, 27 Oct 2010 09:45:42 +0000 (UTC) Received: from mdounin.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mdounin.cust.ramtel.ru (Postfix) with ESMTP id 499641702F; Wed, 27 Oct 2010 13:45:41 +0400 (MSD) Date: Wed, 27 Oct 2010 13:45:41 +0400 From: Maxim Dounin To: Antonio Kless Message-ID: <20101027094540.GM44164@mdounin.ru> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-net@freebsd.org, FreeBSD Questions Subject: Re: FreeBSD analog of net.ipv4.tcp_fin_timeout X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 09:45:43 -0000 Hello! On Wed, Oct 27, 2010 at 11:49:47AM +0400, Antonio Kless wrote: > There is *net.ipv4.tcp_fin_timeout* in Linux sysctl. It set up timeout of > TCP connection to stay in FIN_WAIT2 state. Is there something like that in > FreeBSD? net.inet.tcp.fast_finwait2_recycle=1 net.inet.tcp.finwait2_timeout=30000 Maxim Dounin From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 10:49:23 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4964B106564A; Wed, 27 Oct 2010 10:49:23 +0000 (UTC) (envelope-from antoniok.spb@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id AC6A88FC13; Wed, 27 Oct 2010 10:49:22 +0000 (UTC) Received: by wyb42 with SMTP id 42so534046wyb.13 for ; Wed, 27 Oct 2010 03:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type; bh=gEKliRsRdIoa/JiVkXymmPNOk7hCoSspQn4+z4fQtLg=; b=ki66wXRqsw/McKWEJtUQXrnUY0qWBYnQ+hsh6E81sEOltSlsGwVDIkKSUAVgkfwT6J tkPDpwe50Yi7ajwboOlfXDfqbN7GFyg0iHRqYComdlEtoherXed+do7Ojuarto5titYZ VsOcM0E5aV+61U1X7tfxv6ZshV00TwxuuFPag= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; b=CFo4/Xy8ysjBHT/fvh43bsweGkQx1pSKznO5ttAjCSzsxrKZa/A7fI6kTyHNXaHBsD 4VWrFLvV00dd5Yw3Gj27DsnVanZNUiqL5rubWlH9uvAlfxfU8veTbWvJ6o658TcmY4WW JY/adGvKOI/+5zjfI4RIcd3rlNMk8Qbx41Qvg= Received: by 10.216.153.140 with SMTP id f12mr616331wek.111.1288176561587; Wed, 27 Oct 2010 03:49:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.20.80 with HTTP; Wed, 27 Oct 2010 03:49:01 -0700 (PDT) In-Reply-To: <20101027094540.GM44164@mdounin.ru> References: <20101027094540.GM44164@mdounin.ru> From: Antonio Kless Date: Wed, 27 Oct 2010 14:49:01 +0400 Message-ID: To: Maxim Dounin Content-Type: text/plain; charset=KOI8-R X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org, FreeBSD Questions Subject: Re: FreeBSD analog of net.ipv4.tcp_fin_timeout X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 10:49:23 -0000 *net.inet.tcp.finwait2_timeout* is what I search for, thank you! What is net.inet.tcp.fast_finwait2_recycle=1 ? 2010/10/27 Maxim Dounin > Hello! > > On Wed, Oct 27, 2010 at 11:49:47AM +0400, Antonio Kless wrote: > > > There is *net.ipv4.tcp_fin_timeout* in Linux sysctl. It set up timeout of > > TCP connection to stay in FIN_WAIT2 state. Is there something like that > in > > FreeBSD? > > net.inet.tcp.fast_finwait2_recycle=1 > net.inet.tcp.finwait2_timeout=30000 > > Maxim Dounin > -- Best regards, Antonio Kless, http://kless.spb.ru/ From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 11:22:01 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5E3121065670 for ; Wed, 27 Oct 2010 11:22:01 +0000 (UTC) (envelope-from b.smeelen@ose.nl) Received: from mail.ose.nl (mail.ose.nl [212.178.134.164]) by mx1.freebsd.org (Postfix) with ESMTP id F057B8FC19 for ; Wed, 27 Oct 2010 11:22:00 +0000 (UTC) Received: from localhost ([127.0.0.1]) by mail.ose.nl; Wed, 27 Oct 2010 13:11:54 +0200 Message-ID: <4CC808FA.8020808@ose.nl> Date: Wed, 27 Oct 2010 13:11:54 +0200 From: Bas Smeelen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.14) Gecko/20101006 Thunderbird/3.0.9 MIME-Version: 1.0 To: Antonio Kless References: <20101027094540.GM44164@mdounin.ru> In-Reply-To: Content-Type: text/plain; charset="KOI8-R" Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org, FreeBSD Questions , Maxim Dounin Subject: Re: FreeBSD analog of net.ipv4.tcp_fin_timeout X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 11:22:01 -0000 On 10/27/2010 12=3A49 PM=2C Antonio Kless wrote=3A =3E *net=2Einet=2Etcp=2Efinwait2=5Ftimeout* is what I search for=2C thank y= ou! =3E =3E =3E What is net=2Einet=2Etcp=2Efast=5Ffinwait2=5Frecycle=3D1 =3F =3E =20 Please do *not* toppost =3A=29 man 4 tcp fast=5Ffinwait2=5Frecycle Recycle TCP FIN=5FWAIT=5F2 connections faster when= the socket is marked as SBS=5FCANTRCVMORE =28no user pr= ocess has the socket open=2C data received on the socket= can- not be read=29=2E The timeout used here is finwait2=5Ftimeout=2E =3E 2010/10/27 Maxim Dounin =3Cmdounin=40mdounin=2Eru=3E =3E =3E =20 =3E=3E Hello! =3E=3E =3E=3E On Wed=2C Oct 27=2C 2010 at 11=3A49=3A47AM +0400=2C Antonio Kless wr= ote=3A =3E=3E =3E=3E =20 =3E=3E=3E There is *net=2Eipv4=2Etcp=5Ffin=5Ftimeout* in Linux sysctl=2E It= set up timeout of =3E=3E=3E TCP connection to stay in FIN=5FWAIT2 state=2E Is there something= like that =3E=3E=3E =20 =3E=3E in =3E=3E =20 =3E=3E=3E FreeBSD=3F =3E=3E=3E =20 =3E=3E net=2Einet=2Etcp=2Efast=5Ffinwait2=5Frecycle=3D1 =3E=3E net=2Einet=2Etcp=2Efinwait2=5Ftimeout=3D30000 =3E=3E =3E=3E Maxim Dounin =3E=3E =20 DISCLAIMER=3A This e-mail is for the intended recipient=28s=29 only=2E Acce= ss=2C disclosure=2C copying=2C distribution or reliance on any of it by anyone else is prohibited=2E If yo= u have received it by mistake please let us know by reply and then delete it from your system= =2E From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 11:46:05 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9661E1065672 for ; Wed, 27 Oct 2010 11:46:05 +0000 (UTC) (envelope-from marius@nuenneri.ch) Received: from mail-qy0-f182.google.com (mail-qy0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2668FC16 for ; Wed, 27 Oct 2010 11:46:05 +0000 (UTC) Received: by qyk33 with SMTP id 33so609816qyk.13 for ; Wed, 27 Oct 2010 04:46:04 -0700 (PDT) Received: by 10.229.184.68 with SMTP id cj4mr8838256qcb.48.1288178342480; Wed, 27 Oct 2010 04:19:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.221.7 with HTTP; Wed, 27 Oct 2010 04:18:42 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?Q?Marius_N=C3=BCnnerich?= Date: Wed, 27 Oct 2010 13:18:42 +0200 Message-ID: To: dave jones Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-net@freebsd.org Subject: Re: UDP socket disconnect problem X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 11:46:05 -0000 On Tue, Sep 28, 2010 at 11:58, dave jones wrote: > Hello, > > In Linux, I can disconnect the socket using: > sa.sin_family =3D AF_UNSPEC; > val =3D connect(sockfd, (struct sockaddr *)&sa, sizeof(sa)); > > the return value of val is 0; on freebsd, the return value of connect() i= s -1. > According to Linux's connect(2) man page: > > Connectionless sockets may dissolve > the association by connecting to an address with the =C2=A0sa_family =C2= =A0member > of sockaddr set to AF_UNSPEC > > but FreeBSD's connect says: > Datagram sockets may dissolve the association by connecting > =C2=A0to an invalid address, such as a null address. > > I try to convert above code to > memset(&sa, 0, sizeof(sa)); > sa.sin_addr.s_addr =3D htonl(INADDR_ANY); > val =3D connect(sockfd, (struct sockaddr *)&sa, sizeof(sa)); > > the return value of val still -1. Any idea? Thanks. Just curious, why are you not using close()? From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 13:37:11 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E6D561065670 for ; Wed, 27 Oct 2010 13:37:11 +0000 (UTC) (envelope-from dave.evans55@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5DD158FC13 for ; Wed, 27 Oct 2010 13:37:10 +0000 (UTC) Received: by bwz3 with SMTP id 3so559659bwz.13 for ; Wed, 27 Oct 2010 06:37:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:x-enigmail-version:content-type :content-transfer-encoding; bh=MIO6L6Ce7Y6hOzKeHooq8O34ETXqGRc6ZIfUswBEDs4=; b=tDQmO+cQb1QJf6v1jbuue6DUg7mNvfcC/HQuw77oHmODVFUtVMliNpXFJuhG1K/4pp nm4PgRuEWIhL1/4JfxKldIVhMkQ8lBVbQ12niJcqts3OpdEH6CfZou++YExRol4813Td 9vvfLCv9iIRGhL5mPxinht/T440FigHNg/cEU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; b=J7lPbFQJgXF99kdHkSpwNThGqyD1zv7OnbKiHHvi1V31XWRyXQhvEug98X8JRS+JTK KHtx50pltkxXl5h7QElei+bi9+/Ku4iUGCndajKtiA2Xaz5PnCHGF1VJcDEU7pEg5YYo IwjO64TxZLznzRZKsPIq//1O1ki5HRIseCDRE= Received: by 10.204.76.130 with SMTP id c2mr6148646bkk.26.1288186629147; Wed, 27 Oct 2010 06:37:09 -0700 (PDT) Received: from two.pearl (dsl-fixed-77-44-81-131.interdsl.co.uk [77.44.81.131]) by mx.google.com with ESMTPS id 4sm6979035bki.1.2010.10.27.06.37.06 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 27 Oct 2010 06:37:07 -0700 (PDT) Message-ID: <4CC82B01.5030404@googlemail.com> Date: Wed, 27 Oct 2010 14:37:05 +0100 From: David Evans User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.11) Gecko/20101013 Lightning/1.0b2 Thunderbird/3.1.5 MIME-Version: 1.0 To: FreeBSD Net X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: Bridge problems, possibly due to proxy arp on Parallels Desktop X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 13:37:12 -0000 [ posted to freebsd-net@freebsd.org 2010-10-27 ] More weirdness. Pinging from 192.168.0.2 (Mac OS X) to 192.168.0.220 (VPN client) and monitoring em0 on 192.168.0.8 (the VPN server bridge), I find that each ping request generates two ICMP echo replies to two different ethernet addresses. Here is the tcpdump: ------ Script started on Wed Oct 27 13:41:29 2010 tcpdump -i em0 -ne icmp tcpdump: WARNING: em0: no IPv4 address assigned tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on em0, link-type EN10MB (Ethernet), capture size 96 bytes 13:43:05.556768 00:1d:4f:fa:f4:a0 > 00:bd:e5:22:02:00, ethertype IPv4 (0x0800), length 98: 192.168.0.2 > 192.168.0.220: ICMP echo request, id 50437, seq 0, length 64 13:43:05.557318 00:bd:e5:22:02:00 > 00:1c:42:01:3f:6c, ethertype IPv4 (0x0800), length 98: 192.168.0.220 > 192.168.0.2: ICMP echo reply, id 50437, seq 0, length 64 13:43:05.557318 00:bd:e5:22:02:00 > 00:1d:4f:fa:f4:a0, ethertype IPv4 (0x0800), length 98: 192.168.0.220 > 192.168.0.2: ICMP echo reply, id 50437, seq 0, length 64 3 packets captured 4 packets received by filter 0 packets dropped by kernel Script done on Wed Oct 27 13:43:51 2010 --------- I don't have a rational explanation for this, but I think I may be chasing two bugs. Bug 1. The FreeBSD bridge assigns the ethernet address for the VPN client to the wrong interface unless told to do otherwise with a static assignment. Bug 2. The Desktop bridge changes the destination ethernet address of arp replies coming from NICs on the other side of the bridge that are connected to a physical network ( the NICs that are plugged into the Netgear router.) Normally this would not matter. From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 14:51:50 2010 Return-Path: Delivered-To: net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ED1FA10656A3 for ; Wed, 27 Oct 2010 14:51:50 +0000 (UTC) (envelope-from kfl@xiplink.com) Received: from smtp171.iad.emailsrvr.com (smtp171.iad.emailsrvr.com [207.97.245.171]) by mx1.freebsd.org (Postfix) with ESMTP id 9C8658FC1A for ; Wed, 27 Oct 2010 14:51:50 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp47.relay.iad1a.emailsrvr.com (SMTP Server) with ESMTP id A88943A8238; Wed, 27 Oct 2010 10:51:49 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp47.relay.iad1a.emailsrvr.com (Authenticated sender: kfodil-lemelin-AT-xiplink.com) with ESMTPSA id 5B8A73A8F18; Wed, 27 Oct 2010 10:51:42 -0400 (EDT) Message-ID: <4CC83C70.5050106@xiplink.com> Date: Wed, 27 Oct 2010 10:51:28 -0400 From: Karim Fodil-Lemelin User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 MIME-Version: 1.0 To: "Robert N. M. Watson" References: <4C9DA26D.7000309@freebsd.org> <4CA51024.8020307@freebsd.org> <9AD4923A-72AE-4FE3-A869-3AF8ECBF17E2@FreeBSD.org> <0DB8120D-C02A-49A1-8013-1ED818EDE7E6@freebsd.org> <20101003131330.GA85551@onelab2.iet.unipi.it> <4CAB4BE6.3070307@xiplink.com> <3C5CDDB3-73BF-4551-8F42-1FBCDB757AB6@freebsd.org> In-Reply-To: <3C5CDDB3-73BF-4551-8F42-1FBCDB757AB6@freebsd.org> Content-Type: multipart/mixed; boundary="------------010603020404010407000806" Cc: Juli Mallett , Ryan Stone , Rui Paulo , Luigi Rizzo , FreeBSD Net Subject: Re: mbuf changes X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 14:51:51 -0000 This is a multi-part message in MIME format. --------------010603020404010407000806 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Good day, Attached is a patch against CURRENT (r214406) that implements a function (m_fast_tag_alloc()) that allow users of m_tags to allocate tags within the (mostly) unused data section of an mbuf packet header. The patch only uses this new container for pf_tag although the container could also carry 4 more m_tags (and even more if MTAGLEN is made larger). The pf tag is given as an example of how to use m_fast_tags(). The advantage I can see with this technique, besides the speed gain, is the possibility to incrementally add tags to the container, transparently to other users of mbuf tags. Also, by keeping enough space for a TCP acknowledgment, the relative memory efficiency of mbufs vs clusters is kept. The patch should also apply just fine on FBSD 8. Some of the tags I was thinking of converting next would be the ipfw and dummynet tags to see the impact on performances. Best regards, Karim --------------010603020404010407000806 Content-Type: text/plain; name="mtag_container.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="mtag_container.patch" Index: kern/kern_mbuf.c =================================================================== --- kern/kern_mbuf.c (revision 214406) +++ kern/kern_mbuf.c (working copy) @@ -408,6 +408,7 @@ m->m_pkthdr.ether_vtag = 0; m->m_pkthdr.flowid = 0; SLIST_INIT(&m->m_pkthdr.tags); + INIT_TAG_CONTAINER(m); #ifdef MAC /* If the label init fails, fail the alloc */ error = mac_mbuf_init(m, how); Index: kern/uipc_mbuf2.c =================================================================== --- kern/uipc_mbuf2.c (revision 214406) +++ kern/uipc_mbuf2.c (working copy) @@ -312,6 +312,52 @@ free(t, M_PACKET_TAGS); } +/* XXX m_tag_fast_free is a NOP; + * + * Fast tags are held in pkthdr part of the mbuf. To avoid + * costly manipulations here we don't try to enable reuse of + * the mtag when deleting a FASTTAG. The tag is simply unlinked + * in m_tag_delete and the container free size doesn't change. + */ +void +m_tag_fast_free(struct m_tag *t) +{ +} + +/* Same as m_tag_alloc but uses packet header tag container. + * its fast because it doesn't have the wait time/overhead of malloc but also + * because of its cache locality. + */ +struct m_tag * +m_tag_fast_alloc(struct mbuf *m, u_int32_t cookie, int type, int len, int wait) +{ + struct m_tag *t; + + MBUF_CHECKSLEEP(wait); + if (len < 0) + return NULL; + /* + * fast path tag allocation mechanism. + * XXX checking for M_FASTTAG is only useful if we plan on supporting + * some kind of union between old style mbuf and fast tag ones. + */ + if (((m->m_flags & M_FASTTAG) && + (len + sizeof(struct m_tag)) <= m->m_pkthdr.tag_container_size)) { + t = (struct m_tag *)m->m_pkthdr.tag_containerp; + m->m_pkthdr.tag_containerp += len + sizeof(struct m_tag); + m->m_pkthdr.tag_container_size -= len + sizeof(struct m_tag); + t->m_tag_free = m_tag_fast_free; + } + else { /* revert back to using standard malloc mechanism */ + t = malloc(len + sizeof(struct m_tag), M_PACKET_TAGS, wait); + if (t == NULL) + return NULL; + t->m_tag_free = m_tag_free_default; + } + m_tag_setup(t, cookie, type, len); + return t; +} + /* Get a packet tag structure along with specified data following. */ struct m_tag * m_tag_alloc(uint32_t cookie, int type, int len, int wait) Index: contrib/pf/net/pf_mtag.h =================================================================== --- contrib/pf/net/pf_mtag.h (revision 214406) +++ contrib/pf/net/pf_mtag.h (working copy) @@ -68,8 +68,8 @@ struct m_tag *mtag; if ((mtag = m_tag_find(m, PACKET_TAG_PF, NULL)) == NULL) { - mtag = m_tag_get(PACKET_TAG_PF, sizeof(struct pf_mtag), - M_NOWAIT); + mtag = m_tag_fast_alloc(m, MTAG_ABI_COMPAT, PACKET_TAG_PF, + sizeof(struct pf_mtag), M_NOWAIT); if (mtag == NULL) return (NULL); bzero(mtag + 1, sizeof(struct pf_mtag)); Index: sys/mbuf.h =================================================================== --- sys/mbuf.h (revision 214406) +++ sys/mbuf.h (working copy) @@ -53,6 +53,10 @@ * externally and attach it to the mbuf in a way similar to that of mbuf * clusters. */ +#define MTAGLEN (84) /* Most used tags can fit inside an mbuf header: + * - PF tag (pf_mtag:20) + * - 4 m_tag (m_tag:16) + */ #define MLEN (MSIZE - sizeof(struct m_hdr)) /* normal data len */ #define MHLEN (MLEN - sizeof(struct pkthdr)) /* data len w/pkthdr */ #define MINCLSIZE (MHLEN + 1) /* smallest amount to put in cluster */ @@ -67,6 +71,12 @@ */ #define mtod(m, t) ((t)((m)->m_data)) +#define INIT_TAG_CONTAINER(m) do { \ + m->m_pkthdr.tag_containerp = m->m_pkthdr.tag_container; \ + m->m_pkthdr.tag_container_size = MTAGLEN; \ + m->m_flags |= M_FASTTAG; \ + } while (0) + /* * Argument structure passed to UMA routines during mbuf and packet * allocations. @@ -127,6 +137,9 @@ u_int16_t vt_nrecs; /* # of IGMPv3 records in this chain */ } PH_vt; SLIST_HEAD(packet_tags, m_tag) tags; /* list of packet tags */ + u_char *tag_containerp; /* points to the free part of tag_container */ + u_int8_t tag_container_size; /* container free space */ + u_char tag_container[MTAGLEN]; /* tag container stores a few mtags (fast) */ }; #define ether_vtag PH_vt.vt_vtag @@ -200,6 +213,7 @@ #define M_PROTO7 0x00100000 /* protocol-specific */ #define M_PROTO8 0x00200000 /* protocol-specific */ #define M_FLOWID 0x00400000 /* flowid is valid */ +#define M_FASTTAG 0x01000000 /* mtag allocation can use fast tags */ /* * For RELENG_{6,7} steal these flags for limited multiple routing table * support. In RELENG_8 and beyond, use just one flag and a tag. @@ -916,6 +930,9 @@ struct m_tag *m_tag_copy(struct m_tag *, int); int m_tag_copy_chain(struct mbuf *, struct mbuf *, int); void m_tag_delete_nonpersistent(struct mbuf *); +/* fast routines */ +struct m_tag *m_tag_fast_alloc(struct mbuf *, u_int32_t, int, int, int); +void m_tag_fast_free(struct m_tag *); /* * Initialize the list of tags associated with an mbuf. --------------010603020404010407000806-- From owner-freebsd-net@FreeBSD.ORG Wed Oct 27 18:37:21 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EBEF21065693 for ; Wed, 27 Oct 2010 18:37:21 +0000 (UTC) (envelope-from seanbru@yahoo-inc.com) Received: from mrout1-b.corp.re1.yahoo.com (mrout1-b.corp.re1.yahoo.com [69.147.107.20]) by mx1.freebsd.org (Postfix) with ESMTP id AF8FC8FC1D for ; Wed, 27 Oct 2010 18:37:21 +0000 (UTC) Received: from [127.0.0.1] (rideseveral.corp.yahoo.com [10.73.160.231]) by mrout1-b.corp.re1.yahoo.com (8.14.4/8.14.4/y.out) with ESMTP id o9RIR24V078562; Wed, 27 Oct 2010 11:27:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=yahoo-inc.com; s=cobra; t=1288204022; bh=TsLNJncXGiNta02FeBo9BpKUezLGhyZLznI1DXjdHJE=; h=Subject:From:Reply-To:To:Content-Type:Date:Message-ID: Mime-Version:Content-Transfer-Encoding; b=qZRXBOhgvs+sP0B06riaEcz/6ThARHvILbZegUZBhz6l7+Uo5BUOTZpTKrzoNfvox OR0ju52rOh9dKKsmKheQb+p1IX3EFcYfjAtSn61IP0+kcap2MuTJWBG5w44bKrP69N FosxGmD7F/9gIB6rF4xRBGHML2H9Zn1/RbuLjmcg= From: Sean Bruno To: "freebsd-net@freebsd.org" Content-Type: text/plain; charset="UTF-8" Date: Wed, 27 Oct 2010 11:27:02 -0700 Message-ID: <1288204022.3808.191.camel@home-yahoo> Mime-Version: 1.0 X-Mailer: Evolution 2.28.3 (2.28.3-1.fc12) Content-Transfer-Encoding: 7bit Subject: Excessive Duplicate ACKs X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: sbruno@freebsd.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Oct 2010 18:37:22 -0000 We moved an application stack from BSD4(BOO!) to BSD7(YAY!) recently and got a great performance increase, so first: GOOD JOB. Periodically, we are seeing strings of duplicate ACK being sent in <100uSec deltas. I can't imagine that this should be happening, but there it is. I've sanitized an example trace of a transaction, demonstrating an average case that had 8 dup ACKs, some less than 3 microsends in delta! sysctl -a also attached (and sanitized). http://people.freebsd.org/~sbruno/dup_ack_collapsed.txt http://people.freebsd.org/~sbruno/sysctl_dup_acks.txt Sean From owner-freebsd-net@FreeBSD.ORG Thu Oct 28 10:22:56 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 969E4106566C for ; Thu, 28 Oct 2010 10:22:56 +0000 (UTC) (envelope-from dave.evans55@googlemail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 271458FC08 for ; Thu, 28 Oct 2010 10:22:55 +0000 (UTC) Received: by wyb42 with SMTP id 42so1684607wyb.13 for ; Thu, 28 Oct 2010 03:22:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:x-enigmail-version:content-type :content-transfer-encoding; bh=cDVPTA0elNvX4/L/kM3/1kIamkRNQCetHYTfqxIyI/s=; b=JACCQQrP22vGmFNZR9tbPPQQ42QhTAO6rr2ZBLzSAstFnNbpu5vFwTsCF+CRSn/LHr YPx0I1QfRU+oEWOZZ1Dblmo7olydaHhWuT6iAau1P+HAxBpA3Fug681BPDBqKX1ZisHG TU/cwmKrAVz2ZKEQrnj/MALL0n28OltgGkVRQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :x-enigmail-version:content-type:content-transfer-encoding; b=uH46yUONmOk0LWv09e/ht/W2pGG3E3NzoTFWKo0Gzzy/6ri/i8ZsBSH5xhu49U5D7i NMwPkVKcNOUoX3BcYod59TLIBRKm9qswaFpBx1XTz4OmNF9OvDPT1UiNsMA0IuXORT4F p495mIaXQqAozVf1ol4/dEGl+qXSmpItDJhDs= Received: by 10.227.134.201 with SMTP id k9mr5982017wbt.177.1288261375010; Thu, 28 Oct 2010 03:22:55 -0700 (PDT) Received: from two.pearl (dsl-fixed-77-44-81-131.interdsl.co.uk [77.44.81.131]) by mx.google.com with ESMTPS id ga16sm789415wbb.1.2010.10.28.03.22.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 28 Oct 2010 03:22:53 -0700 (PDT) Message-ID: <4CC94EFB.1020904@googlemail.com> Date: Thu, 28 Oct 2010 11:22:51 +0100 From: David Evans User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.11) Gecko/20101013 Lightning/1.0b2 Thunderbird/3.1.5 MIME-Version: 1.0 To: FreeBSD Net X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Subject: Re: Bridge problems, possibly due to proxy arp on Parallels Desktop X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2010 10:22:56 -0000 [ posted to freebsd-net@freebsd.org 2010-10-28 ] I believe I have now found the answer to my problem. The rule is simple: You cannot bridge a Desktop virtual NIC. The reason for this, I believe so far, is that Parallels have only implemented a simplified version of bridging on their bridged networking scheme. If you try to use more than one MAC address per NIC, it get confused and fails in mysterious ways: ping only works when another ping is running; ARP replies go to the wrong NIC; ping does not work for certain combinations of hosts. Obviously, what Parallels have implemented is perfectly adequate for 99.9999% of users; it's only people like me who insist on testing everything to destruction. I have now built a VPN on top of the existing network without using any bridging to a Desktop virtual NIC. On one VM I am running FreeBSD with 3 VPN servers bridged together. On another VM I am running a FreeBSD client. Another FreeBSD client runs on a PC. A third client runs on OS X. It is all working just like I expected. Of course you would not normally run 3 servers on one machine but would combine them into one, but I'm only testing. It is certainly very useful to be able to run all this on virtual machines. There is no way I could have tested this out on my available hardware. It has been an interesting learning experience. From owner-freebsd-net@FreeBSD.ORG Thu Oct 28 13:46:07 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A6421065679; Thu, 28 Oct 2010 13:46:07 +0000 (UTC) (envelope-from kris@pcbsd.org) Received: from que31.charter.net (que31.charter.net [209.225.8.23]) by mx1.freebsd.org (Postfix) with ESMTP id 10AD18FC22; Thu, 28 Oct 2010 13:46:06 +0000 (UTC) Received: from imp11 ([10.20.200.11]) by mta21.charter.net (InterMail vM.7.09.02.04 201-2219-117-106-20090629) with ESMTP id <20101028131650.NSIA3705.mta21.charter.net@imp11>; Thu, 28 Oct 2010 09:16:50 -0400 Received: from moorefam.homeunix.org ([96.38.85.215]) by imp11 with smtp.charter.net id QDGo1f00G4elNjk05DGpMm; Thu, 28 Oct 2010 09:16:50 -0400 X-Authority-Analysis: v=1.0 c=1 a=kj9zAlcOel0A:10 a=xxqjul-xXv3dWeLZW2AA:9 a=q56psUfllca_l13bT5gEmqrGSl8A:4 a=CjuIK1q_8ugA:10 Received: by moorefam.homeunix.org (sSMTP sendmail emulation); Fri, 29 Oct 2010 06:15:16 -0400 Date: Fri, 29 Oct 2010 06:15:16 -0400 From: Kris Moore To: freebsd-net@freebsd.org Message-ID: <20101029101516.GA66384@pcbsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: yongari@FreeBSD.org Subject: Hardlock with alc0 device X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2010 13:46:07 -0000 I'm running into a rather interesting problem here on HEAD with a newer Asus EEE PC and the "alc" network driver. The device works great when a cable is plugged in, no issues at all. However, if I unplug the ethernet and reboot then I get a hard-lock when it tries to bring up the device. I disabled ifconfig_alc0="DHCP" in rc.conf, and now the system boots normally, but just for kicks I tried running "dhclient alc0" on it manually, and sure enough it resulted in another system lockup. (No kern dump, doesn't even get that far) Here's some information about the system / device, let me know if there is any other data / commands I should run and send over. FreeBSD mininova 9.0-CURRENT FreeBSD 9.0-CURRENT #14: Sat Oct 23 13:11:00 PDT 2010 alc0@pci0:1:0:0: class=0x020000 card=0x838a1043 chip=0x10621969 rev=0xc0 hdr=0x00 vendor = 'Attansic (Now owned by Atheros)' device = 'Atheros AR8132 PCI-E Fast Ethernet Controller (AR8132)' class = network subclass = ethernet alc0: flags=8802 metric 0 mtu 1500 options=c3198 ether 20:cf:30:1e:b2:38 media: Ethernet autoselect -- Kris Moore PC-BSD Software From owner-freebsd-net@FreeBSD.ORG Thu Oct 28 18:42:20 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DABFE106566C; Thu, 28 Oct 2010 18:42:20 +0000 (UTC) (envelope-from shteryana@gmail.com) Received: from mail-qy0-f175.google.com (mail-qy0-f175.google.com [209.85.216.175]) by mx1.freebsd.org (Postfix) with ESMTP id 743208FC1D; Thu, 28 Oct 2010 18:42:20 +0000 (UTC) Received: by qyk7 with SMTP id 7so5135300qyk.13 for ; Thu, 28 Oct 2010 11:42:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:sender:reply-to:received :date:x-google-sender-auth:message-id:subject:from:to:content-type; bh=MV6/XeqWdPZSfhg4PV7R0HH8El4bziZsNKzDFT2OBQI=; b=TjvrDOSQFaPOjD/E6rQbimThJYvIKxSp5V6j+rK7vWNnnJb52b/MIWBz813QLwRMDD 1fjwjN0a3qJyywz1zaVXWKAE9+s8RFtrkwT5IQI6vxNwyRYG802+fxqy68W+pJQ4f6LH 8xtvW4dawONUF0do3CyOzM8NSlcQTWDIBC8Bw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:reply-to:date:x-google-sender-auth:message-id :subject:from:to:content-type; b=TzOxRSkFauZiA5a++owypGUEyO1Wd6f0H0S4aB5r78Pn+V9oPyhl5FydWaSBnV28bN O+1RBt+A7XMoR/HPQAYY5R63Nnqv+v8LPhbDMYorwF+7hU5/7Isxv+E8eYUwGUYpbroM YpZLEbyhXrC+Ps3Z1Wrjs9k1iCrCLMZ0l2Ez4= MIME-Version: 1.0 Received: by 10.229.88.15 with SMTP id y15mr396767qcl.39.1288289977558; Thu, 28 Oct 2010 11:19:37 -0700 (PDT) Sender: shteryana@gmail.com Received: by 10.229.230.202 with HTTP; Thu, 28 Oct 2010 11:19:37 -0700 (PDT) Date: Thu, 28 Oct 2010 21:19:37 +0300 X-Google-Sender-Auth: eWmyYPo6-CBRJAz4sa-Cv9LBfCc Message-ID: From: Shteryana Shopova To: "freebsd-net@FreeBSD.org" , freebsd-current@freebsd.org Content-Type: text/plain; charset=UTF-8 Cc: Subject: Call for testers: SNMPv3 support for bsnmpd(1) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: syrinx@FreeBSD.org List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2010 18:42:20 -0000 Dear all, I am happy to announce that work on SNMPv3 support for bsnmpd(1) is now completed and ready for testing. I want to thank the FreeBSD Foundation for funding this work. A quick how-to get started with the changes bsnmpd(1) follows. The patch against FreeBSD current sources is available under http://people.freebsd.org/~syrinx/snmp/svn-snmpd-20101028-02.diff. To compile && install the sources #cd #fetch http://people.freebsd.org/~syrinx/snmp/svn-snmpd-20101028-02.diff #mkdir contrib/bsnmp/snmp_vacm && mkdir contrib/bsnmp/snmp_usm && mkdir usr.sbin/bsnmpd/tools && mkdir usr.sbin/bsnmpd/tools/bsnmptools && mkdir usr.sbin/bsnmpd/tools/libbsnmptools && mkdir usr.sbin/bsnmpd/modules/snmp_vacm && mkdir usr.sbin/bsnmpd/modules/snmp_usm #patch < svn-snmpd-20101028-02.diff # The patch contains all changes made to support SNMPv3 in bsnmpd(1) and also bsnmpdtools(1) that were initially developed during Google's Summer of Code 2005 and later together with bsnmpd(1) enhanced to support SNMPv3 encryption and authentication. After the implemented changes bsnmpd(1) should be compatible with old configuration files and unless explicitly specified in its configuration file, it should also retain its current behavior. By default, all SNMP versions are enabled, however as there are no SNMPv3 USM users defined, SNMPv3 packets are silently dropped. To be able to configure SNMPv3 users View-based access rules one needs to load two additional modules in bsnmpd(1) that are not loaded by default - snmp_usm(1) and snmp_vacm(1). This is done by adding the following lines in bsnmpd.config # SNMPv3 User-based security module - must be loaded for SNMPv3 USM begemotSnmpdModulePath."usm" = "/usr/lib/snmp_usm.so" # SNMPv3 View-based Access Control module begemotSnmpdModulePath."vacm" = "/usr/lib/snmp_vacm.so" The objects from SNMP-FRAMEWORK-MIB (snmpEngineID, snmpEngineBoots, snmpEngineTime and snmpEngineMaxMessageSize) are mandatory for an SNMP agent compliant with the SNMPv3 Framework and are supported by bsnmpd(1). A administrative value for the snmpEngineID may be specified via the daemon's configuration file , for example # The SNMP engine ID engine := 0x80:0x00:0x1f:0x88:0x80:0x91:0x04:0xc9:0x0f:0x67:0xe9:0x5b:0x4c snmpEngineID = $(engine) If not present, a default value is assigned to the object based on host id, where bsnmpd(1) is running. SNMPv1 and SNMPv2 communities definitions in the config file have not changes. Definition of SNMPv3 users is done in the usm section of the configuration file, for example %usm NoAuthProtocol := 1.3.6.1.6.3.10.1.1.1 HMACMD5AuthProtocol := 1.3.6.1.6.3.10.1.1.2 HMACSHAAuthProtocol := 1.3.6.1.6.3.10.1.1.3 NoPrivProtocol := 1.3.6.1.6.3.10.1.2.1 DESPrivProtocol := 1.3.6.1.6.3.10.1.2.2 AesCfb128Protocol := 1.3.6.1.6.3.10.1.2.4 user1 := "test" user4 := "testmd5" user6 := "testaes" user4passwd := 0xa4:0x27:0x99:0xe2:0x4b:0x32:0x12:0xec:0xe5:0xf4:0xac:0x83:0x1f:0x75:0xbb:0x59 user6passwd := 0x1b:0x07:0x9b:0x0b:0x75:0xb7:0xab:0xc7:0x77:0x6a:0x1a:0x24:0x02:0x0c:0x3a:0x87:0x4c:0x80:0x80:0x04 # SNMPv3 user with name "test", no authentication, no privacy usmUserStatus.$(engine).$(user1) = 5 usmUserAuthProtocol.$(engine).$(user1) = $(NoAuthProtocol) usmUserPrivProtocol.$(engine).$(user1) = $(NoPrivProtocol) usmUserStatus.$(engine).$(user1) = 1 # SNMPv3 user with name "testmd5", MD5 message digests, no privacy usmUserStatus.$(engine).$(user4) = 5 usmUserAuthKeyChange.$(engine).$(user4) = $(user4passwd) usmUserPrivProtocol.$(engine).$(user4) = $(NoPrivProtocol) usmUserStatus.$(engine).$(user4) = 1 # SNMPv3 user with name "testaes", SHA256 message digests, AES encryption usmUserStatus.$(engine).$(user6) = 5 usmUserAuthProtocol.$(engine).$(user6) = $(HMACSHAAuthProtocol) usmUserAuthKeyChange.$(engine).$(user6) = $(user6passwd) usmUserPrivProtocol.$(engine).$(user6) = $(AesCfb128Protocol) usmUserPrivKeyChange.$(engine).$(user6) = $(user6passwd) usmUserStatus.$(engine).$(user6) = 1 The password of each user specified in the configuration file is the localized password for the current snmpEngineId and may be calculated via bsnmpget(1), for example > setenv | grep SNMP SNMPUSER=testaes SNMPPASSWD=shteryana SNMPAUTH=sha SNMPPRIV=aes > bsnmpget -v 3 -D -K -o verbose Engine ID 0x80001f88809104c90f67e95b4c Boots : 145 Time : 1 Localized keys for testaes SHA : 0x1b079b0b75b7abc7776a1a24020c3a874c808004 AES : 0x1b079b0b75b7abc7776a1a24020c3a87 > Supported authentication options are MD5 and SHA256 or none, and supported encryption options are DES and AES. If encryption is used, authenticaiton is also mandatory. Unless the snmp_vacm(1) module is loaded, all users have access to the values of all MIB objects available in bsnmpd(1). To allow only access to ceratain parts of the MIB subtrees supported in bsnmpd(1) one should use the snmp_vacm(3) module. The module is configured in the %vacm section of the snmpd.config file. To properly configure View-Based access, at least three enties are needed - one specifying a group of users, a second specifying an access rule for the group of users, and a third specifying the MIB subtrees that the group of users is allowed read-only or write access. For example, read := "public" write := "private" %vacm #Definition of a SNMPv1 group in snmp_vacm(3) vacmSecurityToGroupStatus.1.$(read) = 4 vacmGroupName.1.$(read) = $(read) #Definition of a SNMPv2 group in snmp_vacm(3) vacmSecurityToGroupStatus.2.$(write) = 4 vacmGroupName.2.$(write) = $(write) #Definition of a SNMPv3 group, including users "test" and "testaes" in snmp_vacm(3) vacmSecurityToGroupStatus.3.$(user1) = 4 vacmGroupName.3.$(user1) = $(write) vacmSecurityToGroupStatus.3.$(user6) = 4 vacmGroupName.3.$(user6) = $(write) # List of views as per RFC 3415 internetoid := 1.3.6.1 internetoidlen := 4 vacmViewTreeFamilyStatus."internet".$(internetoidlen).$(internetoid) = 4 vacmViewTreeFamilyStatus."restricted".$(internetoidlen).$(internetoid) = 4 noAuthNoPriv := 1 authNoPriv := 2 authPriv := 3 #Read-only access for the users from the SNMPv1 group vacmAccessStatus.$(read)."".1.1 = 4 vacmAccessReadViewName.$(read)."".1.1 = "internet" #Read-write access for the users from the SNMPv2 group vacmAccessStatus.$(write)."".2.1 = 4 vacmAccessReadViewName.$(write)."".2.1 = "internet" vacmAccessWriteViewName.$(write)."".2.1 = "internet" #Read-write-notify access for SNMPv3 USM users with noAuthNoPriv vacmAccessStatus.$(write)."".3.$(noAuthNoPriv) = 4 vacmAccessReadViewName.$(write)."".3.$(noAuthNoPriv) = "internet" vacmAccessReadViewName.$(write)."".3.$(noAuthNoPriv) = "internet" vacmAccessWriteViewName.$(write)."".3.$(noAuthNoPriv) = "internet" vacmAccessNotifyViewName.$(write)."".3.$(noAuthNoPriv) = "internet" #Read-write-notify access for SNMPv3 USM users with authNoPriv vacmAccessStatus.$(write)."".3.$(authNoPriv) = 4 vacmAccessReadViewName.$(write)."".3.$(authNoPriv) = "internet" vacmAccessWriteViewName.$(write)."".3.$(authNoPriv) = "internet" vacmAccessNotifyViewName.$(write)."".3.$(authNoPriv) = "internet" #Read-write-notify access to restricted for SNMPv3 USM users with authPriv vacmAccessStatus.$(write)."".3.$(authPriv) = 4 vacmAccessReadViewName.$(write)."".3.$(authPriv) = "restricted" vacmAccessWriteViewName.$(write)."".3.$(authPriv) = "restricted" vacmAccessNotifyViewName.$(write)."".3.$(authPriv) = "restricted" The snmp_vacm(3) module may be used separately from the snmp_usm(3) module. In case the snmp_usm(3) is not loaded, the snmp_vacm(3) will grant access to the MIB objects in bsnmpd(1) to SNMPv1/v2c users. SNMPv1/v2c user names must match the configured read/wqrite communities in the snmpd.config file. Both modules may be be also configured via SNMP SET requests, but such configuration is not persistent between reboots of bsnmpd(1). bsnmptools(1) may be used to query OID values from bsmnpd(1), the bsnmpget(1) man page specifies all the available command line options that may be passed to the tools. In the simplest case, given that the SNMPUSER, SNMPPASSWD, SNMPAUTH, SNMPPRIV environment variables are set, with SNMPv3 the bsnmptools(1) will perform authomatic engine ID discovery, calculate the correspoding localized keys for the discovered engine ID and query the agent with the appropriate options in the SNMP PDUs, for example > bsnmpwalk -v 3 mib2 Engine ID 0x80001f88809104c90f67e95b4c Boots : 148 Time : 337 Localized keys for testaes SHA : 0x1b079b0b75b7abc7776a1a24020c3a874c808004 AES : 0x1b079b0b75b7abc7776a1a24020c3a87 sysDescr.0 = prometheus 1108790616 FreeBSD 9.0-CURRENT sysObjectId.0 = begemotSnmpdAgentFreeBSD sysUpTime.0 = 36605 sysContact.0 = syrinx@FreeBSD.org sysName.0 = prometheus sysLocation.0 = Somewhere in Europe sysServices.0 = 76 sysORLastChange.0 = 1 sysORID[1] = begemotSnmpdTransUdp .... Enjoy! cheers, Shteryana From owner-freebsd-net@FreeBSD.ORG Thu Oct 28 20:21:14 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A773106564A for ; Thu, 28 Oct 2010 20:21:14 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward13.mail.yandex.net (forward13.mail.yandex.net [95.108.130.120]) by mx1.freebsd.org (Postfix) with ESMTP id B4D468FC2A for ; Thu, 28 Oct 2010 20:21:13 +0000 (UTC) Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net [95.108.131.192]) by forward13.mail.yandex.net (Yandex) with ESMTP id 52AE71081C3A for ; Fri, 29 Oct 2010 00:21:11 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1288297271; bh=GGuqvquHHdENpNNYlcANhQxfRxrQTYcCRuU3sZL/8oI=; h=Date:From:Reply-To:Message-ID:To:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding; b=EAVxPkW8ArfZ/yiDKnxiVrRHUVAkGkxG+Vh8Y2cWTmX7ZS7vUHKk+FN/zvyEAdOeQ znXzjhd+5rVirCt7UlYHn5i8ALrn/s2OcmuozLYCdvJ31opLAP0nAZEPJtLQP70P8B Di6Hp4Sa0JeQgqCNRrTBc1TAaxhZYwa9r+Jj1kcs= Received: from HOMEUSER (unknown [77.93.42.18]) by smtp14.mail.yandex.net (Yandex) with ESMTPA id 1597219B80A1 for ; Fri, 29 Oct 2010 00:21:11 +0400 (MSD) Date: Thu, 28 Oct 2010 23:21:11 +0300 From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= X-Mailer: The Bat! (v4.0.24) Professional Organization: =?windows-1251?B?188gyu7t/Oru4iwgRnJlZUxpbmU=?= X-Priority: 2 (High) Message-ID: <1519248747.20101028232111@yandex.ru> To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit X-Yandex-TimeMark: 1288297271 X-Yandex-Spam: 1 X-Yandex-Front: smtp14.mail.yandex.net Subject: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2010 20:21:14 -0000 Hello, w/0 polling: serv1# ifconfig nfe0 nfe0: flags=8943 metric 0 mtu 1500 options=10b ether 00:13:d4:ce:82:16 inet 10.11.8.17 netmask 0xfffffc00 broadcast 10.11.11.255 inet 10.11.15.15 netmask 0xffffff00 broadcast 10.11.15.255 inet 10.11.8.15 netmask 0xfffffc00 broadcast 10.11.11.255 media: Ethernet autoselect (1000baseTX ) status: active serv2# ifconfig re0 re0: flags=8843 metric 0 mtu 1500 options=389b ether 00:1c:c0:c8:5a:4e inet 192.168.255.254 netmask 0xffffffff broadcast 192.168.255.254 media: Ethernet autoselect (1000baseTX ) status: active serv1# systat -v 2 users Load 0.38 0.49 0.38 Oct 28 23:10 Mem:KB REAL VIRTUAL VN PAGER SWAP PAGER Tot Share Tot Share Free in out in out Act 324452 20196 490400 25112 938576 count All 346596 21060 1074286k 28104 pages Proc: Interrupts r p d s w Csw Trp Sys Int Sof Flt cow 29953 total 1 47 71k 18 5022 27k 2029 1 zfod atkbd0 1 ozfod 7 ata0 irq14 62.4%Sys 18.7%Intr 0.4%User 0.0%Nice 18.4%Idle %ozfod 27944 nfe0 irq23 | | | | | | | | | | | daefr 2001 cpu0: time ===============================++++++++++ prcfr igb0 256 1 dtbuf 6 totfr 1 igb0 257 Namei Name-cache Dir-cache 100000 desvn react igb0 258 Calls hits % hits % 84106 numvn pdwak 5 5 100 24824 frevn pdpgs intrn Disks ad0 373808 wire KB/t 16.00 292088 act tps 7 417568 inact MB/s 0.10 200 cache %busy 0 938376 free iperf result: [ ID] Interval Transfer Bandwidth [ 4] 0.0-10.3 sec 450 MBytes 368 Mbits/sec after enable POLLING: serv1# ifconfig nfe0 polling 2 users Load 0.32 0.39 0.35 Oct 28 23:13 Mem:KB REAL VIRTUAL VN PAGER SWAP PAGER Tot Share Tot Share Free in out in out Act 324464 20196 490656 25112 938428 count All 346624 21060 1074286k 28104 pages Proc: Interrupts r p d s w Csw Trp Sys Int Sof Flt cow 2006 total 1 47 28k 19 2691 6 2036 2 zfod atkbd0 1 ozfod 4 ata0 irq14 24.7%Sys 18.6%Intr 0.7%User 0.0%Nice 55.9%Idle %ozfod nfe0 irq23 | | | | | | | | | | | daefr 2001 cpu0: time ============++++++++++ prcfr igb0 256 10 dtbuf 2 totfr 1 igb0 257 Namei Name-cache Dir-cache 100000 desvn react igb0 258 Calls hits % hits % 84106 numvn pdwak 20 20 100 24824 frevn pdpgs intrn Disks ad0 373944 wire KB/t 16.00 292104 act tps 4 417564 inact MB/s 0.07 200 cache %busy 0 938228 free I get bad results ((( [ ID] Interval Transfer Bandwidth [ 4] 0.0-10.3 sec 180 MBytes 147 Mbits/sec -- mailto:kes-kes@yandex.ru From owner-freebsd-net@FreeBSD.ORG Thu Oct 28 21:42:05 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 31003106564A for ; Thu, 28 Oct 2010 21:42:05 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout025.mac.com (asmtpout025.mac.com [17.148.16.100]) by mx1.freebsd.org (Postfix) with ESMTP id 17A9F8FC14 for ; Thu, 28 Oct 2010 21:42:04 +0000 (UTC) MIME-version: 1.0 Content-type: text/plain; charset=koi8-r Received: from cswiger1.apple.com ([17.209.4.71]) by asmtp025.mac.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 64bit)) with ESMTPSA id <0LB0008BTPHY9550@asmtp025.mac.com> for freebsd-net@freebsd.org; Thu, 28 Oct 2010 13:41:59 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1010280111 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-10-28_10:2010-10-28, 2010-10-28, 1970-01-01 signatures=0 From: Chuck Swiger X-Priority: 2 (High) In-reply-to: <1519248747.20101028232111@yandex.ru> Date: Thu, 28 Oct 2010 13:41:58 -0700 Content-transfer-encoding: quoted-printable Message-id: <1452146D-A590-4676-A662-14D0EEE82152@mac.com> References: <1519248747.20101028232111@yandex.ru> To: =?utf-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?= X-Mailer: Apple Mail (2.1081) Cc: freebsd-net@freebsd.org Subject: Re: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Oct 2010 21:42:05 -0000 On Oct 28, 2010, at 1:21 PM, =EB=CF=CE=D8=CB=CF=D7 =E5=D7=C7=C5=CE=C9=CA = wrote: > [ ... ] What is "sysctl kern.clockrate", and have you increased kern.hz in = /boot/loader.conf to at least 1000, if not 2000 or 4000? Polling mode operation generally performs better when using older 100Mbs = ethernet NICs which do not support interrupt mitigation and various = capabilities like TSO4; gigabit ethernet NICs are smarter hardware and = can generally outperform polling mode. Regards, --=20 -Chuck From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 00:17:30 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EC69D106566C for ; Fri, 29 Oct 2010 00:17:30 +0000 (UTC) (envelope-from aragon@phat.za.net) Received: from mail.geek.sh (decoder.geek.sh [196.36.198.81]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3AC8FC14 for ; Fri, 29 Oct 2010 00:17:30 +0000 (UTC) Received: from igor.geek.sh (196-209-90-124.dynamic.isadsl.co.za [196.209.90.124]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mail.geek.sh (Postfix) with ESMTPSA id C15503992D for ; Fri, 29 Oct 2010 02:17:28 +0200 (SAST) Message-ID: <4CCA1298.2030403@phat.za.net> Date: Fri, 29 Oct 2010 02:17:28 +0200 From: Aragon Gouveia User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.11) Gecko/20100725 Thunderbird/3.0.6 MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: please review my ppp(8) patch X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 00:17:31 -0000 http://www.freebsd.org/cgi/query-pr.cgi?pr=151400 From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 07:20:13 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6119810656ED for ; Fri, 29 Oct 2010 07:20:13 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward17.mail.yandex.net (forward17.mail.yandex.net [95.108.253.142]) by mx1.freebsd.org (Postfix) with ESMTP id D090E8FC2E for ; Fri, 29 Oct 2010 07:20:12 +0000 (UTC) Received: from smtp16.mail.yandex.net (smtp16.mail.yandex.net [95.108.252.16]) by forward17.mail.yandex.net (Yandex) with ESMTP id 81E67A58705 for ; Fri, 29 Oct 2010 11:20:11 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1288336811; bh=eu0vvxxH0Vo/kBLYm8I+sveVJbWeCcWRKVr8ZY6XYd4=; h=Date:From:Reply-To:Message-ID:To:Subject:MIME-Version: Content-Type:Content-Transfer-Encoding; b=iI+Qe83c7shnBUCr1i4FVWl7BwMjeG3j8e78f0rIXNCAPKrE9tn+KJgNQ+nnOErX7 ri0Vqu9IRGdCn1lTqP/x+JXCBb3xy4Ouc7Lyb39wZ5BmSq67Nn3HEVKOmCWJ1RqlEW OGW9U2wX4gfvyxTJ4ZiGDzy7OCzPXERNebAOa0a0= Received: from HOMEUSER (unknown [77.93.36.205]) by smtp16.mail.yandex.net (Yandex) with ESMTPA id 4149C1600097 for ; Fri, 29 Oct 2010 11:20:11 +0400 (MSD) Date: Fri, 29 Oct 2010 10:20:10 +0300 From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= X-Mailer: The Bat! (v4.0.24) Professional Organization: =?windows-1251?B?188gyu7t/Oru4iwgRnJlZUxpbmU=?= X-Priority: 3 (Normal) Message-ID: <364322520.20101029102010@yandex.ru> To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit X-Yandex-TimeMark: 1288336811 X-Yandex-Spam: 1 X-Yandex-Front: smtp16.mail.yandex.net Subject: How to obtain place of low perfomance? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 07:20:13 -0000 Hi, Freebsd-net. serv1# ifocnfig nfe0 nfe0: flags=8943 metric 0 mtu 1500 options=10b ether 00:13:d4:ce:82:16 inet 10.11.8.17 netmask 0xfffffc00 broadcast 10.11.11.255 inet 10.11.8.15 netmask 0xfffffc00 broadcast 10.11.11.255 media: Ethernet autoselect (1000baseTX ) status: active serv1# ifconfig igb0 igb0: flags=8843 metric 0 mtu 1500 options=19b ether 00:1b:21:45:da:b8 media: Ethernet autoselect (1000baseTX ) status: active serv1# ifconfig vlan7 vlan7: flags=8843 metric 0 mtu 1500 options=3 ether 00:1b:21:45:da:b8 inet 10.11.15.15 netmask 0xffffff00 broadcast 10.11.15.255 inet 10.11.7.1 netmask 0xffffff00 broadcast 10.11.7.255 media: Ethernet autoselect (1000baseTX ) status: active vlan: 7 parent interface: igb0 doing bw test with iperf it show low performance on nfe0. # iperf -c 10.11.8.17 ------------------------------------------------------------ Client connecting to 10.11.8.17, TCP port 5001 TCP window size: 32.5 KByte (default) ------------------------------------------------------------ [ 3] local 10.11.8.16 port 63911 connected with 10.11.8.17 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.5 sec 124 MBytes 98.8 Mbits/sec # iperf -c 10.11.7.1 ------------------------------------------------------------ Client connecting to 10.11.7.1, TCP port 5001 TCP window size: 32.5 KByte (default) ------------------------------------------------------------ [ 3] local 10.11.7.2 port 61422 connected with 10.11.7.1 port 5001 [ ID] Interval Transfer Bandwidth [ 3] 0.0-10.3 sec 800 MBytes 653 Mbits/sec despite on it is integrated I expect about 300-400Mbit throughput does nfe0 really so poor NIC? state of nfe0 while 'iperf' testing # netstat -w 1 -h -d -I nfe0 input (nfe0) output packets errs bytes packets errs bytes colls drops 1.6K 0 543K 2.4K 0 1.9M 0 0 1.8K 0 613K 2.4K 0 1.9M 0 0 1.7K 0 620K 2.5K 0 1.9M 0 0 1.8K 0 627K 2.6K 0 2.0M 0 0 2.1K 0 1.2M 2.8K 0 1.9M 0 0 28K 0 40M 20K 0 3.0M 0 0 11K 0 14M 8.3K 0 2.3M 0 0 12K 0 16M 9.0K 0 2.3M 0 0 2.8K 0 2.0M 3.1K 0 2.0M 0 0 11K 0 14M 8.5K 0 2.5M 0 0 7.8K 0 9.6M 6.4K 0 2.2M 0 0 12K 0 16M 9.1K 0 2.3M 0 0 6.9K 0 8.4M 5.8K 0 2.1M 0 0 3.0K 0 2.5M 3.3K 0 2.0M 0 0 11K 0 14M 8.2K 0 2.3M 0 0 1.7K 0 664K 2.6K 0 1.9M 0 0 1.7K 0 588K 2.4K 0 1.9M 0 0 1.6K 0 627K 2.3K 0 1.8M 0 0 -- Ñ óâàæåíèåì, Êîíüêîâ mailto:kes-kes@yandex.ru From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 06:39:35 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DBDB0106564A for ; Fri, 29 Oct 2010 06:39:35 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward17.mail.yandex.net (forward17.mail.yandex.net [95.108.253.142]) by mx1.freebsd.org (Postfix) with ESMTP id 866A28FC08 for ; Fri, 29 Oct 2010 06:39:35 +0000 (UTC) Received: from smtp17.mail.yandex.net (smtp17.mail.yandex.net [95.108.252.17]) by forward17.mail.yandex.net (Yandex) with ESMTP id 979CFA587D6; Fri, 29 Oct 2010 10:39:26 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1288334366; bh=/bJKNax954wPatQMuWgHKcAxxvXQt5Vowai5AITzGBY=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=LHQ9K853qWxze7BexQP3w564PBt9EwLBz46T9+PpyonC1E9wrDRkTdHgDGMsKcVmb QT4m9oQz5TDs8PArm3x6dzJB4BXl1+F4OSQus3DjgAH4SXe79UBmnNCOl/AOt85UBc hzM0Q6FVfLWQot8vDRRbKAw3thensjfn4pbGFfQ8= Received: from HOMEUSER (unknown [77.93.38.34]) by smtp17.mail.yandex.net (Yandex) with ESMTPA id 51F923070062; Fri, 29 Oct 2010 10:39:26 +0400 (MSD) X-Nat-Received: from [192.168.11.27]:1797 [ident-empty] by SPAM FILTER: with TPROXY id 1288333939.20836 abuse-to kes-kes@yandex.ru Date: Fri, 29 Oct 2010 09:39:26 +0300 From: =?koi8-r?B?68/O2MvP1yDl18fFzsnK?= X-Mailer: The Bat! (v4.0.24) Professional Organization: =?koi8-r?B?/vAg68/O2MvP1ywgRnJlZUxpbmU=?= X-Priority: 3 (Normal) Message-ID: <606859717.20101029093926@yandex.ru> To: Chuck Swiger In-Reply-To: <1452146D-A590-4676-A662-14D0EEE82152@mac.com> References: <1519248747.20101028232111@yandex.ru> <1452146D-A590-4676-A662-14D0EEE82152@mac.com> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit X-Yandex-TimeMark: 1288334366 X-Yandex-Spam: 1 X-Yandex-Front: smtp17.mail.yandex.net X-Mailman-Approved-At: Fri, 29 Oct 2010 11:07:27 +0000 Cc: freebsd-net@freebsd.org Subject: Re[2]: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?koi8-r?B?68/O2MvP1yDl18fFzsnK?= List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 06:39:35 -0000 úÄÒÁ×ÓÔ×ÕÊÔÅ, Chuck. ÷Ù ÐÉÓÁÌÉ 28 ÏËÔÑÂÒÑ 2010 Ç., 23:41:58: CS> On Oct 28, 2010, at 1:21 PM, ëÏÎØËÏ× å×ÇÅÎÉÊ wrote: >> [ ... ] CS> What is "sysctl kern.clockrate", and have you increased kern.hz CS> in /boot/loader.conf to at least 1000, if not 2000 or 4000? # vmstat -i interrupt total rate irq14: ata0 193948 6 irq16: rl0 42829515 1464 irq23: nfe0 41224044 1409 cpu0: timer 58494158 1999 irq256: igb0 106911 3 irq257: igb0 254606 8 irq258: igb0 2 0 Total 143103184 4892 # sysctl kern.clockrate kern.clockrate: { hz = 1000, tick = 1000, profhz = 2000, stathz = 133 } # sysctl kern.hz kern.hz: 1000 but I have configured and installed kern with 2000HZ "systat -v" shows that: 2002 cpu0: time CS> Polling mode operation generally performs better when using older CS> 100Mbs ethernet NICs which do not support interrupt mitigation and CS> various capabilities like TSO4; gigabit ethernet NICs are smarter CS> hardware and can generally outperform polling mode. so using polling on gigabit NICs is a bottle neck? and is cause of low performance, is not? -- ó Õ×ÁÖÅÎÉÅÍ, ëÏÎØËÏ× mailto:kes-kes@yandex.ru From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 16:57:05 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99D97106564A; Fri, 29 Oct 2010 16:57:05 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5EAC38FC12; Fri, 29 Oct 2010 16:57:05 +0000 (UTC) Received: by pwi8 with SMTP id 8so774384pwi.13 for ; Fri, 29 Oct 2010 09:57:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=4ZQc+UnsXzCmuyjAadaE+347oIJp2SpEToScxQalwFg=; b=JkDOeJ6kkLDwWNsjHfOnDfx4RnLZyhvfRaS8GQ20D/oxaml5NyCyXSxL5EwJi4Bg0I PqxrW7+dY4FqV3DrS333EsVDBngQNAFEJBbuHzdjUUxThRbU9Mr8etVO8rfiamDNqFzR nqUkFveei/efxSjztkTeNqW6fZ6MS2gHzH+DE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=bOgYnjvvjn/lR3t9kvhton5Qs5hpyVouVmGmmDWOt987F8rTBK5TPmnpMKV1XuoIzY pa0FdYzoGMPGBWl17O/hEAyOtCf3zYu7aprgCqrQSFKnfoyqb9lGH4JMtN+7R56z0A1D xoTp/W3Hxihp5qdOua9n8foEyJXLTkOrL2mmM= Received: by 10.142.179.5 with SMTP id b5mr1532318wff.225.1288371424814; Fri, 29 Oct 2010 09:57:04 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id e36sm2166457wfj.14.2010.10.29.09.57.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Oct 2010 09:57:02 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 29 Oct 2010 09:55:31 -0700 From: Pyun YongHyeon Date: Fri, 29 Oct 2010 09:55:31 -0700 To: Kris Moore Message-ID: <20101029165531.GA19479@michelle.cdnetworks.com> References: <20101029101516.GA66384@pcbsd.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="J2SCkAp4GZ/dPZZf" Content-Disposition: inline In-Reply-To: <20101029101516.GA66384@pcbsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org, yongari@freebsd.org Subject: Re: Hardlock with alc0 device X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 16:57:05 -0000 --J2SCkAp4GZ/dPZZf Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Oct 29, 2010 at 06:15:16AM -0400, Kris Moore wrote: > > I'm running into a rather interesting problem here on HEAD with a newer Asus > EEE PC and the "alc" network driver. The device works great when a > cable is plugged in, no issues at all. However, if I unplug the ethernet > and reboot then I get a hard-lock when it tries to bring up the device. > > I disabled ifconfig_alc0="DHCP" in rc.conf, and now the system boots > normally, but just for kicks I tried running "dhclient alc0" on it > manually, and sure enough it resulted in another system lockup. (No kern dump, > doesn't even get that far) > > Here's some information about the system / device, let me know if there > is any other data / commands I should run and send over. > > > FreeBSD mininova 9.0-CURRENT FreeBSD 9.0-CURRENT #14: Sat Oct 23 13:11:00 PDT 2010 > > alc0@pci0:1:0:0: class=0x020000 card=0x838a1043 chip=0x10621969 rev=0xc0 hdr=0x00 > vendor = 'Attansic (Now owned by Atheros)' > device = 'Atheros AR8132 PCI-E Fast Ethernet Controller (AR8132)' > class = network > subclass = ethernet > > > alc0: flags=8802 metric 0 mtu 1500 > options=c3198 > ether 20:cf:30:1e:b2:38 > media: Ethernet autoselect > I was not able to reproduce it with sample board so I'm not sure what register access could trigger the stuck. Given that there are some configuration changes in BIOS for better power saving(ASPM) it could be related with accessing ALC_PM_CFG register. I also remember some user reported controller couldn't establish link when system booted without UTP cable plugged in. Not sure this is also the same issue as sample board does not show the issue. Anyway, would you try attached patch? --J2SCkAp4GZ/dPZZf Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="alc.pm.diff" Index: sys/dev/alc/if_alc.c =================================================================== --- sys/dev/alc/if_alc.c (revision 214514) +++ sys/dev/alc/if_alc.c (working copy) @@ -331,8 +331,8 @@ reg = CSR_READ_4(sc, ALC_MAC_CFG); reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB; CSR_WRITE_4(sc, ALC_MAC_CFG, reg); + alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); } - alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); } static void --J2SCkAp4GZ/dPZZf-- From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 17:04:38 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8660F1065672 for ; Fri, 29 Oct 2010 17:04:38 +0000 (UTC) (envelope-from tom@tomjudge.com) Received: from eu1sys200aog102.obsmtp.com (eu1sys200aog102.obsmtp.com [207.126.144.113]) by mx1.freebsd.org (Postfix) with SMTP id 8DE5C8FC0A for ; Fri, 29 Oct 2010 17:04:36 +0000 (UTC) Received: from source ([63.174.175.251]) by eu1sys200aob102.postini.com ([207.126.147.11]) with SMTP ID DSNKTMr+o7tw8Nplz0jCTDNXJy7Er68wp4es@postini.com; Fri, 29 Oct 2010 17:04:37 UTC Received: from [172.17.10.53] (unknown [172.17.10.53]) by bbbx3.usdmm.com (Postfix) with ESMTP id BDE3BFD063; Fri, 29 Oct 2010 17:04:34 +0000 (UTC) Message-ID: <4CCAFE85.10302@tomjudge.com> Date: Fri, 29 Oct 2010 12:04:05 -0500 From: Tom Judge User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.11) Gecko/20101006 Lightning/1.0b2 Thunderbird/3.1.5 MIME-Version: 1.0 To: sbruno@freebsd.org References: <1288204022.3808.191.camel@home-yahoo> In-Reply-To: <1288204022.3808.191.camel@home-yahoo> X-Enigmail-Version: 1.1.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "freebsd-net@freebsd.org" , Sean Bruno Subject: Re: Excessive Duplicate ACKs X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 17:04:38 -0000 On 10/27/2010 01:27 PM, Sean Bruno wrote: > We moved an application stack from BSD4(BOO!) to BSD7(YAY!) recently and > got a great performance increase, so first: GOOD JOB. > > Periodically, we are seeing strings of duplicate ACK being sent in > <100uSec deltas. I can't imagine that this should be happening, but > there it is. I've sanitized an example trace of a transaction, > demonstrating an average case that had 8 dup ACKs, some less than 3 > microsends in delta! sysctl -a also attached (and sanitized). > I saw something like this on FreeBSD 7.1 with an oldish slapd where the daemon was sending very small frames very quickly and the receiver could not keep up and was dropping the frames in the NIC firmware has the host was not draining the receive buffer fast enough. We used wireshark to analyze the flows and it was reporting lots of duplicate ACKs in the capture. Looking more closely at the ACK we saw that all of the reported duplicates where actually SACK frames and wireshark was not smart enough to look into the SACK option and was only processing the ACK sequence number. Later in the flow (microseconds also) we where seeing a fast retransmission of the data between the current ACK sequence number and the SACK start sequence. Maybe you are seeing something similar? Tom > http://people.freebsd.org/~sbruno/dup_ack_collapsed.txt > > http://people.freebsd.org/~sbruno/sysctl_dup_acks.txt > > > Sean > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" -- TJU13-ARIN From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 17:23:52 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A41A106566C for ; Fri, 29 Oct 2010 17:23:52 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout028.mac.com (asmtpout028.mac.com [17.148.16.103]) by mx1.freebsd.org (Postfix) with ESMTP id E2A4F8FC0C for ; Fri, 29 Oct 2010 17:23:51 +0000 (UTC) MIME-version: 1.0 Content-type: text/plain; charset=koi8-r Received: from cswiger1.apple.com ([17.209.4.71]) by asmtp028.mac.com (Sun Java(tm) System Messaging Server 6.3-7.04 (built Sep 26 2008; 64bit)) with ESMTPSA id <0LB200BRTAYW1M10@asmtp028.mac.com> for freebsd-net@freebsd.org; Fri, 29 Oct 2010 10:23:21 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=6.0.2-1004200000 definitions=main-1010290114 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.2.15,1.0.148,0.0.0000 definitions=2010-10-29_09:2010-10-29, 2010-10-29, 1970-01-01 signatures=0 From: Chuck Swiger X-Priority: 3 (Normal) In-reply-to: <606859717.20101029093926@yandex.ru> Date: Fri, 29 Oct 2010 10:23:19 -0700 Content-transfer-encoding: quoted-printable Message-id: References: <1519248747.20101028232111@yandex.ru> <1452146D-A590-4676-A662-14D0EEE82152@mac.com> <606859717.20101029093926@yandex.ru> To: =?utf-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?= X-Mailer: Apple Mail (2.1081) Cc: freebsd-net@freebsd.org Subject: Re: Re[2]: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 17:23:52 -0000 On Oct 28, 2010, at 11:39 PM, =EB=CF=CE=D8=CB=CF=D7 =E5=D7=C7=C5=CE=C9=CA = wrote: > =FA=C4=D2=C1=D7=D3=D4=D7=D5=CA=D4=C5, Chuck. Um, greetings? =20 > =F7=D9 =D0=C9=D3=C1=CC=C9 28 =CF=CB=D4=D1=C2=D2=D1 2010 =C7., = 23:41:58: >=20 > CS> On Oct 28, 2010, at 1:21 PM, =EB=CF=CE=D8=CB=CF=D7 =E5=D7=C7=C5=CE=C9= =CA wrote: >>> [ ... ] >=20 > CS> What is "sysctl kern.clockrate", and have you increased kern.hz > CS> in /boot/loader.conf to at least 1000, if not 2000 or 4000? >=20 > # vmstat -i > interrupt total rate > irq14: ata0 193948 6 > irq16: rl0 42829515 1464 > irq23: nfe0 41224044 1409 > cpu0: timer 58494158 1999 > irq256: igb0 106911 3 > irq257: igb0 254606 8 > irq258: igb0 2 0 > Total 143103184 4892 >=20 > # sysctl kern.clockrate > kern.clockrate: { hz =3D 1000, tick =3D 1000, profhz =3D 2000, stathz = =3D 133 } >=20 > # sysctl kern.hz > kern.hz: 1000 > but I have configured and installed kern with 2000HZ > "systat -v" shows that: 2002 cpu0: time Actually, the interrupt rate is tracking profile hz, which is roughly = double the actual kern.hz-- per sysctl, you should try to at least = double kern.hz. >=20 > CS> Polling mode operation generally performs better when using older > CS> 100Mbs ethernet NICs which do not support interrupt mitigation and > CS> various capabilities like TSO4; gigabit ethernet NICs are smarter > CS> hardware and can generally outperform polling mode. >=20 > so using polling on gigabit NICs is a bottle neck? and is cause of low = performance, is not? Simple answer is yes. It should be possible that you could tune polling = to get similar performance, or at least better performance than you see = now, but the additional hardware capabilities of gigabit NICs are likely = to outperform polling mode, just as polling mode can generally = outperform old 100MBs ethernet NICs. Regards, --=20 -Chuck From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 17:56:29 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A8861065670 for ; Fri, 29 Oct 2010 17:56:29 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward11.mail.yandex.net (forward11.mail.yandex.net [95.108.130.93]) by mx1.freebsd.org (Postfix) with ESMTP id 135E38FC08 for ; Fri, 29 Oct 2010 17:56:28 +0000 (UTC) Received: from smtp13.mail.yandex.net (smtp13.mail.yandex.net [95.108.130.68]) by forward11.mail.yandex.net (Yandex) with ESMTP id 465123ED0103; Fri, 29 Oct 2010 21:56:27 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1288374987; bh=D9AEnxY4IlnSbggMS6zST1fYGZXoBOBdsXg/pD9Ee2w=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=OHSbnv17qNN8SL272WJVBdJgPFw01dRWW72rC3m7wgHoANS++BJhtYUz3MlqplZqt oZRm/JorIPJd2oDwoHZHSefyCy6+OU4vwMp2zJPxTTZEVpt1tfeKwKatzcF25g5AU5 EOb9y5Y9cLliMNmYx3erVAWhduxSZJoYMpjfwXOo= Received: from HOMEUSER (unknown [77.93.42.18]) by smtp13.mail.yandex.net (Yandex) with ESMTPA id BC9B641580AB; Fri, 29 Oct 2010 21:56:26 +0400 (MSD) Date: Fri, 29 Oct 2010 20:56:19 +0300 From: =?koi8-r?B?68/O2MvP1yDl18fFzsnK?= X-Mailer: The Bat! (v4.0.24) Professional Organization: =?koi8-r?B?/vAg68/O2MvP1ywgRnJlZUxpbmU=?= X-Priority: 3 (Normal) Message-ID: <1272786452.20101029205619@yandex.ru> To: Chuck Swiger In-Reply-To: References: <1519248747.20101028232111@yandex.ru> <1452146D-A590-4676-A662-14D0EEE82152@mac.com> <606859717.20101029093926@yandex.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 8bit X-Yandex-TimeMark: 1288374987 X-Yandex-Spam: 1 X-Yandex-Front: smtp13.mail.yandex.net X-Mailman-Approved-At: Fri, 29 Oct 2010 18:01:37 +0000 Cc: freebsd-net@freebsd.org Subject: Re[4]: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?koi8-r?B?68/O2MvP1yDl18fFzsnK?= List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 17:56:29 -0000 Zdravstvuyte, Chuck. (How do you do, Chuck ;-) ÷Ù ÐÉÓÁÌÉ 29 ÏËÔÑÂÒÑ 2010 Ç., 20:23:19: CS> On Oct 28, 2010, at 11:39 PM, ëÏÎØËÏ× å×ÇÅÎÉÊ wrote: >> úÄÒÁ×ÓÔ×ÕÊÔÅ, Chuck. CS> Um, greetings? yes, it is >> ÷Ù ÐÉÓÁÌÉ 28 ÏËÔÑÂÒÑ 2010 Ç., 23:41:58: >> >> CS> On Oct 28, 2010, at 1:21 PM, ëÏÎØËÏ× å×ÇÅÎÉÊ wrote: >>>> [ ... ] >> >> CS> What is "sysctl kern.clockrate", and have you increased kern.hz >> CS> in /boot/loader.conf to at least 1000, if not 2000 or 4000? >> >> # vmstat -i >> interrupt total rate >> irq14: ata0 193948 6 >> irq16: rl0 42829515 1464 >> irq23: nfe0 41224044 1409 >> cpu0: timer 58494158 1999 >> irq256: igb0 106911 3 >> irq257: igb0 254606 8 >> irq258: igb0 2 0 >> Total 143103184 4892 >> >> # sysctl kern.clockrate >> kern.clockrate: { hz = 1000, tick = 1000, profhz = 2000, stathz = 133 } >> >> # sysctl kern.hz >> kern.hz: 1000 >> but I have configured and installed kern with 2000HZ >> "systat -v" shows that: 2002 cpu0: time CS> Actually, the interrupt rate is tracking profile hz, which is CS> roughly double the actual kern.hz-- per sysctl, you should try to at least double kern.hz. ok, I will. >> >> CS> Polling mode operation generally performs better when using older >> CS> 100Mbs ethernet NICs which do not support interrupt mitigation and >> CS> various capabilities like TSO4; gigabit ethernet NICs are smarter >> CS> hardware and can generally outperform polling mode. >> >> so using polling on gigabit NICs is a bottle neck? and is cause of low performance, is not? CS> Simple answer is yes. It should be possible that you could tune CS> polling to get similar performance, or at least better performance CS> than you see now, but the additional hardware capabilities of CS> gigabit NICs are likely to outperform polling mode, just as CS> polling mode can generally outperform old 100MBs ethernet NICs. CS> Regards, -- ó Õ×ÁÖÅÎÉÅÍ, ëÏÎØËÏ× mailto:kes-kes@yandex.ru From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 18:12:58 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AA0B106564A for ; Fri, 29 Oct 2010 18:12:58 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-gw0-f54.google.com (mail-gw0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id E2B7F8FC1C for ; Fri, 29 Oct 2010 18:12:57 +0000 (UTC) Received: by gwaa18 with SMTP id a18so2302787gwa.13 for ; Fri, 29 Oct 2010 11:12:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=Kk0iZFbR/LVKQmo9FL7wSjRe2qP/16USaGrfB7ryPUc=; b=eJgF44brLifIdJSDWwK1KfuP2XjffJpcx7nFnSg142nYo/emQuAoKoK594hiReeORb MjcGud3cMKjYmgnH7nQbdrM/4uNa8Czse/y/3ArTkWKXqV2SXg7iFVjuZr919l0sqg4y 2jv4gDTbDZAEfOFLolDF79hHhKeiMakqhDzB8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=KSMshyodKqU96mr5bd1x5fbN9J2ZxSf5WbbE8RMbKEKNydxdUN6pYCpk+vDSVMWfho mIZaSfoYgNcMoyVMrXOYZwu8O1gZH5KPebWoxlMBTlCpXjrWeqZq4Fp5V13yfg+NxY7T eL4wLzfniSY9Xy18nL55ttkcTeEIrmOZf3cXw= Received: by 10.42.7.211 with SMTP id f19mr6621982icf.458.1288375976927; Fri, 29 Oct 2010 11:12:56 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id 34sm3946344ibi.2.2010.10.29.11.12.52 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Oct 2010 11:12:55 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 29 Oct 2010 11:11:18 -0700 From: Pyun YongHyeon Date: Fri, 29 Oct 2010 11:11:18 -0700 To: =?utf-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?= Message-ID: <20101029181118.GB19479@michelle.cdnetworks.com> References: <1519248747.20101028232111@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1519248747.20101028232111@yandex.ru> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: Re: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 18:12:58 -0000 On Thu, Oct 28, 2010 at 11:21:11PM +0300, ?????????????? ?????????????? wrote: > Hello, > w/0 polling: > > > serv1# ifconfig nfe0 > nfe0: flags=8943 metric 0 mtu 1500 > options=10b > ether 00:13:d4:ce:82:16 > inet 10.11.8.17 netmask 0xfffffc00 broadcast 10.11.11.255 > inet 10.11.15.15 netmask 0xffffff00 broadcast 10.11.15.255 > inet 10.11.8.15 netmask 0xfffffc00 broadcast 10.11.11.255 > media: Ethernet autoselect (1000baseTX ) > status: active > > serv2# ifconfig re0 > re0: flags=8843 metric 0 mtu 1500 > options=389b > ether 00:1c:c0:c8:5a:4e > inet 192.168.255.254 netmask 0xffffffff broadcast 192.168.255.254 > media: Ethernet autoselect (1000baseTX ) > status: active > > > serv1# systat -v > 2 users Load 0.38 0.49 0.38 Oct 28 23:10 > > Mem:KB REAL VIRTUAL VN PAGER SWAP PAGER > Tot Share Tot Share Free in out in out > Act 324452 20196 490400 25112 938576 count > All 346596 21060 1074286k 28104 pages > Proc: Interrupts > r p d s w Csw Trp Sys Int Sof Flt cow 29953 total > 1 47 71k 18 5022 27k 2029 1 zfod atkbd0 1 > ozfod 7 ata0 irq14 > 62.4%Sys 18.7%Intr 0.4%User 0.0%Nice 18.4%Idle %ozfod 27944 nfe0 irq23 > | | | | | | | | | | | daefr 2001 cpu0: time > ===============================++++++++++ prcfr igb0 256 > 1 dtbuf 6 totfr 1 igb0 257 > Namei Name-cache Dir-cache 100000 desvn react igb0 258 > Calls hits % hits % 84106 numvn pdwak > 5 5 100 24824 frevn pdpgs > intrn > Disks ad0 373808 wire > KB/t 16.00 292088 act > tps 7 417568 inact > MB/s 0.10 200 cache > %busy 0 938376 free > > iperf result: > [ ID] Interval Transfer Bandwidth > [ 4] 0.0-10.3 sec 450 MBytes 368 Mbits/sec > > > after enable POLLING: > serv1# ifconfig nfe0 polling > 2 users Load 0.32 0.39 0.35 Oct 28 23:13 > > Mem:KB REAL VIRTUAL VN PAGER SWAP PAGER > Tot Share Tot Share Free in out in out > Act 324464 20196 490656 25112 938428 count > All 346624 21060 1074286k 28104 pages > Proc: Interrupts > r p d s w Csw Trp Sys Int Sof Flt cow 2006 total > 1 47 28k 19 2691 6 2036 2 zfod atkbd0 1 > ozfod 4 ata0 irq14 > 24.7%Sys 18.6%Intr 0.7%User 0.0%Nice 55.9%Idle %ozfod nfe0 irq23 > | | | | | | | | | | | daefr 2001 cpu0: time > ============++++++++++ prcfr igb0 256 > 10 dtbuf 2 totfr 1 igb0 257 > Namei Name-cache Dir-cache 100000 desvn react igb0 258 > Calls hits % hits % 84106 numvn pdwak > 20 20 100 24824 frevn pdpgs > intrn > Disks ad0 373944 wire > KB/t 16.00 292104 act > tps 4 417564 inact > MB/s 0.07 200 cache > %busy 0 938228 free > > I get bad results ((( > [ ID] Interval Transfer Bandwidth > [ 4] 0.0-10.3 sec 180 MBytes 147 Mbits/sec > nfe(4) controllers are one of rare gigabit controllers that lacks efficient interrupt moderation mechanism. So it's normal to see high number of interrupts under load. hz controls how frequently checks controller's RX/TX queue so you may have to increase hz to get reasonable performance under high network load with polling(4). One of important performance factor for NIC is how many frames should be processed for given network load pattern. If you have to process more frames you have to increase hz in polling(4). I don't know what nfe(4) controller you have but it seems it's somewhat low-end model because MSI/MSIX is not used at all. From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 18:19:25 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2271B106564A for ; Fri, 29 Oct 2010 18:19:25 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id CAEF28FC16 for ; Fri, 29 Oct 2010 18:19:24 +0000 (UTC) Received: by ywh2 with SMTP id 2so1693268ywh.13 for ; Fri, 29 Oct 2010 11:19:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=W0iV/PqJQ/18Lh7t36z3Z9BKgjtKI1wq/cUG29DOUmQ=; b=tHZvJIGmygVAjVXw5le4c9BhLEOtIcmN0nuh3BzFGs0Y9Nfuus1So4R/Xw4tUi8i+k 7ChpIPc3CgkHDcDfBMqlRGVEHYfwxSMzg0dS6/UUiICUo4NsfPMlJLz+ROkcEdgQhZov NjYngx0rELiBfZD+eOh3XRzmI9GHP6o0nxzRc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=AZnmkzoMl7tAzxdzXxGVnUhJSoT0dNN457vRYanjuVa1tZGu3kZ9MaYcBRlOfXznul P487sjOAb3EozH2GXLBfm/qZ0XnlCpGO//Z45H53V4s0/fcuF3upw46prOZGttoEWWnO r4hb/xkAXpPhFgx968A8AAQ7kXCgJ7IOzWU2A= Received: by 10.101.69.3 with SMTP id w3mr10577843ank.32.1288376364153; Fri, 29 Oct 2010 11:19:24 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id w15sm2784601anw.13.2010.10.29.11.19.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Oct 2010 11:19:22 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 29 Oct 2010 11:17:45 -0700 From: Pyun YongHyeon Date: Fri, 29 Oct 2010 11:17:45 -0700 To: =?utf-8?B?0JrQvtC90YzQutC+0LIg0JXQstCz0LXQvdC40Lk=?= Message-ID: <20101029181745.GC19479@michelle.cdnetworks.com> References: <364322520.20101029102010@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <364322520.20101029102010@yandex.ru> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org Subject: Re: How to obtain place of low perfomance? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 18:19:25 -0000 On Fri, Oct 29, 2010 at 10:20:10AM +0300, ?????????????? ?????????????? wrote: > Hi, Freebsd-net. > > serv1# ifocnfig nfe0 > nfe0: flags=8943 metric 0 mtu 1500 > options=10b > ether 00:13:d4:ce:82:16 > inet 10.11.8.17 netmask 0xfffffc00 broadcast 10.11.11.255 > inet 10.11.8.15 netmask 0xfffffc00 broadcast 10.11.11.255 > media: Ethernet autoselect (1000baseTX ) > status: active > serv1# ifconfig igb0 > igb0: flags=8843 metric 0 mtu 1500 > options=19b > ether 00:1b:21:45:da:b8 > media: Ethernet autoselect (1000baseTX ) > status: active > serv1# ifconfig vlan7 > vlan7: flags=8843 metric 0 mtu 1500 > options=3 > ether 00:1b:21:45:da:b8 > inet 10.11.15.15 netmask 0xffffff00 broadcast 10.11.15.255 > inet 10.11.7.1 netmask 0xffffff00 broadcast 10.11.7.255 > media: Ethernet autoselect (1000baseTX ) > status: active > vlan: 7 parent interface: igb0 > > doing bw test with iperf it show low performance on nfe0. > > # iperf -c 10.11.8.17 > ------------------------------------------------------------ > Client connecting to 10.11.8.17, TCP port 5001 > TCP window size: 32.5 KByte (default) > ------------------------------------------------------------ > [ 3] local 10.11.8.16 port 63911 connected with 10.11.8.17 port 5001 > [ ID] Interval Transfer Bandwidth > [ 3] 0.0-10.5 sec 124 MBytes 98.8 Mbits/sec > # iperf -c 10.11.7.1 > ------------------------------------------------------------ > Client connecting to 10.11.7.1, TCP port 5001 > TCP window size: 32.5 KByte (default) > ------------------------------------------------------------ > [ 3] local 10.11.7.2 port 61422 connected with 10.11.7.1 port 5001 > [ ID] Interval Transfer Bandwidth > [ 3] 0.0-10.3 sec 800 MBytes 653 Mbits/sec > > despite on it is integrated I expect about 300-400Mbit throughput > does nfe0 really so poor NIC? nfe(4) controllers would not be one of best controllers targeted for server environments but generally it's not poor for desktop users. I mean you should be able to saturate link when you use bulk TCP/UDP transfers. Last time I tried iperf it was not reliable. Did you disable threading of iperf? Also note, both sender/receiver of iperf should be built with same configuration option. From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 18:41:03 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECA8F1065674 for ; Fri, 29 Oct 2010 18:41:03 +0000 (UTC) (envelope-from rfg@tristatelogic.com) Received: from outgoing.tristatelogic.com (segfault.tristatelogic.com [69.62.255.118]) by mx1.freebsd.org (Postfix) with ESMTP id ABBDD8FC24 for ; Fri, 29 Oct 2010 18:41:03 +0000 (UTC) Received: from segfault-nmh-helo.tristatelogic.com (localhost [127.0.0.1]) by segfault.tristatelogic.com (Postfix) with ESMTP id 5EB72BDC46 for ; Fri, 29 Oct 2010 11:24:47 -0700 (PDT) To: freebsd-net@freebsd.org Date: Fri, 29 Oct 2010 11:24:47 -0700 Message-ID: <10398.1288376687@tristatelogic.com> From: "Ronald F. Guilmette" Subject: tftpd - timeouts and possible Denial-Of-Service X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 18:41:04 -0000 Although the tftp protocol has, apparently, been intended from the outset to provide support for finite-time file transfers, I myself would like to see if I can use it in the context of a (near-)continuous streaming data collection application. This raises a number of issues and questions, and I'm hoping that somebody here might have some answers for me. First, with regards to the FreeBSD tftpd daemon, I see that unlike its client counterpart (tftp), this server daemon doesn't, apparently, have any way of specifying any sorts of per-packet or per-transfer timeouts. That naturally makes me wonder whether or not a determined and malicious attacker could perhaps engineer an effective denial of service attack against the tftp daemon, simply by continuously creating new file transfer sessions and then never terminating any of those, thus causing tftpd to use up all of its available file descriptors (and possibly all available file descriptors, system-wide, e.g. if tftpd is running as root). Can anyone here speak to this? Is this a plausible threat? It seems to me that there are only two possibilities here, i.e. either (1) tftpd indeed has no per-transfer timeouts, thus apparently enabling a denial-of-service on the daemon (or the system) via exhaustion of file descriptors or else (b) tftpd does in fact have a built-in per-transfer timeout, but that is entirely undocumented in the man page. Either way, it appears to me that _something_ may perhaps need to get fixed. My second question only comes into play if there is (or will be, in future) some sort of per-transfer timeout implemented within tftpd... and this question may sound more than a bit odd, given that I have just expressed a concern, above, regarding a possible DoS due to the lack of tftpd per- transfer timesouts... Basically, for my application, where I want to use tftpd (together with a client that I myself will be coding from scratch) to do continuous or nearly- continuous data logging, if there is in fact some per-transfer timeout implemented within tftpd, then I would need to know how to defeat it, e.g. so that I could keep a single "file transfer" session/transaction open for, say, 24 hours, continuously. I understand that some may perhaps take umbrage at my desire to make use of the TFTP protocol for a application context that it was never really designed for, but still, this protocol fits, or nearly fits most of my needs, so I would still like to use it anyway, regardless of the history or current common usage. However if the sever side implements no timeouts, I see that as opening up a possible DoS attack hole, whereas if there is, or will be, per-transfer timeouts in tftpd, then for my specific application, I will need to know how to engineer an effective "keep alive" for my particular (long lived) tftp sessions. (And I have some ideas of how such "keep alive" functionality might be implemented in a way that would not do too much violence to the existing protocol, but I'll wait and see what the responses, if any, are to this message before I go off on _that_ tangent.) Regards, rfg P.S. If anyone wants to suggest to me some different sort of streaming protocol for which (a) BSD/Linux servers & clients already exist and are generally available, and which (b) uses UDP in preference to TCP, and which (c) is generally reliable (e.g. retransmittingf dropped packets, when necessary) and which (d) is suitable for low-volume data logging where latency is not at all an issue, then by all means, please proceed and _do_ suggest some alternatives. Keep in mind however that the main reason I am looking in particular at TFTP right now is that it should be quite "trivial" for me to code up my own specialized (embedded?) client. And that's an important consideration. I really don't have the time to code up from scratch any big and complex protocol. From owner-freebsd-net@FreeBSD.ORG Fri Oct 29 18:43:48 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84CB71065694 for ; Fri, 29 Oct 2010 18:43:48 +0000 (UTC) (envelope-from lab@gta.com) Received: from mailgate.gta.com (mailgate.gta.com [199.120.225.20]) by mx1.freebsd.org (Postfix) with SMTP id F0D5C8FC13 for ; Fri, 29 Oct 2010 18:43:47 +0000 (UTC) Received: (qmail 79028 invoked by uid 1000); 29 Oct 2010 18:17:06 -0000 Date: 29 Oct 2010 18:17:06 -0000 Message-ID: <20101029181706.79027.qmail@mailgate.gta.com> From: Larry Baird To: freebsd-net@freebsd.org Organization: Global Technology Associates In-Reply-To: <110929.14152.74663@localhost> User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.3-PRERELEASE (i386)) Cc: ??????? ??????? Subject: Re: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Oct 2010 18:43:48 -0000 Also make sure kern.polling.idle_poll is enabled. By default it is disabled. This makes a big difference in polling throughput. Larry -- ------------------------------------------------------------------------ Larry Baird | http://www.gta.com Global Technology Associates, Inc. | Orlando, FL Email: lab@gta.com | TEL 407-380-0220, FAX 407-380-6080 From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 00:22:11 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B56E0106566B for ; Sat, 30 Oct 2010 00:22:11 +0000 (UTC) (envelope-from RCharlet@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 9A8C78FC14 for ; Sat, 30 Oct 2010 00:22:11 +0000 (UTC) X-ASG-Debug-ID: 1288397229-0d0f044a0001-QdxwpM Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id pznRr7Ek9BgQhEcD for ; Fri, 29 Oct 2010 17:07:09 -0700 (PDT) X-Barracuda-Envelope-From: RCharlet@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Fri, 29 Oct 2010 17:07:10 -0700 From: "Ricky Charlet" X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: "freebsd-net@freebsd.org" Date: Fri, 29 Oct 2010 17:07:07 -0700 X-ASG-Orig-Subj: em driver problem on vmware Thread-Topic: em driver problem on vmware Thread-Index: Act3xmQwhNPUtVupQXOY3cg+llRN9A== Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1288397229 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com Subject: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 00:22:11 -0000 Howdy, I have freebsd80-release with an upgraded em0 driver from freebsd8.= 1 (and an appropriate touch of if_var.h). I'm running an amd64 on a vmware= vm. And I see this in dmesg: ------------cut------------- em0: port 0x2000-203f mem 0xd= 8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 em0: Memory Access and/or Bus Master bits were not set em0: [FILTER] em0: Ethernet address: 00:0c:29:57:d7:7f ------------paste------------ Now, I certainly may have done something wrong with my code switch = (just copied over the sys/dev/e1000 directory from 8.1 and defined drbr_nee= ds_enqueue in if_var.h). I'll start double checking. But, on the other hand, has anyone seen the new em driver working/f= ailing on a vmware vm? Thanks --- Ricky Charlet Adara Networks USA 408-433-4942 From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 00:44:28 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2C55106566B; Sat, 30 Oct 2010 00:44:28 +0000 (UTC) (envelope-from kris@pcbsd.org) Received: from mta21.charter.net (mta21.charter.net [216.33.127.81]) by mx1.freebsd.org (Postfix) with ESMTP id 67FA08FC0C; Sat, 30 Oct 2010 00:44:28 +0000 (UTC) Received: from imp09 ([10.20.200.9]) by mta21.charter.net (InterMail vM.7.09.02.04 201-2219-117-106-20090629) with ESMTP id <20101030004427.BFIB3705.mta21.charter.net@imp09>; Fri, 29 Oct 2010 20:44:27 -0400 Received: from moorefam.homeunix.org ([96.38.85.215]) by imp09 with smtp.charter.net id QokP1f0034elNjk05okQBa; Fri, 29 Oct 2010 20:44:26 -0400 X-Authority-Analysis: v=1.0 c=1 a=kj9zAlcOel0A:10 a=ExQ5TvhgJEjoZYdoVS4A:9 a=yBx2zgVaMOlguUbvEQkA:7 a=KHp1pku8FcG74aDwfMk2DwvG_kIA:4 a=CjuIK1q_8ugA:10 Received: by moorefam.homeunix.org (sSMTP sendmail emulation); Fri, 29 Oct 2010 20:44:22 -0400 Date: Fri, 29 Oct 2010 20:44:22 -0400 From: Kris Moore To: Pyun YongHyeon Message-ID: <20101030004422.GA13657@pcbsd.org> References: <20101029101516.GA66384@pcbsd.org> <20101029165531.GA19479@michelle.cdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101029165531.GA19479@michelle.cdnetworks.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-net@freebsd.org, yongari@freebsd.org Subject: Re: Hardlock with alc0 device X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 00:44:29 -0000 On Fri, Oct 29, 2010 at 09:55:31AM -0700, Pyun YongHyeon wrote: > On Fri, Oct 29, 2010 at 06:15:16AM -0400, Kris Moore wrote: > > > > I'm running into a rather interesting problem here on HEAD with a newer Asus > > EEE PC and the "alc" network driver. The device works great when a > > cable is plugged in, no issues at all. However, if I unplug the ethernet > > and reboot then I get a hard-lock when it tries to bring up the device. > > > > I disabled ifconfig_alc0="DHCP" in rc.conf, and now the system boots > > normally, but just for kicks I tried running "dhclient alc0" on it > > manually, and sure enough it resulted in another system lockup. (No kern dump, > > doesn't even get that far) > > > > Here's some information about the system / device, let me know if there > > is any other data / commands I should run and send over. > > > > > > FreeBSD mininova 9.0-CURRENT FreeBSD 9.0-CURRENT #14: Sat Oct 23 13:11:00 PDT 2010 > > > > alc0@pci0:1:0:0: class=0x020000 card=0x838a1043 chip=0x10621969 rev=0xc0 hdr=0x00 > > vendor = 'Attansic (Now owned by Atheros)' > > device = 'Atheros AR8132 PCI-E Fast Ethernet Controller (AR8132)' > > class = network > > subclass = ethernet > > > > > > alc0: flags=8802 metric 0 mtu 1500 > > options=c3198 > > ether 20:cf:30:1e:b2:38 > > media: Ethernet autoselect > > > > I was not able to reproduce it with sample board so I'm not sure > what register access could trigger the stuck. Given that there are > some configuration changes in BIOS for better power saving(ASPM) it > could be related with accessing ALC_PM_CFG register. > I also remember some user reported controller couldn't establish > link when system booted without UTP cable plugged in. Not sure this > is also the same issue as sample board does not show the issue. > > Anyway, would you try attached patch? > Index: sys/dev/alc/if_alc.c > =================================================================== > --- sys/dev/alc/if_alc.c (revision 214514) > +++ sys/dev/alc/if_alc.c (working copy) > @@ -331,8 +331,8 @@ > reg = CSR_READ_4(sc, ALC_MAC_CFG); > reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB; > CSR_WRITE_4(sc, ALC_MAC_CFG, reg); > + alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); > } > - alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); > } > > static void Well, so far with the attached patch, after a couple reboots, and trying to use dhclient, it's still working fine. Also after the initial dhclient times out I get a link status of "status: no carrier" now, which didn't show up before, so thats good too. Thanks for the quick fix, will you put this into HEAD soon? -- Kris Moore PC-BSD Software From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 01:13:59 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 78E52106564A; Sat, 30 Oct 2010 01:13:59 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pv0-f182.google.com (mail-pv0-f182.google.com [74.125.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id 40F918FC08; Sat, 30 Oct 2010 01:13:59 +0000 (UTC) Received: by pvc22 with SMTP id 22so222448pvc.13 for ; Fri, 29 Oct 2010 18:13:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:from:date:to:cc :subject:message-id:reply-to:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=MeXf745Zk8kh4uMe/1vmmGnuLbgqBMAthi0r0w18Sok=; b=cb78oEOY2EsJ21Jcp/TTJ7Ij+9kDw+6b3sxqPn7Z9+o6FP04Uu9UJu/VnWc60b1C9a XrmqzOnRVRC60XxQRDvQw14bpk2qVGdNZsZXvMfUUv2q9G1zDlNsNDdds6KHeRYmXAcY zL2uKCaRz+Hcf0TqX+r8i3b78aNGi+mABi+yc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=AJJdoOS8w7RtHD+1Spls9MvLE0VfPms3YyHj++BAWd8680+lceAXGY6ZAF3JbTOhnC CQq3Xb74D6gKxJokrneGFPqu1/+St5YYT0eN2Os7P8CfGblPqwhfOGX9/pmM2bwa8qn0 Bx/0Xdb8EtS7hYhePR8VKA/vb/RM4KywUDoAo= Received: by 10.142.177.16 with SMTP id z16mr1985741wfe.214.1288401238553; Fri, 29 Oct 2010 18:13:58 -0700 (PDT) Received: from pyunyh@gmail.com ([174.35.1.224]) by mx.google.com with ESMTPS id w26sm2818052wfd.9.2010.10.29.18.13.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Oct 2010 18:13:57 -0700 (PDT) Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Fri, 29 Oct 2010 18:12:27 -0700 From: Pyun YongHyeon Date: Fri, 29 Oct 2010 18:12:27 -0700 To: Kris Moore Message-ID: <20101030011227.GD19479@michelle.cdnetworks.com> References: <20101029101516.GA66384@pcbsd.org> <20101029165531.GA19479@michelle.cdnetworks.com> <20101030004422.GA13657@pcbsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101030004422.GA13657@pcbsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-net@freebsd.org, yongari@freebsd.org Subject: Re: Hardlock with alc0 device X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: pyunyh@gmail.com List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 01:13:59 -0000 On Fri, Oct 29, 2010 at 08:44:22PM -0400, Kris Moore wrote: > On Fri, Oct 29, 2010 at 09:55:31AM -0700, Pyun YongHyeon wrote: > > On Fri, Oct 29, 2010 at 06:15:16AM -0400, Kris Moore wrote: > > > > > > I'm running into a rather interesting problem here on HEAD with a newer Asus > > > EEE PC and the "alc" network driver. The device works great when a > > > cable is plugged in, no issues at all. However, if I unplug the ethernet > > > and reboot then I get a hard-lock when it tries to bring up the device. > > > > > > I disabled ifconfig_alc0="DHCP" in rc.conf, and now the system boots > > > normally, but just for kicks I tried running "dhclient alc0" on it > > > manually, and sure enough it resulted in another system lockup. (No kern dump, > > > doesn't even get that far) > > > > > > Here's some information about the system / device, let me know if there > > > is any other data / commands I should run and send over. > > > > > > > > > FreeBSD mininova 9.0-CURRENT FreeBSD 9.0-CURRENT #14: Sat Oct 23 13:11:00 PDT 2010 > > > > > > alc0@pci0:1:0:0: class=0x020000 card=0x838a1043 chip=0x10621969 rev=0xc0 hdr=0x00 > > > vendor = 'Attansic (Now owned by Atheros)' > > > device = 'Atheros AR8132 PCI-E Fast Ethernet Controller (AR8132)' > > > class = network > > > subclass = ethernet > > > > > > > > > alc0: flags=8802 metric 0 mtu 1500 > > > options=c3198 > > > ether 20:cf:30:1e:b2:38 > > > media: Ethernet autoselect > > > > > > > I was not able to reproduce it with sample board so I'm not sure > > what register access could trigger the stuck. Given that there are > > some configuration changes in BIOS for better power saving(ASPM) it > > could be related with accessing ALC_PM_CFG register. > > I also remember some user reported controller couldn't establish > > link when system booted without UTP cable plugged in. Not sure this > > is also the same issue as sample board does not show the issue. > > > > Anyway, would you try attached patch? > > > Index: sys/dev/alc/if_alc.c > > =================================================================== > > --- sys/dev/alc/if_alc.c (revision 214514) > > +++ sys/dev/alc/if_alc.c (working copy) > > @@ -331,8 +331,8 @@ > > reg = CSR_READ_4(sc, ALC_MAC_CFG); > > reg |= MAC_CFG_TX_ENB | MAC_CFG_RX_ENB; > > CSR_WRITE_4(sc, ALC_MAC_CFG, reg); > > + alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); > > } > > - alc_aspm(sc, IFM_SUBTYPE(mii->mii_media_active)); > > } > > > > static void > > Well, so far with the attached patch, after a couple reboots, and trying to use dhclient, it's still working fine. Also after the initial dhclient times out I get a link status of "status: no carrier" now, which didn't show up > before, so thats good too. > Thanks a lot for testing! > Thanks for the quick fix, will you put this into HEAD soon? > Patch committed(r214542). From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 01:42:11 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B22D106564A for ; Sat, 30 Oct 2010 01:42:11 +0000 (UTC) (envelope-from RCharlet@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 7BF9A8FC0C for ; Sat, 30 Oct 2010 01:42:11 +0000 (UTC) X-ASG-Debug-ID: 1288402051-0d0f04d30001-QdxwpM Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id yMwgw9gGrv2f169m for ; Fri, 29 Oct 2010 18:27:31 -0700 (PDT) X-Barracuda-Envelope-From: RCharlet@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Fri, 29 Oct 2010 18:27:31 -0700 From: "Ricky Charlet" X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: "Ricky Charlet" , "freebsd-net@freebsd.org" Date: Fri, 29 Oct 2010 18:27:30 -0700 X-ASG-Orig-Subj: RE: em driver problem on vmware Thread-Topic: em driver problem on vmware Thread-Index: Act3xmQwhNPUtVupQXOY3cg+llRN9AACuemQ Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7DF@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1288402051 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com Cc: Subject: RE: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 01:42:11 -0000 FYI, That dmesg output I get from my franken-driver on vmware is exactly the sam= e output I get from the *working* bsd80Release on vmware: ------------cut-------------------- [root@npx7511 /usr/src/sys/dev/e1000]# dmesg | grep em0 em0: port 0x2000-0x203f mem 0= xd8940000-0xd895ffff,0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 em0: Memory Access and/or Bus Master bits were not set! em0: [FILTER] em0: Ethernet address: 00:0c:29:57:d7:7f -----------paste------------------- So I don't think the clue is hiding in dmesg. --- Ricky Charlet Adara Networks USA 408-433-4942 -----Original Message----- From: owner-freebsd-net@freebsd.org [mailto:owner-freebsd-net@freebsd.org] = On Behalf Of Ricky Charlet Sent: Friday, October 29, 2010 5:07 PM To: freebsd-net@freebsd.org Subject: em driver problem on vmware Howdy, I have freebsd80-release with an upgraded em0 driver from freebsd8.= 1 (and an appropriate touch of if_var.h). I'm running an amd64 on a vmware= vm. And I see this in dmesg: ------------cut------------- em0: port 0x2000-203f mem 0xd= 8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 em0: Memory Access and/or Bus Master bits were not set em0: [FILTER] em0: Ethernet address: 00:0c:29:57:d7:7f ------------paste------------ Now, I certainly may have done something wrong with my code switch = (just copied over the sys/dev/e1000 directory from 8.1 and defined drbr_nee= ds_enqueue in if_var.h). I'll start double checking. But, on the other hand, has anyone seen the new em driver working/f= ailing on a vmware vm? Thanks --- Ricky Charlet Adara Networks USA 408-433-4942 _______________________________________________ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 02:12:43 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACEAA106566B for ; Sat, 30 Oct 2010 02:12:43 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 3932C8FC16 for ; Sat, 30 Oct 2010 02:12:42 +0000 (UTC) Received: by wwi17 with SMTP id 17so2534663wwi.31 for ; Fri, 29 Oct 2010 19:12:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=a5uAItZGiKXUZQm6iL6nLtuW8rH3yULzFWaCJ+0TapY=; b=bj6TZQpSQdNHwl0uyGrbqBw/5UzuNXufsWNwDhPnjt+fS8N7u5KvkA4QtJqchFo3EL jNc9JppMB+3Jw/aG7lhZ9+p5gvJpSKnS7wJsngf2bUPq6mDsxR5aZPiaKIsap5BWMyyQ g2r/BmO+Hi85umzBVwBt/32ZvNsYx0+sT7/2A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=DWKve1nuQOIeZ/KqzdsChi2reuphSFNkhvd9E2uGaeDfe+zUSZM6xUVvK1MCTFftNn 38DIfEydTg19ki6tho6kIPFoPGDnYw61Sx1THeFZV8jZRxAbA3EirZVUbSna0nxYAA4Z xWLfuQcSErTMEitAbKxbYMJsMX00Mlepg7Eu0= MIME-Version: 1.0 Received: by 10.216.175.83 with SMTP id y61mr12786790wel.30.1288404761258; Fri, 29 Oct 2010 19:12:41 -0700 (PDT) Received: by 10.216.80.140 with HTTP; Fri, 29 Oct 2010 19:12:41 -0700 (PDT) In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7DF@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7DF@SJ-EXCH-1.adaranet.com> Date: Fri, 29 Oct 2010 19:12:41 -0700 Message-ID: From: Jack Vogel To: Ricky Charlet Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-net@freebsd.org" Subject: Re: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 02:12:43 -0000 I remember seeing the same thing when running a FreeBSD guest on Linux/KVM, its informational, the code will enable said bits right after it says that. So, the focus should be on the data, you are saying the delivered driver in 8.0 out of the box works and which driver exactly are you trying to use, my last checked in? More on the failure, does it ping, does its link partner see anything, etc, etc.. Jack On Fri, Oct 29, 2010 at 6:27 PM, Ricky Charlet wrote: > FYI, > That dmesg output I get from my franken-driver on vmware is exactly the > same output I get from the *working* bsd80Release on vmware: > > ------------cut-------------------- > [root@npx7511 /usr/src/sys/dev/e1000]# dmesg | grep em0 > em0: port 0x2000-0x203f mem > 0xd8940000-0xd895ffff,0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 > em0: Memory Access and/or Bus Master bits were not set! > em0: [FILTER] > em0: Ethernet address: 00:0c:29:57:d7:7f > -----------paste------------------- > > > So I don't think the clue is hiding in dmesg. > > --- > Ricky Charlet > Adara Networks > USA 408-433-4942 > > > -----Original Message----- > From: owner-freebsd-net@freebsd.org [mailto:owner-freebsd-net@freebsd.org] > On Behalf Of Ricky Charlet > Sent: Friday, October 29, 2010 5:07 PM > To: freebsd-net@freebsd.org > Subject: em driver problem on vmware > > Howdy, > I have freebsd80-release with an upgraded em0 driver from freebsd8.1 > (and an appropriate touch of if_var.h). I'm running an amd64 on a vmware > vm. And I see this in dmesg: > > ------------cut------------- > em0: port 0x2000-203f mem > 0xd8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 > em0: Memory Access and/or Bus Master bits were not set > em0: [FILTER] > em0: Ethernet address: 00:0c:29:57:d7:7f > ------------paste------------ > > Now, I certainly may have done something wrong with my code switch > (just copied over the sys/dev/e1000 directory from 8.1 and defined > drbr_needs_enqueue in if_var.h). I'll start double checking. > > But, on the other hand, has anyone seen the new em driver > working/failing on a vmware vm? > > > Thanks > > > --- > Ricky Charlet > Adara Networks > USA 408-433-4942 > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 02:20:07 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 21ACA1065670 for ; Sat, 30 Oct 2010 02:20:07 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-yx0-f182.google.com (mail-yx0-f182.google.com [209.85.213.182]) by mx1.freebsd.org (Postfix) with ESMTP id D2AAE8FC15 for ; Sat, 30 Oct 2010 02:20:06 +0000 (UTC) Received: by yxl31 with SMTP id 31so2513238yxl.13 for ; Fri, 29 Oct 2010 19:20:06 -0700 (PDT) Received: by 10.150.198.19 with SMTP id v19mr86492ybf.336.1288403748397; Fri, 29 Oct 2010 18:55:48 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.236.103.139 with HTTP; Fri, 29 Oct 2010 18:55:28 -0700 (PDT) In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> From: Juli Mallett Date: Fri, 29 Oct 2010 18:55:28 -0700 X-Google-Sender-Auth: I8ksIAFo1FOw-XqR57fvLQ9Q_nw Message-ID: To: Ricky Charlet Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-net@freebsd.org" Subject: Re: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 02:20:07 -0000 On Fri, Oct 29, 2010 at 17:07, Ricky Charlet wrote= : > Howdy, > =A0 =A0 =A0 =A0I have freebsd80-release with an upgraded em0 driver from = freebsd8.1 (and an appropriate touch of if_var.h). I'm running an amd64 on = a =A0vmware vm. =A0And I see this in dmesg: > > ------------cut------------- > em0: port 0x2000-203f mem 0= xd8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 > em0: Memory Access and/or Bus Master bits were not set > em0: [FILTER] > em0: Ethernet address: 00:0c:29:57:d7:7f > ------------paste------------ > > =A0 =A0 =A0 =A0But, on the other hand, has anyone seen the new em driver = working/failing on a vmware vm? "Memory Access and/or Bus Master bits were not set" is not a fatal error, it is correctable, indeed that is printed out when it is corrected; that is not something to worry about in and of itself as such, are you actually having a problem or just concerned because you saw that in dmesg? From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 02:42:11 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 87F8A1065670 for ; Sat, 30 Oct 2010 02:42:11 +0000 (UTC) (envelope-from RCharlet@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 6866D8FC12 for ; Sat, 30 Oct 2010 02:42:11 +0000 (UTC) X-ASG-Debug-ID: 1288404202-0d0f05240001-QdxwpM Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id ARmuZAoiqI7nIAVG; Fri, 29 Oct 2010 19:03:22 -0700 (PDT) X-Barracuda-Envelope-From: RCharlet@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Fri, 29 Oct 2010 19:03:22 -0700 From: "Ricky Charlet" X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Juli Mallett Date: Fri, 29 Oct 2010 19:03:21 -0700 X-ASG-Orig-Subj: RE: em driver problem on vmware Thread-Topic: em driver problem on vmware Thread-Index: Act31ZQndnSu3rnWTEC6BSIcrR2fuwAANDrA Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7E0@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1288404202 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com Cc: "freebsd-net@freebsd.org" Subject: RE: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 02:42:11 -0000 > -----Original Message----- > From: juli@clockworksquid.com [mailto:juli@clockworksquid.com] On > Behalf Of Juli Mallett > Sent: Friday, October 29, 2010 6:55 PM > To: Ricky Charlet > Cc: freebsd-net@freebsd.org > Subject: Re: em driver problem on vmware > > On Fri, Oct 29, 2010 at 17:07, Ricky Charlet > wrote: > > Howdy, > > I have freebsd80-release with an upgraded em0 driver from > freebsd8.1 (and an appropriate touch of if_var.h). I'm running an amd64 > on a vmware vm. And I see this in dmesg: > > > > ------------cut------------- > > em0: port 0x2000-203f > mem 0xd8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 > on pci2 > > em0: Memory Access and/or Bus Master bits were not set > > em0: [FILTER] > > em0: Ethernet address: 00:0c:29:57:d7:7f > > ------------paste------------ > > > > But, on the other hand, has anyone seen the new em driver > working/failing on a vmware vm? > > "Memory Access and/or Bus Master bits were not set" is not a fatal > error, it is correctable, indeed that is printed out when it is > corrected; that is not something to worry about in and of itself as > such, are you actually having a problem or just concerned because you > saw that in dmesg? It is truly not working. I agree those lines in dmesg are good and indicat= e em0 is ready. but `ifconfig` does not see em0. --- Ricky Charlet Adara Networks USA 408-433-4942 From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 02:22:44 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FB84106566C for ; Sat, 30 Oct 2010 02:22:44 +0000 (UTC) (envelope-from RCharlet@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id E1F058FC0A for ; Sat, 30 Oct 2010 02:22:43 +0000 (UTC) X-ASG-Debug-ID: 1288405362-0d0f055d0001-QdxwpM Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id FBxPF3EfyouHni7r; Fri, 29 Oct 2010 19:22:42 -0700 (PDT) X-Barracuda-Envelope-From: RCharlet@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Fri, 29 Oct 2010 19:22:42 -0700 From: "Ricky Charlet" X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Jack Vogel Date: Fri, 29 Oct 2010 19:22:41 -0700 X-ASG-Orig-Subj: RE: em driver problem on vmware Thread-Topic: em driver problem on vmware Thread-Index: Act31/DPHrONVwRPSea7Uf3+y7JnjgAADD/w Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7E3@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7DF@SJ-EXCH-1.adaranet.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/mixed; boundary="_004_32AB5C9615CC494997D9ABB1DB12783C024CA4A7E3SJEXCH1adaran_" MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1288405362 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com X-Barracuda-Spam-Score: -1001.00 X-Barracuda-Spam-Status: No, SCORE=-1001.00 using global scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.5 X-Mailman-Approved-At: Sat, 30 Oct 2010 02:55:51 +0000 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: "freebsd-net@freebsd.org" Subject: RE: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 02:22:44 -0000 --_004_32AB5C9615CC494997D9ABB1DB12783C024CA4A7E3SJEXCH1adaran_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks Jack, The failure is that ifconfig is unaware of em0. My em0 is = not configured, so link partners are also unaware of it. ifconfig em0 ifconfig: interface em0 does not exist and you already have my dmes stuff on em0 (which I am now up to agreeing lo= oks positive and would not indicate a problem) My amalgamated file is a private combination of some 8.1, some 9.0, some st= uff a cohort did. We have been motivated to 'upgrade' from e1000 in 8.0 to= a newer/modified e1000 because of our desire to incorporate the altq patch= es. For the curious and the diligent, the e1000/if_em.c file I = am using is attached. Ricky From: Jack Vogel [mailto:jfvogel@gmail.com] Sent: Friday, October 29, 2010 7:13 PM To: Ricky Charlet Cc: freebsd-net@freebsd.org Subject: Re: em driver problem on vmware I remember seeing the same thing when running a FreeBSD guest on Linux/KVM, its informational, the code will enable said bits right after it says that. So, the focus should be on the data, you are saying the delivered driver in 8.0 out of the box works and which driver exactly are you trying to use, my last checked in? More on the failure, does it ping, does its link partner see anything, etc, etc.. Jack On Fri, Oct 29, 2010 at 6:27 PM, Ricky Charlet > wrote: FYI, That dmesg output I get from my franken-driver on vmware is exactly the sam= e output I get from the *working* bsd80Release on vmware: ------------cut-------------------- [root@npx7511 /usr/src/sys/dev/e1000]# dmesg | grep em0 em0: port 0x2000-0x203f mem 0= xd8940000-0xd895ffff,0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 em0: Memory Access and/or Bus Master bits were not set! em0: [FILTER] em0: Ethernet address: 00:0c:29:57:d7:7f -----------paste------------------- So I don't think the clue is hiding in dmesg. --- Ricky Charlet Adara Networks USA 408-433-4942 -----Original Message----- From: owner-freebsd-net@freebsd.org [= mailto:owner-freebsd-net@freebsd.org]= On Behalf Of Ricky Charlet Sent: Friday, October 29, 2010 5:07 PM To: freebsd-net@freebsd.org Subject: em driver problem on vmware Howdy, I have freebsd80-release with an upgraded em0 driver from freebsd8.1= (and an appropriate touch of if_var.h). I'm running an amd64 on a vmware = vm. And I see this in dmesg: ------------cut------------- em0: port 0x2000-203f mem 0xd= 8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 em0: Memory Access and/or Bus Master bits were not set em0: [FILTER] em0: Ethernet address: 00:0c:29:57:d7:7f ------------paste------------ Now, I certainly may have done something wrong with my code switch (= just copied over the sys/dev/e1000 directory from 8.1 and defined drbr_need= s_enqueue in if_var.h). I'll start double checking. But, on the other hand, has anyone seen the new em driver working/fa= iling on a vmware vm? Thanks --- Ricky Charlet Adara Networks USA 408-433-4942 _______________________________________________ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" _______________________________________________ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" --_004_32AB5C9615CC494997D9ABB1DB12783C024CA4A7E3SJEXCH1adaran_ Content-Type: text/plain; name="if_em.c" Content-Description: if_em.c Content-Disposition: attachment; filename="if_em.c"; size=152527; creation-date="Fri, 29 Oct 2010 19:18:38 GMT"; modification-date="Sun, 03 Oct 2010 11:39:16 GMT" Content-Transfer-Encoding: base64 LyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKgoKICBDb3B5cmlnaHQgKGMpIDIwMDEtMjAxMCwgSW50ZWwg Q29ycG9yYXRpb24gCiAgQWxsIHJpZ2h0cyByZXNlcnZlZC4KICAKICBSZWRpc3RyaWJ1dGlvbiBh bmQgdXNlIGluIHNvdXJjZSBhbmQgYmluYXJ5IGZvcm1zLCB3aXRoIG9yIHdpdGhvdXQgCiAgbW9k aWZpY2F0aW9uLCBhcmUgcGVybWl0dGVkIHByb3ZpZGVkIHRoYXQgdGhlIGZvbGxvd2luZyBjb25k aXRpb25zIGFyZSBtZXQ6CiAgCiAgIDEuIFJlZGlzdHJpYnV0aW9ucyBvZiBzb3VyY2UgY29kZSBt dXN0IHJldGFpbiB0aGUgYWJvdmUgY29weXJpZ2h0IG5vdGljZSwgCiAgICAgIHRoaXMgbGlzdCBv ZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93aW5nIGRpc2NsYWltZXIuCiAgCiAgIDIuIFJlZGlz dHJpYnV0aW9ucyBpbiBiaW5hcnkgZm9ybSBtdXN0IHJlcHJvZHVjZSB0aGUgYWJvdmUgY29weXJp Z2h0IAogICAgICBub3RpY2UsIHRoaXMgbGlzdCBvZiBjb25kaXRpb25zIGFuZCB0aGUgZm9sbG93 aW5nIGRpc2NsYWltZXIgaW4gdGhlIAogICAgICBkb2N1bWVudGF0aW9uIGFuZC9vciBvdGhlciBt YXRlcmlhbHMgcHJvdmlkZWQgd2l0aCB0aGUgZGlzdHJpYnV0aW9uLgogIAogICAzLiBOZWl0aGVy IHRoZSBuYW1lIG9mIHRoZSBJbnRlbCBDb3Jwb3JhdGlvbiBub3Igd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ioqKioqKioqKiovCmludAllbV9kaXNwbGF5X2RlYnVnX3N0YXRzID0gMDsKCi8qKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioKICogIERyaXZlciB2ZXJzaW9uOgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpjaGFyIGVtX2RyaXZlcl92ZXJz aW9uW10gPSAiNy4wLjUiOwoKCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICogIFBDSSBEZXZpY2UgSUQgVGFibGUK ICoKICogIFVzZWQgYnkgcHJvYmUgdG8gc2VsZWN0IGRldmljZXMgdG8gbG9hZCBvbgogKiAgTGFz dCBmaWVsZCBzdG9yZXMgYW4gaW5kZXggaW50byBlMTAwMF9zdHJpbmdzCiAqICBMYXN0IGVudHJ5 IG11c3QgYmUgYWxsIDBzCiAqCiAqICB7IFZlbmRvciBJRCwgRGV2aWNlIElELCBTdWJWZW5kb3Ig SUQsIFN1YkRldmljZSBJRCwgU3RyaW5nIEluZGV4IH0KICoqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KCnN0YXRpYyBl bV92ZW5kb3JfaW5mb190IGVtX3ZlbmRvcl9pbmZvX2FycmF5W10gPQp7CgkvKiBJbnRlbChSKSBQ Uk8vMTAwMCBOZXR3b3JrIENvbm5lY3Rpb24gKi8KCXsgMHg4MDg2LCBFMTAwMF9ERVZfSURfODI1 NzFFQl9DT1BQRVIsCVBDSV9BTllfSUQsIFBDSV9BTllfSUQsIDB9LAoJeyAweDgwODYsIEUxMDAw X0RFVl9JRF84MjU3MUVCX0ZJQkVSLAlQQ0lfQU5ZX0lELCBQQ0lfQU5ZX0lELCAwfSwKCXsgMHg4 MDg2LCBFMTAwM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VWX0lEX1BDSF9EX0hWX0RDLAlQQ0lfQU5ZX0lELCBQQ0lfQU5ZX0lE LCAwfSwKCS8qIHJlcXVpcmVkIGxhc3QgZW50cnkgKi8KCXsgMCwgMCwgMCwgMCwgMH0KfTsKCi8q KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioKICogIFRhYmxlIG9mIGJyYW5kaW5nIHN0cmluZ3MgZm9yIGFsbCBzdXBwb3J0 ZWQgTklDcy4KICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKi8KCnN0YXRpYyBjaGFyICplbV9zdHJpbmdzW10gPSB7Cgki SW50ZWwoUikgUFJPLzEwMDAgTmV0d29yayBDb25uZWN0aW9uIgp9OwoKLyoqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgog KiAgRnVuY3Rpb24gcHJvdG90eXBlcwogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpzdGF0aWMgaW50CWVtX3Byb2Jl KGRldmljZV90KTsKc3RhdGljIGludAllbV9hdHRhY2goZGV2aWNlX3QpOwpzdGF0aWMgaW50CWVt X2RldGFjaChkZXZpY2VfdCk7CnN0YXRpYyBpbnQJZW1fc2h1dGRvd24oZGV2aWNlX3QpOwpzdGF0 aWMgaW50CWVtX3N1c3BlbmQoZGV2aWNlX3QpOwpzdGF0aWMgaW50CWVtX3Jlc3VtZShkZXZpY2Vf dCk7CnN0YXRpYyB2b2lkCWVtX3N0YXJ0KHN0cnVjdCBpZm5ldCAqKTsKc3RhdGljIHZvaWQJZW1f c3RhcnRfbG9ja2VkKHN0cnVjdCBpZm5ldCAqLCBzdHJ1Y3QgdHhfcmluZyAqKTsKI2lmZGVmIEVN X01VTFRJUVVFVUUKc3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t X3BvbGw7CiNlbmRpZiAvKiBQT0xMSU5HICovCgovKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCiAqICBGcmVlQlNEIERl dmljZSBJbnRlcmZhY2UgRW50cnkgUG9pbnRzCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCgpzdGF0aWMgZGV2aWNl X21ldGhvZF90IGVtX21ldGhvZHNbXSA9IHsKCS8qIERldmljZSBpbnRlcmZhY2UgKi8KCURFVk1F VEhPRChkZXZpY2VfcHJvYmUsIGVtX3Byb2JlKSwKCURFVk1FVEhPRChkZXZpY2VfYXR0YWNoLCBl bV9hdHRhY2gpLAoJREVWTUVUSE9EKGRldmljZV9kZXRhY2gsIGVtX2RldGFjaCksCglERVZNRVRI T0QoZGV2aWNlX3NodXRkb3duLCBlbV9zaHV0ZG93biksCglERVZNRVRIT0QoZGV2aWNlX3N1c3Bl bmQsIGVtX3N1c3BlbmQpLAoJREVWTUVUSE9EKGRldmljZV9yZXN1bWUsIGVtX3Jlc3VtZSksCgl7 MCwgMH0KfTsKCnN0YXRpYyBkcml2ZXJfdCBlbV9kcml2ZXIgPSB7CgkiZW0iLCBlbV9tZXRob2Rz LCBzaXplb2Yoc3RydWN0IGFkYXB0ZXIpLAp9OwoKZGV2Y2xhc3NfdCBlbV9kZXZjbGFzczsKRFJJ VkVSX01PRFVMRShlbSwgcGNpLCBlbV9kcml2ZXIsIGVtX2RldmNsYXNzLCAwLCAwKTsKTU9EVUxF X0RFUEVORChlbSwgcGNpLCAxLCAxLCAxKTsKTU9EVUxFX0RFUEVORChlbSwgZXRoZXIsIDEsIDEs IDEpOwoKLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKgogKiAgVHVuYWJsZSBkZWZhdWx0IHZhbHVlcy4KIC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lIHRoaXMgaW50ZXJydXB0ICovCgkJRTEwMDBfV1JJVEVfUkVHKCZhZGFwdGVyLT5odywgRTEw MDBfSU1TLCB0eHItPmltcyk7CglyZXR1cm47Cn0KCi8qKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICoKICogIE1TSVgg UlggSW50ZXJydXB0IFNlcnZpY2Ugcm91dGluZQogKgogKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KCnN0YXRpYyB2 b2lkCmVtX21zaXhfcngodm9pZCAqYXJnKQp7CglzdHJ1Y3QgcnhfcmluZwkqcnhyID0gYXJnOwoJ c3RydWN0IGFkYXB0ZXIJKmFkYXB0ZXIgPSByeHItPmFkYXB0ZXI7Cglib29sCQltb3JlOwoKCSsr cnhyLT5yeF9pcnE7Cgltb3JlID0gZW1fcnhlb2YocnhyLCBhZGFwdGVyLT5yeF9wcm9jZXNzX2xp bWl0LCBOVUxMKTsKCWlmIChtb3JlKQoJCXRhc2txdWV1ZV9lbnF1ZXVlKHJ4ci0+dHEsICZyeHIt PnJ4X3Rhc2spOwoJZWxzZQoJCS8qIFJlZW5hYmxlIHRoaXMgaW50ZXJydXB0ICovCgkJRTEwMDBf V1JJVEVfUkVHKCZhZGFwdGVyLT5odywgRTEwMDBfSU1TLCByeHItPmltcyk7CglyZXR1cm47Cn0K Ci8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioKICoKICogIE1TSVggTGluayBGYXN0IEludGVycnVwdCBTZXJ2aWNlIHJv dXRpbmUKICoKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKiovCnN0YXRpYyB2b2lkCmVtX21zaXhfbGluayh2b2lkICph cmcpCnsKCXN0cnVjdCBhZG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ldiwg U1lTX1JFU19NRU1PUlksCgkgICAgJnJpZCwgUkZfQUNUSVZFKTsKCWlmIChhZGFwdGVyLT5tZW1v cnkgPT0gTlVMTCkgewoJCWRldmljZV9wcmludGYoZGV2LCAiVW5hYmxlIHRvIGFsbG9jYXRlIGJ1 cyByZXNvdXJjZTogbWVtb3J5XG4iKTsKCQlyZXR1cm4gKEVOWElPKTsKCX0KCWFkYXB0ZXItPm9z ZGVwLm1lbV9idXNfc3BhY2VfdGFnID0KCSAgICBybWFuX2dldF9idXN0YWcoYWRhcHRlci0+bWVt b3J5KTsKCWFkYXB0ZXItPm9zZGVwLm1lbV9idXNfc3BhY2VfaGFuZGxlID0KCSAgICBybWFuX2dl dF9idXNoYW5kbGUoYWRhcHRlci0+bWVtb3J5KTsKCWFkYXB0ZXItPmh3Lmh3X2FkZHIgPSAodTgg KikmYWRhcHRlci0+b3NkZXAubWVtX2J1c19zcGFjZV9oYW5kbGU7CgoJLyogRGVmYXVsdCB0byBh IHNpbmdsZSBxdWV1ZSAqLwoJYWRhcHRlci0+bnVtX3F1ZXVlcyA9IDE7CgoJLyoKCSAqIFNldHVw IE1TSS9YIG9yIE1TSSBpZiBQQ0kgRXhwcmVzcwoJICovCglhZGFwdGVyLT5tc2l4ID0gZW1fc2V0 dXBfbXNpeChhZGFwdGVyKTsKCglhZGFwdGVyLT5ody5iYWNrID0gJmFkYXB0ZXItPm9zZGVwOwoK CXJldHVybiAoMCk7Cn0KCi8qKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICoKICogIFNldHVwIHRoZSBMZWdhY3kgb3Ig TVNJIEludGVycnVwdCBoYW5kbGVyCiAqCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwppbnQKZW1fYWxsb2NhdGVf bGVnYWN5KHN0cnVjdCBhZGFwdGVyICphZGFwdGVyKQp7C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GhyZWFkcygmYWRhcHRl ci0+dHEsIDEsIFBJX05FVCwgIiVzIHRhc2txIiwKCSAgICBkZXZpY2VfZ2V0X25hbWV1bml0KGFk YXB0ZXItPmRldikpOwoJaWYgKChlcnJvciA9IGJ1c19zZXR1cF9pbnRyKGRldiwgYWRhcHRlci0+ cmVzLCBJTlRSX1RZUEVfTkVULAoJICAgIGVtX2lycV9mYXN0LCBOVUxMLCBhZGFwdGVyLCAmYWRh cHRlci0+dGFnKSkgIT0gMCkgewoJCWRldmljZV9wcmludGYoZGV2LCAiRmFpbGVkIHRvIHJlZ2lz dGVyIGZhc3QgaW50ZXJydXB0ICIKCQkJICAgICJoYW5kbGVyOiAlZFxuIiwgZXJyb3IpOwoJCXRh c2txdWV1ZV9mcmVlKGFkYXB0ZXItPnRxKTsKCQlhZGFwdGVyLT50cSA9IE5VTEw7CgkJcmV0dXJu IChlcnJvcik7Cgl9CgkKCXJldHVybiAoMCk7Cn0KCi8qKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKICoKICogIFNldHVw IHRoZSBNU0lYIEludGVycnVwdCBoYW5kbGVycwogKiAgIFRoaXMgaXMgbm90IHJlYWxseSBNdWx0 aXF1ZXVlLCByYXRoZXIKICogICBpdHMganVzdCBtdWx0aXBsZSBpbnRlcnJ1cHQgdmVjdG9ycy4K ICoKICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKiovCmludAplbV9hbGxvY2F0ZV9tc2l4KHN0cnVjdCBhZGFwdGVyICph ZGFwdGVyKQp7CglkZXZpY2VfdAlkZXYgPSBhZGFwdGVyLT5kZXY7CglzdHJ1Y3QJCXR4X3Jpbmcg KnR4ciA9IGFkYXB0ZXItPnR4X3JpbmdzOwoJc3RydWN0CQlyeF9yaW5nICpyeHIgPSBhZGFwdGVy LT5yeF9yaW5nczsKCWludAkJZXJyb3IsI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Rldiwg JnZhbCkgPT0gMCkgewogICAgICAgICAgICAgICAJYWRhcHRlci0+bXNpeCA9IDE7CiAgICAgICAg ICAgICAgIAlkZXZpY2VfcHJpbnRmKGFkYXB0ZXItPmRldiwiVXNpbmcgTVNJIGludGVycnVwdFxu Iik7CgkJcmV0dXJuICh2YWwpOwoJfSAKCS8qIFNob3VsZCBvbmx5IGhhcHBlbiBkdWUgdG8gbWFu dWFsIGludmVudGlvbiAqLwoJZGV2aWNlX3ByaW50ZihhZGFwdGVyLT5kZXYsIlNldHVwIE1TSVgg ZmFpbHVyZVxuIik7CglyZXR1cm4gKDApOwp9CgoKLyoqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogKgogKiAgSW5pdGlh bGl6ZSB0aGUgaGFyZHdhcmUgdG8gYSBjb25maWd1cmF0aW9uCiAqICBhcyBzcGVjaWZpZWQgYnkg dGhlIGFkYXB0ZXIgc3RydWN0dXJlLgogKgogKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8Kc3RhdGljIHZvaWQKZW1f cmVzZXQoc3RydWN0IGFkYXB0ZXIgKmFkYXB0ZXIpCnsKCWRldmljZV90CWRldiA9IGFkYXB0ZXIt PmRldjsKCXN0cnVjdCBlMTAwMF9odwkqaHcgPSAmYWRhcHRlci0+aHc7Cgl1MTYJCXJ4X2J1ZmZl cl9zaXplOwoKCUlOSVRfREVCVUdPVVQoImVtX3Jlc2V0OiBiZWdpbiIpOwoKCS8qIFNldCB1cCBz bWFydCBwb3dlciBkb3duIGFzIGRlZmF1bHQgb2ZmIG9uIG5ld2VyIGFkYXB0ZXJzLiAqLwoJaWYg KCFlbV9zbWFydF9wd3JfZG93biAmJiAoaHctPm1hYy50eXBlID09IGUxMDAwXzgyNTcxIHx8Cgkg ICAgaHctPm1hYy50eXBlID09IGUxMDAwXzgyNTcyKSkgewo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bGwgdHJh bnNtaXQgcmluZ3MuCiAqCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwpzdGF0aWMgdm9pZAplbV9mcmVlX3RyYW5z bWl0X3N0cnVjdHVyZXMoc3RydWN0IGFkYXB0ZXIgKmFkYXB0ZXIpCnsKCXN0cnVjdCB0eF9yaW5n ICp0eHIgPSBhZGFwdGVyLT50eF9yaW5nczsKCglmb3IgKGludCBpID0gMDsgaSA8IGFkYXB0ZXIt Pm51bV9xdWV1ZXM7IGkrKywgdHhyKyspIHsKCQlFTV9UWF9MT0NLKHR4cik7CgkJZW1fZnJlZV90 cmFuc21pdF9idWZmZXJzKHR4cik7CgkJZW1fZG1hX2ZyZWUoYWRhcHRlciwgJnR4ci0+dHhkbWEp OwoJCUVNX1RYX1VOTE9DSyh0eHIpOwoJCUVNX1RYX0xPQ0tfREVTVFJPWSh0eHIpOwoJfQoKCWZy ZWUoYWRhcHRlci0+dHhfcmluZ3MsIE1fREVWQlVGKTsKfQoKLyoqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgogKgogKiAg RnJlZSB0cmFuc21pdCByaW5nIHJlbGF0ZWQgZGF0YSBzdHJ1Y3R1cmVzLgogKgogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKi8Kc3RhdGljIHZvaWQKZW1fZnJlZV90cmFuc21pdF9idWZmZXJzKHN0cnVjdCB0eF9yaW5n ICp0eHIpCnsKCXN0cnVjdCBhZGFwdGVyCQkqYWRhcHRlciA9IHR4ci0+YWRhcHRlcjsKCXN0cnVj dCBlbV9idWZmZXIJKnR4YnVmOwoKCUlOSVRfREVCVUdPVVQoImZyZWVfdHJhbnNtaXRfcmluZzog YmVnaW4iKTsKCglpZiAodHhyLT50eF9idWZmZXJzID09IE5VT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dWUgPSB2YWx1ZTsKCVNZU0NUTF9BRERfUFJPQyhkZXZpY2VfZ2V0X3N5c2N0bF9jdHgoYWRhcHRl ci0+ZGV2KSwKCSAgICBTWVNDVExfQ0hJTERSRU4oZGV2aWNlX2dldF9zeXNjdGxfdHJlZShhZGFw dGVyLT5kZXYpKSwKCSAgICBPSURfQVVUTywgbmFtZSwgQ1RMVFlQRV9JTlR8Q1RMRkxBR19SVywK CSAgICBpbmZvLCAwLCBlbV9zeXNjdGxfaW50X2RlbGF5LCAiSSIsIGRlc2NyaXB0aW9uKTsKfQoK c3RhdGljIHZvaWQKZW1fYWRkX3J4X3Byb2Nlc3NfbGltaXQoc3RydWN0IGFkYXB0ZXIgKmFkYXB0 ZXIsIGNvbnN0IGNoYXIgKm5hbWUsCgljb25zdCBjaGFyICpkZXNjcmlwdGlvbiwgaW50ICpsaW1p dCwgaW50IHZhbHVlKQp7CgkqbGltaXQgPSB2YWx1ZTsKCVNZU0NUTF9BRERfSU5UKGRldmljZV9n ZXRfc3lzY3RsX2N0eChhZGFwdGVyLT5kZXYpLAoJICAgIFNZU0NUTF9DSElMRFJFTihkZXZpY2Vf Z2V0X3N5c2N0bF90cmVlKGFkYXB0ZXItPmRldikpLAoJICAgIE9JRF9BVVRPLCBuYW1lLCBDVExU WVBFX0lOVHxDVExGTEFHX1JXLCBsaW1pdCwgdmFsdWUsIGRlc2NyaXB0aW9uKTsKfQoKCg== --_004_32AB5C9615CC494997D9ABB1DB12783C024CA4A7E3SJEXCH1adaran_-- From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 05:06:46 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ADD211065672; Sat, 30 Oct 2010 05:06:46 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 123798FC0A; Sat, 30 Oct 2010 05:06:45 +0000 (UTC) Received: by wwi17 with SMTP id 17so2605076wwi.31 for ; Fri, 29 Oct 2010 22:06:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=kZbVqo/+hljmj1SPHFNBMQsmk3HU59/O3wpnbeYRuyU=; b=I9bDs/KnIGV1csjvNKbRgTDubNwW+lQMnCDR9dN1EwvynzzduMk0p5T4+gn0TQW9SK 6+AJbO4sBF9vC8zvvf9qV2iqg/sbAFEu/cB2PDDyIcM1ecgMAVUvrUputHO/ZN2ZuXOZ QDdU6CTziufe/MJpHlEVhc6RezWpdawO1Fe4Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=fqgeJgifdGuk9isqDBYf0L61+CDm0SBCBfNJWpAkLCflf7RfHthtf0tC9tQZjsV60E Kd64BnximeGObkxAbjySE7MalyLrBfSQ588FJov9WurE0RnTzyvrhOAMyuSEIr2Q2fei hYX68dUOpAaBMMc1W6lYyOXUfnBoknvcQQR5I= MIME-Version: 1.0 Received: by 10.216.50.134 with SMTP id z6mr3248571web.15.1288415204397; Fri, 29 Oct 2010 22:06:44 -0700 (PDT) Received: by 10.216.80.140 with HTTP; Fri, 29 Oct 2010 22:06:44 -0700 (PDT) In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7E0@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7E0@SJ-EXCH-1.adaranet.com> Date: Fri, 29 Oct 2010 22:06:44 -0700 Message-ID: From: Jack Vogel To: Ricky Charlet Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Juli Mallett , "freebsd-net@freebsd.org" Subject: Re: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 05:06:46 -0000 pciconf -l If you got a printf from the driver its VERY odd that it says the interface does not exist :) Jack On Fri, Oct 29, 2010 at 7:03 PM, Ricky Charlet wrote: > > > > -----Original Message----- > > From: juli@clockworksquid.com [mailto:juli@clockworksquid.com] On > > Behalf Of Juli Mallett > > Sent: Friday, October 29, 2010 6:55 PM > > To: Ricky Charlet > > Cc: freebsd-net@freebsd.org > > Subject: Re: em driver problem on vmware > > > > On Fri, Oct 29, 2010 at 17:07, Ricky Charlet > > wrote: > > > Howdy, > > > I have freebsd80-release with an upgraded em0 driver from > > freebsd8.1 (and an appropriate touch of if_var.h). I'm running an amd64 > > on a vmware vm. And I see this in dmesg: > > > > > > ------------cut------------- > > > em0: port 0x2000-203f > > mem 0xd8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 > > on pci2 > > > em0: Memory Access and/or Bus Master bits were not set > > > em0: [FILTER] > > > em0: Ethernet address: 00:0c:29:57:d7:7f > > > ------------paste------------ > > > > > > But, on the other hand, has anyone seen the new em driver > > working/failing on a vmware vm? > > > > "Memory Access and/or Bus Master bits were not set" is not a fatal > > error, it is correctable, indeed that is printed out when it is > > corrected; that is not something to worry about in and of itself as > > such, are you actually having a problem or just concerned because you > > saw that in dmesg? > > > It is truly not working. I agree those lines in dmesg are good and > indicate em0 is ready. but `ifconfig` does not see em0. > > > --- > Ricky Charlet > Adara Networks > USA 408-433-4942 > > > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 06:11:22 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B8651106566B for ; Sat, 30 Oct 2010 06:11:22 +0000 (UTC) (envelope-from kevlo@kevlo.org) Received: from ns.kevlo.org (kevlo.org [220.128.136.52]) by mx1.freebsd.org (Postfix) with ESMTP id 993AB8FC18 for ; Sat, 30 Oct 2010 06:11:21 +0000 (UTC) Received: from [127.0.0.1] (kevlo@kevlo.org [220.128.136.52]) by ns.kevlo.org (8.14.3/8.14.3) with ESMTP id o9U5fHl2030601; Sat, 30 Oct 2010 13:41:18 +0800 (CST) From: Kevin Lo To: Ricky Charlet In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7E3@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7DF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7E3@SJ-EXCH-1.adaranet.com> Content-Type: text/plain; charset="UTF-8" Date: Sat, 30 Oct 2010 13:42:05 +0800 Message-ID: <1288417325.14588.6.camel@nsl> Mime-Version: 1.0 X-Mailer: Evolution 2.30.3 Content-Transfer-Encoding: 7bit Cc: "freebsd-net@freebsd.org" , Jack Vogel Subject: RE: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 06:11:22 -0000 Hi Rick, The FreeBSD -current works fine for me with the newest em(4) under the VMware player. Kevin On Friday, 2010-10-29 at 19:22 -0700, Ricky Charlet wrote: > Thanks Jack, > > The failure is that ifconfig is unaware of em0. My em0 is not configured, so link partners are also unaware of it. > ifconfig em0 > ifconfig: interface em0 does not exist > > and you already have my dmes stuff on em0 (which I am now up to agreeing looks positive and would not indicate a problem) > > > My amalgamated file is a private combination of some 8.1, some 9.0, some stuff a cohort did. We have been motivated to 'upgrade' from e1000 in 8.0 to a newer/modified e1000 because of our desire to incorporate the altq patches. > > For the curious and the diligent, the e1000/if_em.c file I am using is attached. > > Ricky > > > From: Jack Vogel [mailto:jfvogel@gmail.com] > Sent: Friday, October 29, 2010 7:13 PM > To: Ricky Charlet > Cc: freebsd-net@freebsd.org > Subject: Re: em driver problem on vmware > > I remember seeing the same thing when running a FreeBSD guest on > Linux/KVM, its informational, the code will enable said bits right after > it says that. > > So, the focus should be on the data, you are saying the delivered > driver in 8.0 out of the box works and which driver exactly are you > trying to use, my last checked in? > > More on the failure, does it ping, does its link partner see anything, > etc, etc.. > > Jack > > On Fri, Oct 29, 2010 at 6:27 PM, Ricky Charlet > wrote: > FYI, > That dmesg output I get from my franken-driver on vmware is exactly the same output I get from the *working* bsd80Release on vmware: > > ------------cut-------------------- > [root@npx7511 /usr/src/sys/dev/e1000]# dmesg | grep em0 > em0: port 0x2000-0x203f mem 0xd8940000-0xd895ffff,0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 > em0: Memory Access and/or Bus Master bits were not set! > em0: [FILTER] > em0: Ethernet address: 00:0c:29:57:d7:7f > -----------paste------------------- > > > So I don't think the clue is hiding in dmesg. > > --- > Ricky Charlet > Adara Networks > USA 408-433-4942 > > -----Original Message----- > From: owner-freebsd-net@freebsd.org [mailto:owner-freebsd-net@freebsd.org] On Behalf Of Ricky Charlet > Sent: Friday, October 29, 2010 5:07 PM > To: freebsd-net@freebsd.org > Subject: em driver problem on vmware > > Howdy, > I have freebsd80-release with an upgraded em0 driver from freebsd8.1 (and an appropriate touch of if_var.h). I'm running an amd64 on a vmware vm. And I see this in dmesg: > > ------------cut------------- > em0: port 0x2000-203f mem 0xd8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 on pci2 > em0: Memory Access and/or Bus Master bits were not set > em0: [FILTER] > em0: Ethernet address: 00:0c:29:57:d7:7f > ------------paste------------ > > Now, I certainly may have done something wrong with my code switch (just copied over the sys/dev/e1000 directory from 8.1 and defined drbr_needs_enqueue in if_var.h). I'll start double checking. > > But, on the other hand, has anyone seen the new em driver working/failing on a vmware vm? > > > Thanks > > > --- > Ricky Charlet > Adara Networks > USA 408-433-4942 > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 06:32:11 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 91B66106566B for ; Sat, 30 Oct 2010 06:32:11 +0000 (UTC) (envelope-from RCharlet@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 64B3A8FC14 for ; Sat, 30 Oct 2010 06:32:11 +0000 (UTC) X-ASG-Debug-ID: 1288419361-0d0f06770001-QdxwpM Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id bTy94lWy9eOnOiJU; Fri, 29 Oct 2010 23:16:01 -0700 (PDT) X-Barracuda-Envelope-From: RCharlet@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Fri, 29 Oct 2010 23:16:01 -0700 From: "Ricky Charlet" X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Jack Vogel Date: Fri, 29 Oct 2010 23:16:00 -0700 X-ASG-Orig-Subj: RE: em driver problem on vmware Thread-Topic: em driver problem on vmware Thread-Index: Act38EFP2zAA8Lo+RB6E65JDG5URhAACYECg Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7EB@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7E0@SJ-EXCH-1.adaranet.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/mixed; boundary="_004_32AB5C9615CC494997D9ABB1DB12783C024CA4A7EBSJEXCH1adaran_" MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1288419361 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Juli Mallett , "freebsd-net@freebsd.org" Subject: RE: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 06:32:11 -0000 --_004_32AB5C9615CC494997D9ABB1DB12783C024CA4A7EBSJEXCH1adaran_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Jack, My pciconf output is attached. I'm afraid I don't grok it and will need a= hand to even let me know if this is good/not-good. Ricky From: Jack Vogel [mailto:jfvogel@gmail.com] Sent: Friday, October 29, 2010 10:07 PM To: Ricky Charlet Cc: Juli Mallett; freebsd-net@freebsd.org Subject: Re: em driver problem on vmware pciconf -l If you got a printf from the driver its VERY odd that it says the interface does not exist :) Jack On Fri, Oct 29, 2010 at 7:03 PM, Ricky Charlet > wrote: > -----Original Message----- > From: juli@clockworksquid.com [mailto:jul= i@clockworksquid.com] On > Behalf Of Juli Mallett > Sent: Friday, October 29, 2010 6:55 PM > To: Ricky Charlet > Cc: freebsd-net@freebsd.org > Subject: Re: em driver problem on vmware > > On Fri, Oct 29, 2010 at 17:07, Ricky Charlet > > wrote: > > Howdy, > > I have freebsd80-release with an upgraded em0 driver from > freebsd8.1 (and an appropriate touch of if_var.h). I'm running an amd64 > on a vmware vm. And I see this in dmesg: > > > > ------------cut------------- > > em0: port 0x2000-203f > mem 0xd8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 > on pci2 > > em0: Memory Access and/or Bus Master bits were not set > > em0: [FILTER] > > em0: Ethernet address: 00:0c:29:57:d7:7f > > ------------paste------------ > > > > But, on the other hand, has anyone seen the new em driver > working/failing on a vmware vm? > > "Memory Access and/or Bus Master bits were not set" is not a fatal > error, it is correctable, indeed that is printed out when it is > corrected; that is not something to worry about in and of itself as > such, are you actually having a problem or just concerned because you > saw that in dmesg? It is truly not working. I agree those lines in dmesg are good and indicat= e em0 is ready. but `ifconfig` does not see em0. --- Ricky Charlet Adara Networks USA 408-433-4942 _______________________________________________ freebsd-net@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-net To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" --_004_32AB5C9615CC494997D9ABB1DB12783C024CA4A7EBSJEXCH1adaran_ Content-Type: text/plain; name="pciconf.txt" Content-Description: pciconf.txt Content-Disposition: attachment; filename="pciconf.txt"; size=3760; creation-date="Fri, 29 Oct 2010 23:11:23 GMT"; modification-date="Sat, 30 Oct 2010 06:07:11 GMT" Content-Transfer-Encoding: base64 aG9zdGIwQHBjaTA6MDowOjA6CWNsYXNz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DQpwY2liMzFAcGNpMDowOjI0OjQ6CWNsYXNzPTB4 MDYwNDAwIGNhcmQ9MHgwN2EwMTVhZCBjaGlwPTB4MDdhMDE1YWQgcmV2PTB4MDEgaGRyPTB4MDEN CnBjaWIzMkBwY2kwOjA6MjQ6NToJY2xhc3M9MHgwNjA0MDAgY2FyZD0weDA3YTAxNWFkIGNoaXA9 MHgwN2EwMTVhZCByZXY9MHgwMSBoZHI9MHgwMQ0KcGNpYjMzQHBjaTA6MDoyNDo2OgljbGFzcz0w eDA2MDQwMCBjYXJkPTB4MDdhMDE1YWQgY2hpcD0weDA3YTAxNWFkIHJldj0weDAxIGhkcj0weDAx DQpwY2liMzRAcGNpMDowOjI0Ojc6CWNsYXNzPTB4MDYwNDAwIGNhcmQ9MHgwN2EwMTVhZCBjaGlw PTB4MDdhMDE1YWQgcmV2PTB4MDEgaGRyPTB4MDENCm5vbmUyQHBjaTA6MjowOjA6CWNsYXNzPTB4 MDIwMDAwIGNhcmQ9MHgwNzUwMTVhZCBjaGlwPTB4MTAwZjgwODYgcmV2PTB4MDEgaGRyPTB4MDAN Cm5vbmUzQHBjaTA6MjoxOjA6CWNsYXNzPTB4MDIwMDAwIGNhcmQ9MHgwNzUwMTVhZCBjaGlwPTB4 MTAwZjgwODYgcmV2PTB4MDEgaGRyPTB4MDANCm5vbmU0QHBjaTA6MjoyOjA6CWNsYXNzPTB4MDIw MDAwIGNhcmQ9MHgwNzUwMTVhZCBjaGlwPTB4MTAwZjgwODYgcmV2PTB4MDEgaGRyPTB4MDANCg== --_004_32AB5C9615CC494997D9ABB1DB12783C024CA4A7EBSJEXCH1adaran_-- From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 08:40:49 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F2B91065670; Sat, 30 Oct 2010 08:40:49 +0000 (UTC) (envelope-from jfvogel@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id C49688FC1A; Sat, 30 Oct 2010 08:40:48 +0000 (UTC) Received: by wyb42 with SMTP id 42so3877481wyb.13 for ; Sat, 30 Oct 2010 01:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=+R7gBeFBP2FH6gn0maFExk08d+KCDGT+d6oooznd0Jw=; b=Wzcl0y9vSsuOfDLEhNWO4h4fgC/heO91e5dCXUA33tWvzNYp1WgmXiyek81VAP5AeF 36hDTrbWgU89IePdMntBtQzIZWUmdycxXfKftvW8k3iy22dC/xbmwchzGHWzHz9sNFJG LHeW7m5Vqg6/IIG7K0rx01+2VHXEdPIR6CqOU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=wChqbVV9h1bYGKK/YX8KpPul5ldJXXyqNJ0Hd/FduUbtJqwJccdgS46hNKuYpd7iSt TS2EIm7TmEGaOgC+yOsbFqKLsAEttzWk5Lx7XY1sDrEzZHL0FUIvwESbVEAF5oXrt8Zh Dxb7pkhA/5OYhuzX8Uh3/vSziL3vrDCsVrjok= MIME-Version: 1.0 Received: by 10.216.46.200 with SMTP id r50mr282748web.45.1288428047075; Sat, 30 Oct 2010 01:40:47 -0700 (PDT) Received: by 10.216.80.140 with HTTP; Sat, 30 Oct 2010 01:40:47 -0700 (PDT) In-Reply-To: References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7DF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7E3@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7EA@SJ-EXCH-1.adaranet.com> Date: Sat, 30 Oct 2010 01:40:47 -0700 Message-ID: From: Jack Vogel To: Juli Mallett Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Net , Ricky Charlet Subject: Re: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 08:40:49 -0000 Uh, the emulated device in vmware is an OLD 82543 or something like that right? So, the e1000 driver in 8.1 is split into two parts, em and lem, its lem that has all the old pci support, so if you only pulled if_em then you dont have that code. Sounds like maybe you should just install 8.1 on your guest and avoid these kinds of problems. Regards, Jack On Fri, Oct 29, 2010 at 11:26 PM, Juli Mallett wrote: > dmesg is not cleared at boot; your devices are not being detected, > they merely showed up in a previous boot. > > On Fri, Oct 29, 2010 at 23:13, Ricky Charlet > wrote: > > Hi Julie, > > > > My entire dmesg output is attached. > > > > With much appreciation > > > > Ricky > > > > > > > >> -----Original Message----- > >> From: juli@clockworksquid.com [mailto:juli@clockworksquid.com] On > >> Behalf Of Juli Mallett > >> Sent: Friday, October 29, 2010 8:01 PM > >> To: Ricky Charlet > >> Subject: Re: em driver problem on vmware > >> > >> Can you send me your full dmesg? You must be missing some relevant > >> message, because the only circumstances under which you'd see the > >> device attaching but then it wouldn't be present would also generate > >> some error messages. > >> > >> On Fri, Oct 29, 2010 at 19:22, Ricky Charlet > >> wrote: > >> > Thanks Jack, > >> > > >> > The failure is that ifconfig is unaware of em0. My > >> em0 is not configured, so link partners are also unaware of it. > >> > ifconfig em0 > >> > ifconfig: interface em0 does not exist > >> > > >> > and you already have my dmes stuff on em0 (which I am now up to > >> agreeing looks positive and would not indicate a problem) > >> > > >> > > >> > My amalgamated file is a private combination of some 8.1, some 9.0, > >> some stuff a cohort did. We have been motivated to 'upgrade' from > >> e1000 in 8.0 to a newer/modified e1000 because of our desire to > >> incorporate the altq patches. > >> > > >> > For the curious and the diligent, the e1000/if_em.c > >> file I am using is attached. > >> > > >> > Ricky > >> > > >> > > >> > From: Jack Vogel [mailto:jfvogel@gmail.com] > >> > Sent: Friday, October 29, 2010 7:13 PM > >> > To: Ricky Charlet > >> > Cc: freebsd-net@freebsd.org > >> > Subject: Re: em driver problem on vmware > >> > > >> > I remember seeing the same thing when running a FreeBSD guest on > >> > Linux/KVM, its informational, the code will enable said bits right > >> after > >> > it says that. > >> > > >> > So, the focus should be on the data, you are saying the delivered > >> > driver in 8.0 out of the box works and which driver exactly are you > >> > trying to use, my last checked in? > >> > > >> > More on the failure, does it ping, does its link partner see > >> anything, > >> > etc, etc.. > >> > > >> > Jack > >> > > >> > On Fri, Oct 29, 2010 at 6:27 PM, Ricky Charlet > >> > wrote: > >> > FYI, > >> > That dmesg output I get from my franken-driver on vmware is exactly > >> the same output I get from the *working* bsd80Release on vmware: > >> > > >> > ------------cut-------------------- > >> > [root@npx7511 /usr/src/sys/dev/e1000]# dmesg | grep em0 > >> > em0: port 0x2000-0x203f > >> mem 0xd8940000-0xd895ffff,0xd8900000-0xd890ffff irq 18 at device 0.0 on > >> pci2 > >> > em0: Memory Access and/or Bus Master bits were not set! > >> > em0: [FILTER] > >> > em0: Ethernet address: 00:0c:29:57:d7:7f > >> > -----------paste------------------- > >> > > >> > > >> > So I don't think the clue is hiding in dmesg. > >> > > >> > --- > >> > Ricky Charlet > >> > Adara Networks > >> > USA 408-433-4942 > >> > > >> > -----Original Message----- > >> > From: owner-freebsd-net@freebsd.org >> net@freebsd.org> [mailto:owner-freebsd-net@freebsd.org >> freebsd-net@freebsd.org>] On Behalf Of Ricky Charlet > >> > Sent: Friday, October 29, 2010 5:07 PM > >> > To: freebsd-net@freebsd.org > >> > Subject: em driver problem on vmware > >> > > >> > Howdy, > >> > I have freebsd80-release with an upgraded em0 driver from > >> freebsd8.1 (and an appropriate touch of if_var.h). I'm running an amd64 > >> on a vmware vm. And I see this in dmesg: > >> > > >> > ------------cut------------- > >> > em0: port 0x2000-203f > >> mem 0xd8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 > >> on pci2 > >> > em0: Memory Access and/or Bus Master bits were not set > >> > em0: [FILTER] > >> > em0: Ethernet address: 00:0c:29:57:d7:7f > >> > ------------paste------------ > >> > > >> > Now, I certainly may have done something wrong with my code > >> switch (just copied over the sys/dev/e1000 directory from 8.1 and > >> defined drbr_needs_enqueue in if_var.h). I'll start double checking. > >> > > >> > But, on the other hand, has anyone seen the new em driver > >> working/failing on a vmware vm? > >> > > >> > > >> > Thanks > >> > > >> > > >> > --- > >> > Ricky Charlet > >> > Adara Networks > >> > USA 408-433-4942 > >> > > >> > _______________________________________________ > >> > freebsd-net@freebsd.org mailing list > >> > http://lists.freebsd.org/mailman/listinfo/freebsd-net > >> > To unsubscribe, send any mail to "freebsd-net- > >> unsubscribe@freebsd.org" > >> > _______________________________________________ > >> > freebsd-net@freebsd.org mailing list > >> > http://lists.freebsd.org/mailman/listinfo/freebsd-net > >> > To unsubscribe, send any mail to "freebsd-net- > >> unsubscribe@freebsd.org" > >> > > >> > > >> > _______________________________________________ > >> > freebsd-net@freebsd.org mailing list > >> > http://lists.freebsd.org/mailman/listinfo/freebsd-net > >> > To unsubscribe, send any mail to "freebsd-net- > >> unsubscribe@freebsd.org" > >> > > > > From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 11:32:23 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2AC511065673 for ; Sat, 30 Oct 2010 11:32:23 +0000 (UTC) (envelope-from prt@prt.org) Received: from smtp5.uk.umis.net (smtp5.uk.umis.net [217.65.166.40]) by mx1.freebsd.org (Postfix) with ESMTP id E413A8FC12 for ; Sat, 30 Oct 2010 11:32:22 +0000 (UTC) Received: from www1.prt.org ([217.65.161.4] helo=2.32.24.172.in-addr.arpa) by smtp5.uk.umis.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1PC9fX-0009Iq-TG for freebsd-net@freebsd.org; Sat, 30 Oct 2010 11:32:20 +0000 Message-ID: <4CCC0243.8060507@prt.org> Date: Sat, 30 Oct 2010 12:32:19 +0100 From: Paul Thornton User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: freebsd-net@freebsd.org References: <1519248747.20101028232111@yandex.ru> <1452146D-A590-4676-A662-14D0EEE82152@mac.com> <606859717.20101029093926@yandex.ru> In-Reply-To: Content-Type: text/plain; charset=KOI8-R Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Sat, 30 Oct 2010 11:47:56 +0000 Subject: Re: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 11:32:23 -0000 Hi, On 29/10/2010 18:23, Chuck Swiger wrote: > On Oct 28, 2010, at 11:39 PM, ëÏÎØËÏ× å×ÇÅÎÉÊ wrote: >> so using polling on gigabit NICs is a bottle neck? and is cause of low performance, is not? > > Simple answer is yes. It should be possible that you could tune polling to get similar performance, or at least better performance than you see now, but the additional hardware capabilities of gigabit NICs are likely to outperform polling mode, just as polling mode can generally outperform old 100MBs ethernet NICs. I have been using polling for a long time with em and fxp interfaces on 6.2 and 4.9 boxes that are working as routers. I've been doing testing with FreeBSD 8 and em interfaces recently, and my experience agrees with Chuck's statement - that polling makes things worse when you use new (anything in the last 2 or 3 years) hardware with good quality gigabit ethernet interfaces. I've only really worked with bge and em but they have good high performance without polling in 8.0 and 8.1 Paul. From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 15:04:58 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2587A1065670 for ; Sat, 30 Oct 2010 15:04:58 +0000 (UTC) (envelope-from dudu.meyer@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id D8EB48FC16 for ; Sat, 30 Oct 2010 15:04:57 +0000 (UTC) Received: by ywh2 with SMTP id 2so2060689ywh.13 for ; Sat, 30 Oct 2010 08:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=h7blGEi8P/E4GMK6hJddETiw9FvOARBFudV0OpZFGJQ=; b=J6DnDHo58+ItU6VlxZuMBMC+thUsqCtfp8zDQFPSo2Wn7quI2HWMJrj9x7dK/hK4UH p5qVCVhkDtX7tbBKlvXhUcHIPfeLp3MGi9Vi52PeeVhuyUGPcMkJUp/nMK6qA4G+mEXu bJO0YBPzH7Odf8e5qY/IGxlDSP3eGxMTht4NM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=OZd4wAlRM1JQCKh+uQMMOufuZFC951HVdbLu2x55hEMhCuReSQotagg6ZJ1iAT+Ghz jT2hzZax/Mb5OMk5WlM08MHQl/MvT9LLJY8solCcfiTnq7l74gKlQYJhebP5rJy45W44 Iw9OTfI7ywq8yS23fbNjKNUigc07MOkYIQgTQ= MIME-Version: 1.0 Received: by 10.229.182.75 with SMTP id cb11mr4890693qcb.199.1288449297244; Sat, 30 Oct 2010 07:34:57 -0700 (PDT) Received: by 10.229.192.194 with HTTP; Sat, 30 Oct 2010 07:34:55 -0700 (PDT) Date: Sat, 30 Oct 2010 12:34:55 -0200 Message-ID: From: Eduardo Meyer To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Subject: How to enable/disable flow control on em(4)? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 15:04:58 -0000 Hellow, How do I enable/disable flow control on em driver just like I do on with igb hw.igb.fc_setting? If it can't be done via settings, is there any change I can on driver code to get this flag off? -- =========== Eduardo Meyer pessoal: dudu.meyer@gmail.com profissional: ddm.farmaciap@saude.gov.br From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 16:10:29 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9B04C1065670 for ; Sat, 30 Oct 2010 16:10:29 +0000 (UTC) (envelope-from RCharlet@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 6F5C28FC16 for ; Sat, 30 Oct 2010 16:10:29 +0000 (UTC) X-ASG-Debug-ID: 1288455028-0d0f09b30001-QdxwpM Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id qU0M9GuacmSclsoh; Sat, 30 Oct 2010 09:10:28 -0700 (PDT) X-Barracuda-Envelope-From: RCharlet@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Sat, 30 Oct 2010 09:10:28 -0700 From: "Ricky Charlet" X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Jack Vogel , Juli Mallett Date: Sat, 30 Oct 2010 09:10:25 -0700 X-ASG-Orig-Subj: RE: em driver problem on vmware Thread-Topic: em driver problem on vmware Thread-Index: Act4DiiarsMAP3YqQ5iNBurl6b/5TwAPlrcg Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7F3@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024CA4A7BF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7DF@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7E3@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024CA4A7EA@SJ-EXCH-1.adaranet.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1288455028 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: FreeBSD Net Subject: RE: em driver problem on vmware X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 16:10:29 -0000 Ah, Thanks for the direction. I'll take it as a self project from here. And= I'll update this thread with my results hopefully by mid next week. Ricky From: Jack Vogel [mailto:jfvogel@gmail.com] Sent: Saturday, October 30, 2010 1:41 AM To: Juli Mallett Cc: Ricky Charlet; FreeBSD Net Subject: Re: em driver problem on vmware Uh, the emulated device in vmware is an OLD 82543 or something like that ri= ght? So, the e1000 driver in 8.1 is split into two parts, em and lem, its lem th= at has all the old pci support, so if you only pulled if_em then you dont have th= at code. Sounds like maybe you should just install 8.1 on your guest and avoid these kinds of problems. Regards, Jack On Fri, Oct 29, 2010 at 11:26 PM, Juli Mallett > wrote: dmesg is not cleared at boot; your devices are not being detected, they merely showed up in a previous boot. On Fri, Oct 29, 2010 at 23:13, Ricky Charlet > wrote: > Hi Julie, > > My entire dmesg output is attached. > > With much appreciation > > Ricky > > > >> -----Original Message----- >> From: juli@clockworksquid.com [mailto:ju= li@clockworksquid.com] On >> Behalf Of Juli Mallett >> Sent: Friday, October 29, 2010 8:01 PM >> To: Ricky Charlet >> Subject: Re: em driver problem on vmware >> >> Can you send me your full dmesg? You must be missing some relevant >> message, because the only circumstances under which you'd see the >> device attaching but then it wouldn't be present would also generate >> some error messages. >> >> On Fri, Oct 29, 2010 at 19:22, Ricky Charlet > >> wrote: >> > Thanks Jack, >> > >> > The failure is that ifconfig is unaware of em0. My >> em0 is not configured, so link partners are also unaware of it. >> > ifconfig em0 >> > ifconfig: interface em0 does not exist >> > >> > and you already have my dmes stuff on em0 (which I am now up to >> agreeing looks positive and would not indicate a problem) >> > >> > >> > My amalgamated file is a private combination of some 8.1, some 9.0, >> some stuff a cohort did. We have been motivated to 'upgrade' from >> e1000 in 8.0 to a newer/modified e1000 because of our desire to >> incorporate the altq patches. >> > >> > For the curious and the diligent, the e1000/if_em.c >> file I am using is attached. >> > >> > Ricky >> > >> > >> > From: Jack Vogel [mailto:jfvogel@gmail.com] >> > Sent: Friday, October 29, 2010 7:13 PM >> > To: Ricky Charlet >> > Cc: freebsd-net@freebsd.org >> > Subject: Re: em driver problem on vmware >> > >> > I remember seeing the same thing when running a FreeBSD guest on >> > Linux/KVM, its informational, the code will enable said bits right >> after >> > it says that. >> > >> > So, the focus should be on the data, you are saying the delivered >> > driver in 8.0 out of the box works and which driver exactly are you >> > trying to use, my last checked in? >> > >> > More on the failure, does it ping, does its link partner see >> anything, >> > etc, etc.. >> > >> > Jack >> > >> > On Fri, Oct 29, 2010 at 6:27 PM, Ricky Charlet >> >> wrote: >> > FYI, >> > That dmesg output I get from my franken-driver on vmware is exactly >> the same output I get from the *working* bsd80Release on vmware: >> > >> > ------------cut-------------------- >> > [root@npx7511 /usr/src/sys/dev/e1000]# dmesg | grep em0 >> > em0: port 0x2000-0x203f >> mem 0xd8940000-0xd895ffff,0xd8900000-0xd890ffff irq 18 at device 0.0 on >> pci2 >> > em0: Memory Access and/or Bus Master bits were not set! >> > em0: [FILTER] >> > em0: Ethernet address: 00:0c:29:57:d7:7f >> > -----------paste------------------- >> > >> > >> > So I don't think the clue is hiding in dmesg. >> > >> > --- >> > Ricky Charlet >> > Adara Networks >> > USA 408-433-4942 >> > >> > -----Original Message----- >> > From: owner-freebsd-net@freebsd.org >> net@freebsd.org> [mailto:owner-freebsd-net@freeb= sd.org >> freebsd-net@freebsd.org>] On Behalf Of R= icky Charlet >> > Sent: Friday, October 29, 2010 5:07 PM >> > To: freebsd-net@freebsd.org> >> > Subject: em driver problem on vmware >> > >> > Howdy, >> > I have freebsd80-release with an upgraded em0 driver from >> freebsd8.1 (and an appropriate touch of if_var.h). I'm running an amd64 >> on a vmware vm. And I see this in dmesg: >> > >> > ------------cut------------- >> > em0: port 0x2000-203f >> mem 0xd8940000-0xd895ffff, 0xd8900000-0xd890ffff irq 18 at device 0.0 >> on pci2 >> > em0: Memory Access and/or Bus Master bits were not set >> > em0: [FILTER] >> > em0: Ethernet address: 00:0c:29:57:d7:7f >> > ------------paste------------ >> > >> > Now, I certainly may have done something wrong with my code >> switch (just copied over the sys/dev/e1000 directory from 8.1 and >> defined drbr_needs_enqueue in if_var.h). I'll start double checking. >> > >> > But, on the other hand, has anyone seen the new em driver >> working/failing on a vmware vm? >> > >> > >> > Thanks >> > >> > >> > --- >> > Ricky Charlet >> > Adara Networks >> > USA 408-433-4942 >> > >> > _______________________________________________ >> > freebsd-net@freebsd.org> mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-net >> > To unsubscribe, send any mail to "freebsd-net- >> unsubscribe@freebsd.org>" >> > _______________________________________________ >> > freebsd-net@freebsd.org> mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-net >> > To unsubscribe, send any mail to "freebsd-net- >> unsubscribe@freebsd.org>" >> > >> > >> > _______________________________________________ >> > freebsd-net@freebsd.org mailing list >> > http://lists.freebsd.org/mailman/listinfo/freebsd-net >> > To unsubscribe, send any mail to "freebsd-net- >> unsubscribe@freebsd.org" >> > > From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 17:07:19 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 23702106566B for ; Sat, 30 Oct 2010 17:07:19 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward19.mail.yandex.net (forward19.mail.yandex.net [95.108.253.144]) by mx1.freebsd.org (Postfix) with ESMTP id 9343E8FC15 for ; Sat, 30 Oct 2010 17:07:18 +0000 (UTC) Received: from smtp16.mail.yandex.net (smtp16.mail.yandex.net [95.108.252.16]) by forward19.mail.yandex.net (Yandex) with ESMTP id 6E6B63440BAC; Sat, 30 Oct 2010 21:07:11 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1288458431; bh=O5D3Cos12ut2I5zr8JvFNBCQ9lShlH8Oxwhgk7W4Wmw=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=oFTHXgFbhlPoCaqeTKYC12Qae3aArgMDvRO+qCCUxkY+rPysE5cgnwPEuJCCQl1G6 li4l+YtjG3599diMUI8RSW5HeOvODkqPge/h4k56FrnktxgONJgVO+T8635NRtGZOy wsqn43Ezjpl5dzCutY7SIlyivB/pR6BX1NDdomkM= Received: from HOMEUSER (unknown [77.93.38.34]) by smtp16.mail.yandex.net (Yandex) with ESMTPA id 74D3416000A5; Sat, 30 Oct 2010 21:07:10 +0400 (MSD) X-Nat-Received: from [192.168.11.204]:4025 [ident-empty] by SPAM FILTER: with TPROXY id 1288458008.38693 abuse-to kes-kes@yandex.ru Date: Sat, 30 Oct 2010 20:07:11 +0300 From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= X-Mailer: The Bat! (v4.0.24) Professional Organization: =?windows-1251?B?188gyu7t/Oru4iwgRnJlZUxpbmU=?= X-Priority: 3 (Normal) Message-ID: <1698885470.20101030200711@yandex.ru> To: Pyun YongHyeon In-Reply-To: <20101029181745.GC19479@michelle.cdnetworks.com> References: <364322520.20101029102010@yandex.ru> <20101029181745.GC19479@michelle.cdnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit X-Yandex-TimeMark: 1288458431 X-Yandex-Spam: 1 X-Yandex-Front: smtp16.mail.yandex.net Cc: freebsd-net@freebsd.org Subject: Re[2]: How to obtain place of low perfomance? X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 17:07:19 -0000 Hello, Pyun. Âû ïèñàëè 29 îêòÿáðÿ 2010 ã., 21:17:45: PY> On Fri, Oct 29, 2010 at 10:20:10AM +0300, ?????????????? ?????????????? wrote: >> Hi, Freebsd-net. >> >> serv1# ifocnfig nfe0 >> nfe0: flags=8943 metric 0 mtu 1500 >> options=10b >> ether 00:13:d4:ce:82:16 >> inet 10.11.8.17 netmask 0xfffffc00 broadcast 10.11.11.255 >> inet 10.11.8.15 netmask 0xfffffc00 broadcast 10.11.11.255 >> media: Ethernet autoselect (1000baseTX ) >> status: active >> serv1# ifconfig igb0 >> igb0: flags=8843 metric 0 mtu 1500 >> options=19b >> ether 00:1b:21:45:da:b8 >> media: Ethernet autoselect (1000baseTX ) >> status: active >> serv1# ifconfig vlan7 >> vlan7: flags=8843 metric 0 mtu 1500 >> options=3 >> ether 00:1b:21:45:da:b8 >> inet 10.11.15.15 netmask 0xffffff00 broadcast 10.11.15.255 >> inet 10.11.7.1 netmask 0xffffff00 broadcast 10.11.7.255 >> media: Ethernet autoselect (1000baseTX ) >> status: active >> vlan: 7 parent interface: igb0 >> >> doing bw test with iperf it show low performance on nfe0. >> >> # iperf -c 10.11.8.17 >> ------------------------------------------------------------ >> Client connecting to 10.11.8.17, TCP port 5001 >> TCP window size: 32.5 KByte (default) >> ------------------------------------------------------------ >> [ 3] local 10.11.8.16 port 63911 connected with 10.11.8.17 port 5001 >> [ ID] Interval Transfer Bandwidth >> [ 3] 0.0-10.5 sec 124 MBytes 98.8 Mbits/sec >> # iperf -c 10.11.7.1 >> ------------------------------------------------------------ >> Client connecting to 10.11.7.1, TCP port 5001 >> TCP window size: 32.5 KByte (default) >> ------------------------------------------------------------ >> [ 3] local 10.11.7.2 port 61422 connected with 10.11.7.1 port 5001 >> [ ID] Interval Transfer Bandwidth >> [ 3] 0.0-10.3 sec 800 MBytes 653 Mbits/sec >> >> despite on it is integrated I expect about 300-400Mbit throughput >> does nfe0 really so poor NIC? PY> nfe(4) controllers would not be one of best controllers targeted PY> for server environments but generally it's not poor for desktop PY> users. I mean you should be able to saturate link when you use bulk PY> TCP/UDP transfers. PY> Last time I tried iperf it was not reliable. Did you disable PY> threading of iperf? Also note, both sender/receiver of iperf should PY> be built with same configuration option. igb and nfe on same machine. --------------\igb 10.11.7.1 CLIENT/ SERVER \--------------/nfe 10.11.8.17 -- Ñ óâàæåíèåì, Êîíüêîâ mailto:kes-kes@yandex.ru From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 17:15:56 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5907A106566C for ; Sat, 30 Oct 2010 17:15:56 +0000 (UTC) (envelope-from kes-kes@yandex.ru) Received: from forward16.mail.yandex.net (forward16.mail.yandex.net [95.108.253.141]) by mx1.freebsd.org (Postfix) with ESMTP id 037928FC0A for ; Sat, 30 Oct 2010 17:15:55 +0000 (UTC) Received: from smtp16.mail.yandex.net (smtp16.mail.yandex.net [95.108.252.16]) by forward16.mail.yandex.net (Yandex) with ESMTP id 4113F23A8A96; Sat, 30 Oct 2010 21:15:54 +0400 (MSD) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1288458954; bh=QAfGM2D5YJw+dAa2xGRbp6/aHev3ujWTZQXa1gOVQuc=; h=Date:From:Reply-To:Message-ID:To:CC:Subject:In-Reply-To: References:MIME-Version:Content-Type:Content-Transfer-Encoding; b=L7uSI8EpZlPOhw+R4d25wQhysuOYBwIJS8MLIPQdxVWAHiot0PZTiXeRXQdarn4t8 REor3H+YJ3OKp0yKnloptvcf7eFZjEZZmuDjdHMazvZW5UgCDzMmRyYJn0vHqdA1rj /KaF2JCZ0delnbSxvcy1HKCjqHNCE5oYZLPoHOls= Received: from HOMEUSER (unknown [77.93.38.34]) by smtp16.mail.yandex.net (Yandex) with ESMTPA id E98011600065; Sat, 30 Oct 2010 21:15:53 +0400 (MSD) X-Nat-Received: from [192.168.11.204]:4157 [ident-empty] by SPAM FILTER: with TPROXY id 1288458523.38747 abuse-to kes-kes@yandex.ru Date: Sat, 30 Oct 2010 20:15:46 +0300 From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= X-Mailer: The Bat! (v4.0.24) Professional Organization: =?windows-1251?B?188gyu7t/Oru4iwgRnJlZUxpbmU=?= X-Priority: 3 (Normal) Message-ID: <1887153402.20101030201546@yandex.ru> To: Larry Baird In-Reply-To: <20101029181706.79027.qmail@mailgate.gta.com> References: <110929.14152.74663@localhost> <20101029181706.79027.qmail@mailgate.gta.com> MIME-Version: 1.0 Content-Type: text/plain; charset=windows-1251 Content-Transfer-Encoding: 8bit X-Yandex-TimeMark: 1288458954 X-Yandex-Spam: 1 X-Yandex-Front: smtp16.mail.yandex.net Cc: freebsd-net@freebsd.org Subject: Re[2]: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 17:15:56 -0000 Hi, Larry. LB> Also make sure kern.polling.idle_poll is enabled. By default it is LB> disabled. This makes a big difference in polling throughput. enabling that take all CPU time. last pid: 38722; load averages: 1.88, 1.18, 0.85 up 1+18:43:28 20:04:54 101 processes: 5 running, 74 sleeping, 22 waiting CPU: 1.4% user, 0.0% nice, 61.7% system, 36.8% interrupt, 0.0% idle Mem: 395M Active, 898M Inact, 288M Wired, 5636K Cache, 213M Buf, 388M Free Swap: 4063M Total, 4063M Free PID USERNAME PRI NICE SIZE RES STATE TIME WCPU COMMAND 51 root 171 ki31 0K 16K RUN 0:56 39.89% idlepoll 14 root -44 - 0K 16K WAIT 3:50 30.47% swi1: net 2 root -68 - 0K 16K sleep 253:55 25.20% ng_queue0 17358 bind 44 0 223M 184M RUN 14:30 0.39% named 1324 root 44 0 31828K 9192K select 9:35 0.29% mpd5 55 root 20 - 0K 16K syncer 5:18 0.29% syncer How that affect other processes? Will they be slowed down by idlepoll? -- Ñ óâàæåíèåì, Êîíüêîâ mailto:kes-kes@yandex.ru From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 17:41:53 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BA98106566C for ; Sat, 30 Oct 2010 17:41:53 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail1.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id CF0348FC1D for ; Sat, 30 Oct 2010 17:41:52 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com (192.168.222.22) by WTL-EXCH-1.sandvine.com (192.168.196.31) with Microsoft SMTP Server id 14.0.694.0; Sat, 30 Oct 2010 13:41:52 -0400 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 1E66433C00; Sat, 30 Oct 2010 13:41:52 -0400 (EDT) Date: Sat, 30 Oct 2010 13:41:52 -0400 From: Ed Maste To: Paul Thornton Message-ID: <20101030174152.GB41042@sandvine.com> References: <1519248747.20101028232111@yandex.ru> <1452146D-A590-4676-A662-14D0EEE82152@mac.com> <606859717.20101029093926@yandex.ru> <4CCC0243.8060507@prt.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <4CCC0243.8060507@prt.org> User-Agent: Mutt/1.4.2.1i Cc: freebsd-net@freebsd.org Subject: Re: Polling slows down bandwidth X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 17:41:53 -0000 On Sat, Oct 30, 2010 at 12:32:19PM +0100, Paul Thornton wrote: > I've been doing testing with FreeBSD 8 and em interfaces recently, and > my experience agrees with Chuck's statement - that polling makes things > worse when you use new (anything in the last 2 or 3 years) hardware with > good quality gigabit ethernet interfaces. There are some deficiencies in the current polling algorithm that will cause it to perform less than optimally (it will temporarily stop processing packets even though it is consuming less CPU than requested). I have some changes that I plan to bring into the tree to improve this situation. For recent high quality hardware though I expect you'll get roughly equivalent performance from polling and standard opteration. -Ed From owner-freebsd-net@FreeBSD.ORG Sat Oct 30 21:30:27 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D3761106566C for ; Sat, 30 Oct 2010 21:30:27 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A725C8FC18 for ; Sat, 30 Oct 2010 21:30:27 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o9ULURVB090768 for ; Sat, 30 Oct 2010 21:30:27 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o9ULURm3090761; Sat, 30 Oct 2010 21:30:27 GMT (envelope-from gnats) Date: Sat, 30 Oct 2010 21:30:27 GMT Message-Id: <201010302130.o9ULURm3090761@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: Nick Christenson Cc: Subject: Re: kern/121257: [tcp] TSO + natd -> slow outgoing tcp traffic X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Nick Christenson List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Oct 2010 21:30:27 -0000 The following reply was made to PR kern/121257; it has been noted by GNATS. From: Nick Christenson To: bug-followup@FreeBSD.org, vnovy@vnovy.net Cc: Subject: Re: kern/121257: [tcp] TSO + natd -> slow outgoing tcp traffic Date: Sat, 30 Oct 2010 14:03:13 -0700 (PDT) I notice that not much has been done on this bug in the last couple of years, so here's a bump. I have reproduced this bug on an amd64 machine running FreeBSD 7.3-RELEASE-p3 with network cards using the msk driver. I'm running natd and pf. I'm not the only one who has encountered this. Other references to what looks like the same problem: http://lists.freebsd.org/pipermail/freebsd-net/2010-July/025731.html http://forums.freebsd.org/showthread.php?t=13900 http://osdir.com/ml/freebsd.bugs/2002-03/msg00051.html http://unix.derkeiler.com/Mailing-Lists/FreeBSD/questions/2010-01/msg00674.html http://comments.gmane.org/gmane.os.freebsd.current/127669 (subject "significantly slow IPFW + NATD + amd64) Many of these don't include resolutions, so if this can't be fixed, at least publicizing the work around would seem to be well advised. It sounds from the bug like the developers have a good handle on the problem, but if I can do anything to help test, let me know. -- Nick Christenson npc@gangofone.com