From owner-freebsd-net@FreeBSD.ORG Sun Nov 18 00:32:40 2007 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 137A416A417 for ; Sun, 18 Nov 2007 00:32:40 +0000 (UTC) (envelope-from ccowart@rescomp.berkeley.edu) Received: from hal.rescomp.berkeley.edu (hal.Rescomp.Berkeley.EDU [169.229.70.150]) by mx1.freebsd.org (Postfix) with ESMTP id 0452613C447 for ; Sun, 18 Nov 2007 00:32:39 +0000 (UTC) (envelope-from ccowart@rescomp.berkeley.edu) Received: by hal.rescomp.berkeley.edu (Postfix, from userid 1225) id 1C6CC3C04C0; Sat, 17 Nov 2007 16:15:36 -0800 (PST) Date: Sat, 17 Nov 2007 16:15:36 -0800 From: Christopher Cowart To: freebsd-net@freebsd.org Message-ID: <20071118001536.GG43532@hal.rescomp.berkeley.edu> Mail-Followup-To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vkljSoo+ux+fbUAa" Content-Disposition: inline Organization: RSSP-IT, UC Berkeley User-Agent: Mutt/1.5.16 (2007-06-09) Subject: ipfw and netgraph confusion 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, 18 Nov 2007 00:32:40 -0000 --vkljSoo+ux+fbUAa Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, I'm trying to use the ng_nat node on 6.2. I have one set of IP -> ng cookie mappings in tables and a single default mapping for anything that doesn't match the tables. The first case, using tables, is the "Authenticated" case: | /sbin/ipfw add netgraph tablearg all from "table(4)" to any in via \ | vlan88 | 01040 netgraph tablearg ip from table(4) to any in via vlan88 | /sbin/ipfw add netgraph tablearg all from any to "table(3)" in via \ | vlan665 | 01060 netgraph tablearg ip from any to table(3) in via vlan665 | /sbin/ipfw table 4 list | 10.8.62.255/32 200065132 | /sbin/ipfw table 3 list | 169.229.65.132/32 100065132 This case works great. I inserted some count log rules an see that the src and dst IP addresses are being altered as I would expect. When I fall back to the default case for "Unauthenticated" users: | /sbin/ipfw add netgraph 100079145 all from 10.8.0.0/18 to any in \ | via vlan88 | 01230 netgraph 5673 ip from 10.8.0.0/18 to any in via vlan88=20 | /sbin/ipfw add netgraph 200079145 all from any to 169.229.79.145 | 01240 netgraph 63273 ip from any to 169.229.79.145 Notice the netgraph cookies here are 100079145 and 200079145. These are the same values I used with ng_ctl. The resulting ipfw rules say the cookies are 5673 and 63273. After matching the netgraph rules in this case, the src and dst IP addresses are logged unchanged. This leads me=20 to believe ipfw sent them to non-existant nodes. The behavior I'm witnessing indicates that indeed, these packets have not been NATed. Troubleshooting a bit, I noticed that if I change the constant numbers to 10 and 20, things work exactly as expected. I'm going to venture a guess that when a netgraph cookie is parsed on the commandline, it's interpreted as a 16-bit int, but when you're using tableargs, 32-bit ints work. This inconsistent behavior is a bit confusing (and led me to a couple hours of frustrated debugging). Anyone else aware of this problem? Should I file a PR? Thanks, --=20 Chris Cowart Lead Systems Administrator Network & Infrastructure Services, RSSP-IT UC Berkeley --vkljSoo+ux+fbUAa Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iQIVAwUBRz+EJyPHEDszU3zYAQKkThAAyFmv/YDszxeqYOhsCXVPWIJ5YrAwc+kM 6kbmXxvvTaMvM2UxUYUvl5b1n26kd3haaEc6UKPziplNmlkmZRI6Cbr7nB5wtZse vVJyntBzcOjm/oORk7xysVi+nGrIemh4WplQO0Gi/aR/XeaBAv8Nf+0ro8/HzRs8 +Dmgpzx70x4DjUgiG/1F9EJrEV6wgy5YhissI7r2c0tGCd0gYdaHdidTzHtAJMAJ QPA/l4a2l0pc+GHRLzOJfGVFG0a8g3OnHpYv3HwlZxQrP2lGEvk2SSwXH8noZwFq 5ubX2L8rmCQiZIEhGsePNC1x5b6rjdDNxP7K4RPrS4roZ8H8vpV6mrtYR2LTFyoV khljXjttlOFyC6ia7lj/pNa0QvkqsOWekbfAE9uPSY3KfI/l6TPRr/eUX16Tbtu/ oyejNPl17b6LeK3Cy5xcKY7Qhlym99dxpVuqjV14EfDqkaiiWFYNLygwJTXhzlPY tOMnnP6UQ206VpSre4SKdcIx4pvG4yPASPQjC59bXkZgMdMl0XhKi/PPtGsSRxhp mVGsct7xkflDjA+1tGIzh88WONt3Rjwz/vny9vrAKUAyRJATWtyFgXwzPf8pR3TC q2jhrXfQgSTrT3oRk11M1KvjcU9uGFxjtgEqm4A1ixI2utcR9c/n3ammADMTY7Ke qbKK5bqPdEA= =znTj -----END PGP SIGNATURE----- --vkljSoo+ux+fbUAa-- From owner-freebsd-net@FreeBSD.ORG Sun Nov 18 05:49:48 2007 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 2EB8D16A41B for ; Sun, 18 Nov 2007 05:49:48 +0000 (UTC) (envelope-from kevcormier@yahoo.com) Received: from n6.bullet.re3.yahoo.com (n6.bullet.re3.yahoo.com [68.142.237.91]) by mx1.freebsd.org (Postfix) with SMTP id D3A8013C467 for ; Sun, 18 Nov 2007 05:49:47 +0000 (UTC) (envelope-from kevcormier@yahoo.com) Received: from [68.142.230.29] by n6.bullet.re3.yahoo.com with NNFMP; 18 Nov 2007 05:36:25 -0000 Received: from [66.196.97.133] by t2.bullet.re2.yahoo.com with NNFMP; 18 Nov 2007 05:36:25 -0000 Received: from [127.0.0.1] by omp106.mail.re3.yahoo.com with NNFMP; 18 Nov 2007 05:36:25 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 819367.39659.bm@omp106.mail.re3.yahoo.com Received: (qmail 46306 invoked by uid 60001); 18 Nov 2007 05:36:25 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=xVc69ymBhe7q/fwcARGNBqeyIeqPXb2gPzNwbriJNf0HwcfRViRyEC3QN4jQbUZHbEwR7cFXQUfRYCD+4zkAg1AQMwSbrSQBdJKT/G3L5sNnRFNGKQ622eysZEMK0LrHQxkMS84hfR/quSjxkyDpY8XNVHuaB20ZhlIK3W9MXZI=; X-YMail-OSG: EJM_8ssVM1n1V.y8_lcaTdFszNRuJJTQ3V2NGR8Sp.SieOxyLiyc.QmKK_3jPGrEGPmE5_bz4zlx0N3IJQ8HvK1mWw-- Received: from [24.69.77.165] by web57404.mail.re1.yahoo.com via HTTP; Sat, 17 Nov 2007 21:36:25 PST Date: Sat, 17 Nov 2007 21:36:25 -0800 (PST) From: kev c To: freebsd-net@freebsd.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <546852.46254.qm@web57404.mail.re1.yahoo.com> Subject: Re: Help no network with dhcp 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, 18 Nov 2007 05:49:48 -0000 --- Kip Macy wrote: > On Nov 17, 2007 2:40 PM, kev c > wrote: > > I am trying to install freebsd from an ftp server > but > > the dhcp configuration is not working in > sysinstall. > > It says, no dhcpoffers received.. > > > > The computer is wired to a dlink di624 router > acting > > as a dhcp server. The server works with windows.. > > > > Can you provide a tcpdump from another machine on > the network to see > if the DHCP requests are completely ignored? What is > the ethernet > card? > It is a cnet pro200wl with a davicom dm9102a chipset. I installed freebsd from a cd and then ran dhclient and tcpdump kept on saying, ...ip 0.0.0.0.bootpc > 255.255.255.255.bootps: bootp/dhcp, request from..(oui unknown), length: 300 > -Kip > ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs From owner-freebsd-net@FreeBSD.ORG Sun Nov 18 07:13:23 2007 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 3E3E516A417 for ; Sun, 18 Nov 2007 07:13:23 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outW.internet-mail-service.net (outW.internet-mail-service.net [216.240.47.246]) by mx1.freebsd.org (Postfix) with ESMTP id 062C413C44B for ; Sun, 18 Nov 2007 07:13:22 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Sat, 17 Nov 2007 23:04:48 -0800 X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id 2BEBF12A312 for ; Sat, 17 Nov 2007 20:37:00 -0800 (PST) Message-ID: <473FC16F.9030107@elischer.org> Date: Sat, 17 Nov 2007 20:37:03 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: freebsd-net@freebsd.org References: <20071118001536.GG43532@hal.rescomp.berkeley.edu> In-Reply-To: <20071118001536.GG43532@hal.rescomp.berkeley.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: ipfw and netgraph confusion 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, 18 Nov 2007 07:13:23 -0000 Christopher Cowart wrote: > Hello, > > I'm trying to use the ng_nat node on 6.2. > > I have one set of IP -> ng cookie mappings in tables and a single > default mapping for anything that doesn't match the tables. > > The first case, using tables, is the "Authenticated" case: > | /sbin/ipfw add netgraph tablearg all from "table(4)" to any in via \ > | vlan88 > | 01040 netgraph tablearg ip from table(4) to any in via vlan88 > | /sbin/ipfw add netgraph tablearg all from any to "table(3)" in via \ > | vlan665 > | 01060 netgraph tablearg ip from any to table(3) in via vlan665 > | /sbin/ipfw table 4 list > | 10.8.62.255/32 200065132 > | /sbin/ipfw table 3 list > | 169.229.65.132/32 100065132 > > This case works great. I inserted some count log rules an see that the > src and dst IP addresses are being altered as I would expect. > > When I fall back to the default case for "Unauthenticated" users: > | /sbin/ipfw add netgraph 100079145 all from 10.8.0.0/18 to any in \ > | via vlan88 > | 01230 netgraph 5673 ip from 10.8.0.0/18 to any in via vlan88 > | /sbin/ipfw add netgraph 200079145 all from any to 169.229.79.145 > | 01240 netgraph 63273 ip from any to 169.229.79.145 > > Notice the netgraph cookies here are 100079145 and 200079145. These are > the same values I used with ng_ctl. The resulting ipfw rules say the > cookies are 5673 and 63273. After matching the netgraph rules in this > case, the src and dst IP addresses are logged unchanged. This leads me > to believe ipfw sent them to non-existant nodes. The behavior I'm > witnessing indicates that indeed, these packets have not been NATed. > > Troubleshooting a bit, I noticed that if I change the constant numbers > to 10 and 20, things work exactly as expected. I'm going to venture a > guess that when a netgraph cookie is parsed on the commandline, it's > interpreted as a 16-bit int, but when you're using tableargs, 32-bit > ints work. This inconsistent behavior is a bit confusing (and led me to > a couple hours of frustrated debugging). Anyone else aware of this > problem? Should I file a PR? > I'm not sure about netgraph cookies. but a lot of the cookies in ipfw are 16 bits. e.g. divert cookies. I don't know much about the ipfw netgraph command as I've never used it.. > Thanks, > From owner-freebsd-net@FreeBSD.ORG Mon Nov 19 03:48:28 2007 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 A725816A417 for ; Mon, 19 Nov 2007 03:48:28 +0000 (UTC) (envelope-from mluckie@cs.waikato.ac.nz) Received: from zombie.scms.waikato.ac.nz (mail.scms.waikato.ac.nz [130.217.241.36]) by mx1.freebsd.org (Postfix) with ESMTP id 4F07113C447 for ; Mon, 19 Nov 2007 03:48:28 +0000 (UTC) (envelope-from mluckie@cs.waikato.ac.nz) Received: from sorcerer.cs.waikato.ac.nz ([130.217.250.39]) by zombie.scms.waikato.ac.nz with esmtps (TLSv1:AES256-SHA:256) (Exim 4.52) id 1Itx9V-0002lG-I6 for freebsd-net@freebsd.org; Mon, 19 Nov 2007 16:18:26 +1300 Received: from mluckie by sorcerer.cs.waikato.ac.nz with local (Exim 4.68 (FreeBSD)) (envelope-from ) id 1Itx9V-0002vn-2p for freebsd-net@freebsd.org; Mon, 19 Nov 2007 16:18:25 +1300 Date: Mon, 19 Nov 2007 16:18:24 +1300 From: Matthew Luckie To: freebsd-net@freebsd.org Message-ID: <20071119031823.GA8141@sorcerer.cs.waikato.ac.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i Sender: Matthew Luckie Subject: BPF BIOCSETF 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, 19 Nov 2007 03:48:28 -0000 BIOCSETF and BIOCSETWF call reset_d which discards any packets currently in the hold buffer and resets the packet rx count. The patch below adds BIOCSETFNR, an ioctl that swaps the BPF filter without resetting the hold buffer and without resetting the packet rx counts, which is handy when the application wants to adjust its filter program but without discarding whatever the system might have buffered. I've also changed BIOCSETWF to map to the new function. I don't see the rationale in having BIOCSETWF mucking with the receive stats and hold buffer. Patch below is against RELENG_6. I'll send a PR tomorrow against HEAD if there aren't any comments or complaints; the main difference will be the extra cruft to make bpf_jitter work. Thoughts? Matthew --- bpf.c.orig Mon Nov 19 14:23:52 2007 +++ bpf.c Mon Nov 19 15:55:05 2007 @@ -103,7 +103,8 @@ u_int, void (*)(const void *, void *, size_t), struct timeval *); static void reset_d(struct bpf_d *); -static int bpf_setf(struct bpf_d *, struct bpf_program *, u_long cmd); +static int bpf_setf(struct bpf_d *, struct bpf_program *); +static int bpf_setfnr(struct bpf_d *, struct bpf_program *, u_long); static int bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *); static int bpf_setdlt(struct bpf_d *, u_int); static void filt_bpfdetach(struct knote *); @@ -755,8 +756,12 @@ * Set link layer read filter. */ case BIOCSETF: + error = bpf_setf(d, (struct bpf_program *)addr); + break; + + case BIOCSETFNR: case BIOCSETWF: - error = bpf_setf(d, (struct bpf_program *)addr, cmd); + error = bpf_setfnr(d, (struct bpf_program *)addr, cmd); break; /* @@ -976,26 +981,17 @@ * free it and replace it. Returns EINVAL for bogus requests. */ static int -bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_long cmd) +bpf_setf(struct bpf_d *d, struct bpf_program *fp) { struct bpf_insn *fcode, *old; - u_int wfilter, flen, size; + u_int flen, size; - if (cmd == BIOCSETWF) { - old = d->bd_wfilter; - wfilter = 1; - } else { - wfilter = 0; - old = d->bd_rfilter; - } if (fp->bf_insns == NULL) { if (fp->bf_len != 0) return (EINVAL); BPFD_LOCK(d); - if (wfilter) - d->bd_wfilter = NULL; - else - d->bd_rfilter = NULL; + old = d->bd_rfilter; + d->bd_rfilter = NULL; reset_d(d); BPFD_UNLOCK(d); if (old != NULL) @@ -1011,10 +1007,8 @@ if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) == 0 && bpf_validate(fcode, (int)flen)) { BPFD_LOCK(d); - if (wfilter) - d->bd_wfilter = fcode; - else - d->bd_rfilter = fcode; + old = d->bd_rfilter; + d->bd_rfilter = fcode; reset_d(d); BPFD_UNLOCK(d); if (old != NULL) @@ -1024,6 +1018,50 @@ } free((caddr_t)fcode, M_BPF); return (EINVAL); +} + +/* + * Set d's packet filter program to fp. If this file already has a filter, + * replace it but keep any existing buffered packets. + */ +static int +bpf_setfnr(struct bpf_d *d, struct bpf_program *fp, u_long cmd) +{ + struct bpf_insn *fcode, *old; + u_int flen, size; + + if (fp->bf_insns != NULL) { + flen = fp->bf_len; + if (flen > bpf_maxinsns) + return (EINVAL); + + size = flen * sizeof(*fp->bf_insns); + fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK); + if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) != 0 || + bpf_validate(fcode, (int)flen) == 0) { + free((caddr_t)fcode, M_BPF); + return (EINVAL); + } + } else { + if (fp->bf_len != 0) + return (EINVAL); + fcode = NULL; + } + + BPFD_LOCK(d); + if (cmd == BIOCSETFNR) { + old = d->bd_rfilter; + d->bd_rfilter = fcode; + } else { + old = d->bd_wfilter; + d->bd_wfilter = fcode; + } + BPFD_UNLOCK(d); + + if(old != NULL) + free((caddr_t)old, M_BPF); + + return (0); } /* --- bpf.h.orig Mon Nov 19 14:24:11 2007 +++ bpf.h Mon Nov 19 14:25:16 2007 @@ -115,6 +115,7 @@ #define BIOCGDLTLIST _IOWR('B',121, struct bpf_dltlist) #define BIOCLOCK _IO('B', 122) #define BIOCSETWF _IOW('B',123, struct bpf_program) +#define BIOCSETFNR _IOW('B',124, struct bpf_program) /* * Structure prepended to each packet. From owner-freebsd-net@FreeBSD.ORG Mon Nov 19 03:51:57 2007 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 E5B8D16A41B for ; Mon, 19 Nov 2007 03:51:57 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: from wa-out-1112.google.com (wa-out-1112.google.com [209.85.146.183]) by mx1.freebsd.org (Postfix) with ESMTP id B759B13C457 for ; Mon, 19 Nov 2007 03:51:57 +0000 (UTC) (envelope-from kip.macy@gmail.com) Received: by wa-out-1112.google.com with SMTP id k17so1941781waf for ; Sun, 18 Nov 2007 19:51:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=C943znbvCFo2BcfAdy3zNwJOjDZch7C1dj64iLHX5lU=; b=KNz3okHrgN9mSgAvs9qwYw9qEOW//UaluQHWFRu8TJTcVF+OnxttCVUueEUUIPvgztKWNMstb0LcjTQehpnP/QMi69RVAJYtNH/+XQMPbSUE3pwd+0a7sL8srH0EDASVHspmHlN59kmpZjf5lPsYmtVLPPOvb9ij4k3VOhvlnDs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=uWMtlPknGmQ4t2uwb46FwUmB+hFXzBxNB2ciO6I3nMfIpMmWDWIQZT2lLzAKAokXh/uZ9xaakl2qTuyzh4EmqpfdQbRCV6hCrHuvSlkmteJ8dtCWrKboIxsUfcpgChy6x8LkSrdOkmmTKVlSKdrPg6QJRjSrtenXy+TG3VitXHU= Received: by 10.114.73.1 with SMTP id v1mr1312501waa.1195444316772; Sun, 18 Nov 2007 19:51:56 -0800 (PST) Received: by 10.114.13.15 with HTTP; Sun, 18 Nov 2007 19:51:56 -0800 (PST) Message-ID: Date: Sun, 18 Nov 2007 19:51:56 -0800 From: "Kip Macy" To: "Matthew Luckie" In-Reply-To: <20071119031823.GA8141@sorcerer.cs.waikato.ac.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20071119031823.GA8141@sorcerer.cs.waikato.ac.nz> Cc: freebsd-net@freebsd.org, "Christian S.J. Peron" Subject: Re: BPF BIOCSETF 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, 19 Nov 2007 03:51:58 -0000 On Nov 18, 2007 7:18 PM, Matthew Luckie wrote: > BIOCSETF and BIOCSETWF call reset_d which discards any packets > currently in the hold buffer and resets the packet rx count. > > The patch below adds BIOCSETFNR, an ioctl that swaps the BPF filter > without resetting the hold buffer and without resetting the packet rx > counts, which is handy when the application wants to adjust its filter > program but without discarding whatever the system might have > buffered. > > I've also changed BIOCSETWF to map to the new function. I don't see > the rationale in having BIOCSETWF mucking with the receive stats and > hold buffer. > > Patch below is against RELENG_6. I'll send a PR tomorrow against HEAD > if there aren't any comments or complaints; the main difference will > be the extra cruft to make bpf_jitter work. > > Thoughts? > > Matthew > > --- bpf.c.orig Mon Nov 19 14:23:52 2007 > +++ bpf.c Mon Nov 19 15:55:05 2007 > @@ -103,7 +103,8 @@ > u_int, void (*)(const void *, void *, size_t), > struct timeval *); > static void reset_d(struct bpf_d *); > -static int bpf_setf(struct bpf_d *, struct bpf_program *, u_long cmd); > +static int bpf_setf(struct bpf_d *, struct bpf_program *); > +static int bpf_setfnr(struct bpf_d *, struct bpf_program *, u_long); > static int bpf_getdltlist(struct bpf_d *, struct bpf_dltlist *); > static int bpf_setdlt(struct bpf_d *, u_int); > static void filt_bpfdetach(struct knote *); > @@ -755,8 +756,12 @@ > * Set link layer read filter. > */ > case BIOCSETF: > + error = bpf_setf(d, (struct bpf_program *)addr); > + break; > + > + case BIOCSETFNR: > case BIOCSETWF: > - error = bpf_setf(d, (struct bpf_program *)addr, cmd); > + error = bpf_setfnr(d, (struct bpf_program *)addr, cmd); > break; > > /* > @@ -976,26 +981,17 @@ > * free it and replace it. Returns EINVAL for bogus requests. > */ > static int > -bpf_setf(struct bpf_d *d, struct bpf_program *fp, u_long cmd) > +bpf_setf(struct bpf_d *d, struct bpf_program *fp) > { > struct bpf_insn *fcode, *old; > - u_int wfilter, flen, size; > + u_int flen, size; > > - if (cmd == BIOCSETWF) { > - old = d->bd_wfilter; > - wfilter = 1; > - } else { > - wfilter = 0; > - old = d->bd_rfilter; > - } > if (fp->bf_insns == NULL) { > if (fp->bf_len != 0) > return (EINVAL); > BPFD_LOCK(d); > - if (wfilter) > - d->bd_wfilter = NULL; > - else > - d->bd_rfilter = NULL; > + old = d->bd_rfilter; > + d->bd_rfilter = NULL; > reset_d(d); > BPFD_UNLOCK(d); > if (old != NULL) > @@ -1011,10 +1007,8 @@ > if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) == 0 && > bpf_validate(fcode, (int)flen)) { > BPFD_LOCK(d); > - if (wfilter) > - d->bd_wfilter = fcode; > - else > - d->bd_rfilter = fcode; > + old = d->bd_rfilter; > + d->bd_rfilter = fcode; > reset_d(d); > BPFD_UNLOCK(d); > if (old != NULL) > @@ -1024,6 +1018,50 @@ > } > free((caddr_t)fcode, M_BPF); > return (EINVAL); > +} > + > +/* > + * Set d's packet filter program to fp. If this file already has a filter, > + * replace it but keep any existing buffered packets. > + */ > +static int > +bpf_setfnr(struct bpf_d *d, struct bpf_program *fp, u_long cmd) > +{ > + struct bpf_insn *fcode, *old; > + u_int flen, size; > + > + if (fp->bf_insns != NULL) { > + flen = fp->bf_len; > + if (flen > bpf_maxinsns) > + return (EINVAL); > + > + size = flen * sizeof(*fp->bf_insns); > + fcode = (struct bpf_insn *)malloc(size, M_BPF, M_WAITOK); > + if (copyin((caddr_t)fp->bf_insns, (caddr_t)fcode, size) != 0 || > + bpf_validate(fcode, (int)flen) == 0) { > + free((caddr_t)fcode, M_BPF); > + return (EINVAL); > + } > + } else { > + if (fp->bf_len != 0) > + return (EINVAL); > + fcode = NULL; > + } > + > + BPFD_LOCK(d); > + if (cmd == BIOCSETFNR) { > + old = d->bd_rfilter; > + d->bd_rfilter = fcode; > + } else { > + old = d->bd_wfilter; > + d->bd_wfilter = fcode; > + } > + BPFD_UNLOCK(d); > + > + if(old != NULL) > + free((caddr_t)old, M_BPF); > + > + return (0); > } > > /* > --- bpf.h.orig Mon Nov 19 14:24:11 2007 > +++ bpf.h Mon Nov 19 14:25:16 2007 > @@ -115,6 +115,7 @@ > #define BIOCGDLTLIST _IOWR('B',121, struct bpf_dltlist) > #define BIOCLOCK _IO('B', 122) > #define BIOCSETWF _IOW('B',123, struct bpf_program) > +#define BIOCSETFNR _IOW('B',124, struct bpf_program) > > /* > * Structure prepended to each packet. Sounds reasonable. Christian has been active in maintaining BPF recently so he is really the one you need to follow up with. -Kip From owner-freebsd-net@FreeBSD.ORG Mon Nov 19 08:06:45 2007 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 92FC516A41B; Mon, 19 Nov 2007 08:06:45 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 694F313C48E; Mon, 19 Nov 2007 08:06:45 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from freefall.freebsd.org (kmacy@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lAJ86jv4031327; Mon, 19 Nov 2007 08:06:45 GMT (envelope-from kmacy@freefall.freebsd.org) Received: (from kmacy@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lAJ86i24031323; Mon, 19 Nov 2007 08:06:44 GMT (envelope-from kmacy) Date: Mon, 19 Nov 2007 08:06:44 GMT Message-Id: <200711190806.lAJ86i24031323@freefall.freebsd.org> To: roberto@redix.it, kmacy@FreeBSD.org, freebsd-net@FreeBSD.org From: kmacy@FreeBSD.org Cc: Subject: Re: kern/62374: panic: free: multiple frees 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, 19 Nov 2007 08:06:45 -0000 Synopsis: panic: free: multiple frees State-Changed-From-To: open->feedback State-Changed-By: kmacy State-Changed-When: Mon Nov 19 08:06:18 UTC 2007 State-Changed-Why: Does this still occur on RELENG_7? http://www.freebsd.org/cgi/query-pr.cgi?pr=62374 From owner-freebsd-net@FreeBSD.ORG Mon Nov 19 11:07:09 2007 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 E436016A41A for ; Mon, 19 Nov 2007 11:07:08 +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 D7C0913C46A for ; Mon, 19 Nov 2007 11:07:08 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lAJB78QN040836 for ; Mon, 19 Nov 2007 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lAJB73IX040832 for freebsd-net@FreeBSD.org; Mon, 19 Nov 2007 11:07:03 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 19 Nov 2007 11:07:03 GMT Message-Id: <200711191107.lAJB73IX040832@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, 19 Nov 2007 11:07:09 -0000 Current FreeBSD problem reports Critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- f kern/115360 net [ipv6] IPv6 address and if_bridge don't play well toge 1 problem total. Serious problems S Tracker Resp. Description -------------------------------------------------------------------------------- a kern/38554 net changing interface ipaddress doesn't seem to work s kern/39937 net ipstealth issue f kern/62374 net panic: free: multiple frees s kern/81147 net [net] [patch] em0 reinitialization while adding aliase o kern/92552 net A serious bug in most network drivers from 5.X to 6.X s kern/95665 net [if_tun] "ping: sendto: No buffer space available" wit s kern/105943 net Network stack may modify read-only mbuf chain copies o kern/106316 net [dummynet] dummynet with multipass ipfw drops packets o kern/108542 net [bce]: Huge network latencies with 6.2-RELEASE / STABL o kern/109406 net [ndis] Broadcom WLAN driver 4.100.15.5 doesn't work wi o kern/110959 net [ipsec] Filtering incoming packets with enc0 does not o kern/112528 net [nfs] NFS over TCP under load hangs with "impossible p o kern/112686 net [patm] patm driver freezes System (FreeBSD 6.2-p4) i38 o kern/112722 net IP v4 udp fragmented packet reject o kern/113457 net [ipv6] deadlock occurs if a tunnel goes down while the o kern/113842 net [ipv6] PF_INET6 proto domain state can't be cleared wi o kern/114714 net [gre][patch] gre(4) is not MPSAFE and does not support o kern/114839 net [fxp] fxp looses ability to speak with traffic o kern/115239 net [ipnat] panic with 'kmem_map too small' using ipnat o kern/116077 net 6.2-STABLE panic during use of multi-cast networking c o kern/116172 net Network / ipv6 recursive mutex panic o kern/116185 net if_iwi driver leads system to reboot o kern/116186 net can not set wi channel on current o kern/116328 net [bge]: Solid hang with bge interface o kern/116747 net [ndis] FreeBSD 7.0-CURRENT crash with Dell TrueMobile o kern/116837 net ifconfig tunX destroy: panic o kern/117271 net [tap] OpenVPN TAP uses 99% CPU on releng_6 when if_tap o kern/117423 net Duplicate IP on different interfaces o bin/117448 net [carp] 6.2 kernel crash o kern/117717 net Kernel panic with Bittorrent client. 30 problems total. Non-critical problems S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/23063 net [PATCH] for static ARP tables in rc.network s bin/41647 net ifconfig(8) doesn't accept lladdr along with inet addr o kern/54383 net [nfs] [patch] NFS root configurations without dynamic s kern/60293 net FreeBSD arp poison patch o kern/95267 net packet drops periodically appear f kern/95277 net [netinet] [patch] IP Encapsulation mask_match() return o kern/100519 net [netisr] suggestion to fix suboptimal network polling o kern/102035 net [plip] plip networking disables parallel port printing o conf/102502 net [patch] ifconfig name does't rename netgraph node in n o conf/107035 net [patch] bridge interface given in rc.conf not taking a o kern/112654 net [pcn] Kernel panic upon if_pcn module load on a Netfin o kern/114915 net [patch] [pcn] pcn (sys/pci/if_pcn.c) ethernet driver f o bin/116643 net [patch] fstat(1): add INET/INET6 socket details as in o bin/117339 net [patch] route(8): loading routing management commands 14 problems total. From owner-freebsd-net@FreeBSD.ORG Mon Nov 19 17:05:03 2007 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 2C80816A475; Mon, 19 Nov 2007 17:05:03 +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 0DA4A13C525; Mon, 19 Nov 2007 17:05:03 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (linimon@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lAJH52t2059287; Mon, 19 Nov 2007 17:05:02 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lAJH52uG059283; Mon, 19 Nov 2007 17:05:02 GMT (envelope-from linimon) Date: Mon, 19 Nov 2007 17:05:02 GMT Message-Id: <200711191705.lAJH52uG059283@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-net@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: kern/118128: [dummynet] Dummynet cause kernel trap or system freeze 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, 19 Nov 2007 17:05:03 -0000 Synopsis: [dummynet] Dummynet cause kernel trap or system freeze Responsible-Changed-From-To: freebsd-bugs->freebsd-net Responsible-Changed-By: linimon Responsible-Changed-When: Mon Nov 19 17:04:53 UTC 2007 Responsible-Changed-Why: Over to maintainer(s). http://www.freebsd.org/cgi/query-pr.cgi?pr=118128 From owner-freebsd-net@FreeBSD.ORG Mon Nov 19 19:05:45 2007 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 0BC0016A421 for ; Mon, 19 Nov 2007 19:05:45 +0000 (UTC) (envelope-from security@jim-liesl.org) Received: from qsmtp4.mc.surewest.net (qsmtp.mc.surewest.net [66.60.130.145]) by mx1.freebsd.org (Postfix) with SMTP id E672A13C4D3 for ; Mon, 19 Nov 2007 19:05:44 +0000 (UTC) (envelope-from security@jim-liesl.org) Received: (qmail 1187 invoked from network); 19 Nov 2007 10:38:58 -0800 Received: by simscan 1.1.0 ppid: 1155, pid: 1156, t: 7.7519s scanners: regex: 1.1.0 attach: 1.1.0 spam: 3.1.7-deb X-Spam-Checker-Version: SpamAssassin 3.1.7-deb (2006-10-05) on qsmtp4.surewest.net X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=BAYES_05,FORGED_RCVD_HELO, HTML_40_50, HTML_MESSAGE, MIME_HTML_ONLY autolearn=ham version=3.1.7-deb Received: from unknown (HELO daemon.jim-liesl.org) (66.60.173.44) by qsmtp4 with SMTP; 19 Nov 2007 10:38:50 -0800 Received: from daemon.jim-liesl.org (localhost.static.surewest.net [127.0.0.1]) by daemon.jim-liesl.org (Postfix) with ESMTP id 5610E5DA1; Mon, 19 Nov 2007 10:38:50 -0800 (PST) Received: from [127.0.0.1] (daemon.static.surewest.net [192.168.1.15]) by daemon.jim-liesl.org (Postfix) with ESMTP id DF56D5D62; Mon, 19 Nov 2007 10:38:49 -0800 (PST) Message-ID: <4741D839.2040307@jim-liesl.org> Date: Mon, 19 Nov 2007 10:38:49 -0800 From: security User-Agent: Thunderbird 2.0.0.6 (Windows/20070728) To: kev c References: <546852.46254.qm@web57404.mail.re1.yahoo.com> In-Reply-To: <546852.46254.qm@web57404.mail.re1.yahoo.com> X-Enigmail-Version: 0.95.4 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org Subject: Re: Help no network with dhcp 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, 19 Nov 2007 19:05:45 -0000 kev c wrote: --- Kip Macy [1] wrote: On Nov 17, 2007 2:40 PM, kev c [2] wrote: I am trying to install freebsd from an ftp server but the dhcp configuration is not working in sysinstall. It says, no dhcpoffers received.. The computer is wired to a dlink di624 router acting as a dhcp server. The server works with windows.. Can you provide a tcpdump from another machine on the network to see if the DHCP requests are completely ignored? What is the ethernet card? It is a cnet pro200wl with a davicom dm9102a chipset. I installed freebsd from a cd and then ran dhclient and tcpdump kept on saying, ...ip 0.0.0.0.bootpc > 255.255.255.255.bootps: bootp/dhcp, request from..(oui unknown), length: 300 -Kip Kip, Can you run wireshark, ethereal or tcpdump from another computer in the LAN? It should see the broadcast. I know you said it works under windows, but do you have any MAC filtering going on at the dlink end? What version of FreeBSD are you working with? Does the dlink have a log that would show it's DHCP activity? thx References 1. mailto:kip.macy@gmail.com 2. mailto:kevcormier@yahoo.com From owner-freebsd-net@FreeBSD.ORG Mon Nov 19 19:46:36 2007 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 572F716A468 for ; Mon, 19 Nov 2007 19:46:36 +0000 (UTC) (envelope-from kevcormier@yahoo.com) Received: from n9.bullet.re3.yahoo.com (n9.bullet.re3.yahoo.com [68.142.237.94]) by mx1.freebsd.org (Postfix) with SMTP id E88A913C4DD for ; Mon, 19 Nov 2007 19:46:30 +0000 (UTC) (envelope-from kevcormier@yahoo.com) Received: from [68.142.237.90] by n9.bullet.re3.yahoo.com with NNFMP; 19 Nov 2007 19:46:24 -0000 Received: from [216.252.111.166] by t6.bullet.re3.yahoo.com with NNFMP; 19 Nov 2007 19:46:24 -0000 Received: from [127.0.0.1] by omp101.mail.re3.yahoo.com with NNFMP; 19 Nov 2007 19:46:24 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 500633.71600.bm@omp101.mail.re3.yahoo.com Received: (qmail 41312 invoked by uid 60001); 19 Nov 2007 19:46:24 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=JN1wxYJL1geVV2xF15gBpbYS6eALkBbxr+H9J1am/qvKJwZA8Mov2jR6cYmxCIO/WusD3SLWOPfI06MMWXJNqYMalvDJpup77EM2+/Ji4tv2OAmt4rpiJ862TxxQ/QwuvmCOcB51eakpfkXHt3ti1g3HdRCV2x7+p/VNbx/2kZw=; X-YMail-OSG: E71vQjgVM1kV0uvRbLlnr06JrrFKtsvBRc6LikE6Bcn4c43qeodYZZPSTibMnqvGHGY.2StmEXlIJsmvNMZ..zAOAA-- Received: from [24.69.77.165] by web57404.mail.re1.yahoo.com via HTTP; Mon, 19 Nov 2007 11:46:24 PST Date: Mon, 19 Nov 2007 11:46:24 -0800 (PST) From: kev c To: freebsd-net@freebsd.org In-Reply-To: <4741D839.2040307@jim-liesl.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <289902.39991.qm@web57404.mail.re1.yahoo.com> Subject: Re: Help no network with dhcp 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, 19 Nov 2007 19:46:36 -0000 --- security wrote: > > kev c wrote: > > --- Kip Macy [1] wrote: > > > > On Nov 17, 2007 2:40 PM, kev c > [2] wrote: > > > I am trying to install freebsd from an ftp server > > > but > > > the dhcp configuration is not working in > > > sysinstall. > > > It says, no dhcpoffers received.. > > The computer is wired to a dlink di624 router > > > acting > > > as a dhcp server. The server works with windows.. > > > > Can you provide a tcpdump from another machine on > the network to see > if the DHCP requests are completely ignored? What is > the ethernet > card? > > > > It is a cnet pro200wl with a davicom dm9102a > chipset. > > I installed freebsd from a cd and then ran dhclient > and tcpdump kept on saying, > > ...ip 0.0.0.0.bootpc > 255.255.255.255.bootps: > bootp/dhcp, request from..(oui unknown), length: 300 > > > -Kip > > Kip, Can you run wireshark, ethereal or tcpdump > from another computer > in the LAN? It should see the broadcast. I know > you said it works > under windows, but do you have any MAC filtering > going on at the dlink > end? What version of FreeBSD are you working > with? Does the dlink > have a log that would show it's DHCP activity? > thx > Its me, kev. Sorry, I misunderstood the request. I redid the test on a separate computer and it didnt broadcast the dhcprequest. The router's log shows no dhcp activities. I tried by passing the router and using my isp's dhcp server but the result was the same. I tried useing sysinstall on a computer with a different network card and it worked. I am useing 6.2 release. > References > > 1. mailto:kip.macy@gmail.com > 2. mailto:kevcormier@yahoo.com > _______________________________________________ > 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" > ____________________________________________________________________________________ Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. http://overview.mail.yahoo.com/ From owner-freebsd-net@FreeBSD.ORG Mon Nov 19 21:19:56 2007 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 82F0316A418; Mon, 19 Nov 2007 21:19:56 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 588A713C43E; Mon, 19 Nov 2007 21:19:56 +0000 (UTC) (envelope-from oleg@FreeBSD.org) Received: from freefall.freebsd.org (oleg@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lAJLJu0w070861; Mon, 19 Nov 2007 21:19:56 GMT (envelope-from oleg@freefall.freebsd.org) Received: (from oleg@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lAJLJufm070857; Mon, 19 Nov 2007 21:19:56 GMT (envelope-from oleg) Date: Mon, 19 Nov 2007 21:19:56 GMT Message-Id: <200711192119.lAJLJufm070857@freefall.freebsd.org> To: oleg@FreeBSD.org, freebsd-net@FreeBSD.org, oleg@FreeBSD.org From: oleg@FreeBSD.org Cc: Subject: Re: kern/118128: [dummynet] Dummynet cause kernel trap or system freeze 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, 19 Nov 2007 21:19:56 -0000 Synopsis: [dummynet] Dummynet cause kernel trap or system freeze Responsible-Changed-From-To: freebsd-net->oleg Responsible-Changed-By: oleg Responsible-Changed-When: Mon Nov 19 21:19:36 UTC 2007 Responsible-Changed-Why: grab. http://www.freebsd.org/cgi/query-pr.cgi?pr=118128 From owner-freebsd-net@FreeBSD.ORG Mon Nov 19 22:38:16 2007 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 F2B1F16A417 for ; Mon, 19 Nov 2007 22:38:16 +0000 (UTC) (envelope-from n30@auth.se) Received: from www.auth.se (www.auth.se [83.140.181.5]) by mx1.freebsd.org (Postfix) with ESMTP id 835BB13C44B for ; Mon, 19 Nov 2007 22:38:16 +0000 (UTC) (envelope-from n30@auth.se) Received: from webmail.auth.se (n30@www.auth.se [83.140.181.5]) by www.auth.se (8.13.8/8.13.8) with ESMTP id lAJLxbCn044269 for ; Mon, 19 Nov 2007 22:59:37 +0100 (CET) (envelope-from n30@auth.se) From: "n30" To: freebsd-net@freebsd.org Date: Mon, 19 Nov 2007 22:59:37 +0100 Message-Id: <20071119215243.M9581@sexnarkoman.se> X-Mailer: OpenWebMail 2.52 20060502 X-OriginatingIP: 78.69.38.29 (n30) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Subject: Routing with OpenVPN 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, 19 Nov 2007 22:38:17 -0000 Hi, I am using a tunnelservice from a Swedish tunnel provider. I get 5 ip-adresses for it and the tunnelprovider uses OpenVPN. The 5 ip-adresses is static and I have access of configuring PTR for the ips. I now have a problem, I don't know how to route the traffic so that I can configure my servers on my lan to use these ips. [ISP]------- [Tunnel]--------[Local Network] fxp0 tap0 fxp1 | | | 192.168.0.2 88.80.13.152 88.80.13.199 88.80.13.200 88.80.13.201 88.80.13.202 Current configuration to get tunnel to work: route flush route add default 88.80.13.*** route add -host 88.80.**.** 192.168.0.1 route add -host 88.80.13.152 192.168.0.1 Can anyone point me to some documentation on how to do this? Have you done something similar and how was your setup? What should I think about and what are the pro's and con's of the different solutions? Regards n30 From owner-freebsd-net@FreeBSD.ORG Tue Nov 20 14:17:45 2007 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 A50DE16A418 for ; Tue, 20 Nov 2007 14:17:45 +0000 (UTC) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [IPv6:2001:200:1b1::35]) by mx1.freebsd.org (Postfix) with ESMTP id 46A0213C481 for ; Tue, 20 Nov 2007 14:17:45 +0000 (UTC) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from mymb.local (g046141.ppp.asahi-net.or.jp [211.132.46.141]) by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id 08A3973020 for ; Tue, 20 Nov 2007 23:17:44 +0900 (JST) Date: Tue, 20 Nov 2007 23:17:43 +0900 Message-ID: From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= To: freebsd-net@freebsd.org User-Agent: Wanderlust/2.14.0 (Africa) Emacs/22.0 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: multipart/mixed; boundary="Multipart_Tue_Nov_20_23:17:43_2007-1" X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: a format error in pf_print_host() 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, 20 Nov 2007 14:17:45 -0000 --Multipart_Tue_Nov_20_23:17:43_2007-1 Content-Type: text/plain; charset=US-ASCII (This should probably be reported to an OpenBSD forum, but I'm not subscribing to any of the lists, so I'm posting this to freebsd-net. I believe pf maintainers watch this list, too...) I've found a minor error in pf_print_host() which is revealed for some time of IPv6 addresses. This routine always (perhaps unintentionally) assumes abbreviate-able consecutive zero's, so, for example, it formats "1:2:3:4:5:6:7:8" as ":2:3:4:5:6:7:8". This can be confirmed by the sample code attached to this message by - saving the file as e.g. "foo.c" - cc -o foo foo.c - ./foo 1:2:3:4:5:6:7:8 I've also attached a proposed patch to this problem. The diff was made against 6-STABLE, but it's probably applicable to other versions. JINMEI, Tatuya Communication Platform Lab. Corporate R&D Center, Toshiba Corp. jinmei@isl.rdc.toshiba.co.jp --Multipart_Tue_Nov_20_23:17:43_2007-1-- From owner-freebsd-net@FreeBSD.ORG Tue Nov 20 14:31:58 2007 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 1308216A419 for ; Tue, 20 Nov 2007 14:31:58 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.174]) by mx1.freebsd.org (Postfix) with ESMTP id AAE8713C43E for ; Tue, 20 Nov 2007 14:31:57 +0000 (UTC) (envelope-from max@love2party.net) Received: from amd64.laiers.local (dslb-088-066-037-173.pools.arcor-ip.net [88.66.37.173]) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis) id 0MKwpI-1IuU8d0vCC-00089p; Tue, 20 Nov 2007 15:31:43 +0100 From: Max Laier Organization: FreeBSD To: freebsd-net@freebsd.org Date: Tue, 20 Nov 2007 15:31:32 +0100 User-Agent: KMail/1.9.7 References: In-Reply-To: X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2013385.9WMvrFsTYj"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200711201531.41579.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1+Uny0pqUpPQXakWOzm6NPMyCuBp1AG4jlTndF dhqT4xFa0NNbfcAjk82vMM09KIgIpc62ONgHlNi7VOeLYSVS2k 5fFVD3QQwU8A+7G+64LdMvlHj/h/JyHLnNraNdPddo= Cc: JINMEI Tatuya / =?utf-8?q?=E7=A5=9E=E6=98=8E=E9=81=94=E5=93=89?= Subject: Re: a format error in pf_print_host() 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, 20 Nov 2007 14:31:58 -0000 --nextPart2013385.9WMvrFsTYj Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Tuesday 20 November 2007, JINMEI Tatuya / =E7=A5=9E=E6=98=8E=E9=81=94=E5= =93=89 wrote: > (This should probably be reported to an OpenBSD forum, but I'm not > subscribing to any of the lists, so I'm posting this to freebsd-net. > I believe pf maintainers watch this list, too...) > > I've found a minor error in pf_print_host() which is revealed for some > time of IPv6 addresses. This routine always (perhaps unintentionally) > assumes abbreviate-able consecutive zero's, so, for example, it > formats "1:2:3:4:5:6:7:8" as ":2:3:4:5:6:7:8". This can be confirmed > by the sample code attached to this message by > - saving the file as e.g. "foo.c" > - cc -o foo foo.c > - ./foo 1:2:3:4:5:6:7:8 > > I've also attached a proposed patch to this problem. The diff was > made against 6-STABLE, but it's probably applicable to other versions. Seems your diff got lost during transmission, could you resend - please? =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart2013385.9WMvrFsTYj Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBHQu/NXyyEoT62BG0RAh/VAJ4jz5NVsCkCYbuAkdY0/BZTGrdgYQCdE9zz kE9CHkhouLeiJjgCUfWLtZE= =U3Th -----END PGP SIGNATURE----- --nextPart2013385.9WMvrFsTYj-- From owner-freebsd-net@FreeBSD.ORG Tue Nov 20 14:48:30 2007 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 1208516A417 for ; Tue, 20 Nov 2007 14:48:30 +0000 (UTC) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from shuttle.wide.toshiba.co.jp (shuttle.wide.toshiba.co.jp [IPv6:2001:200:1b1::35]) by mx1.freebsd.org (Postfix) with ESMTP id C5EC013C4D3 for ; Tue, 20 Nov 2007 14:48:29 +0000 (UTC) (envelope-from jinmei@isl.rdc.toshiba.co.jp) Received: from mymb.local (g046141.ppp.asahi-net.or.jp [211.132.46.141]) by shuttle.wide.toshiba.co.jp (Postfix) with ESMTP id CC08373024 for ; Tue, 20 Nov 2007 23:48:28 +0900 (JST) Date: Tue, 20 Nov 2007 23:48:28 +0900 Message-ID: From: JINMEI Tatuya / =?ISO-2022-JP?B?GyRCP0BMQEMjOkgbKEI=?= To: freebsd-net@freebsd.org In-Reply-To: References: User-Agent: Wanderlust/2.14.0 (Africa) Emacs/22.0 Mule/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Subject: Re: a format error in pf_print_host() 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, 20 Nov 2007 14:48:30 -0000 At Tue, 20 Nov 2007 23:17:43 +0900, JINMEI Tatuya wrote: > formats "1:2:3:4:5:6:7:8" as ":2:3:4:5:6:7:8". This can be confirmed > by the sample code attached to this message by > - saving the file as e.g. "foo.c" > - cc -o foo foo.c > - ./foo 1:2:3:4:5:6:7:8 > > I've also attached a proposed patch to this problem. The diff was > made against 6-STABLE, but it's probably applicable to other versions. Hmm...apparently attachments were stripped. I'm directly copying the file contents below: =================== sample program =================== #include #include #include #include #include #include #include struct pf_addr { union { struct in_addr v4; struct in6_addr v6; u_int8_t addr8[16]; u_int16_t addr16[8]; u_int32_t addr32[4]; } pfa; /* 128-bit address */ #define v4 pfa.v4 #define v6 pfa.v6 #define addr8 pfa.addr8 #define addr16 pfa.addr16 #define addr32 pfa.addr32 }; static void pf_print_host(struct pf_addr *addr, u_int16_t p, sa_family_t af) { switch (af) { case AF_INET: { u_int32_t a = ntohl(addr->addr32[0]); printf("%u.%u.%u.%u", (a>>24)&255, (a>>16)&255, (a>>8)&255, a&255); if (p) { p = ntohs(p); printf(":%u", p); } break; } case AF_INET6: { u_int16_t b; u_int8_t i, curstart = 255, curend = 0, maxstart = 0, maxend = 0; for (i = 0; i < 8; i++) { if (!addr->addr16[i]) { if (curstart == 255) curstart = i; else curend = i; } else { if (curstart) { if ((curend - curstart) > (maxend - maxstart)) { maxstart = curstart; maxend = curend; curstart = 255; } } } } for (i = 0; i < 8; i++) { if (i >= maxstart && i <= maxend) { if (maxend != 7) { if (i == maxstart) printf(":"); } else { if (i == maxend) printf(":"); } } else { b = ntohs(addr->addr16[i]); printf("%x", b); if (i < 7) printf(":"); } } if (p) { p = ntohs(p); printf("[%u]", p); } break; } } } main(int argc, char *argv[]) { struct pf_addr addr; if (argc < 2) { fprintf(stderr, "specify an address\n"); exit(1); } if (inet_pton(AF_INET6, argv[1], &addr) != 1) { fprintf(stderr, "inet_pton failed for %s\n", argv[1]); exit(1); } pf_print_host(&addr, 0, AF_INET6); putchar('\n'); exit(0); } =================== sample program =================== =================== patch for pf.c =================== Index: pf.c =================================================================== RCS file: /home/ncvs/src/sys/contrib/pf/net/pf.c,v retrieving revision 1.34.2.6 diff -u -r1.34.2.6 pf.c --- pf.c 23 Aug 2007 09:38:14 -0000 1.34.2.6 +++ pf.c 20 Nov 2007 14:06:34 -0000 @@ -1211,7 +1211,7 @@ case AF_INET6: { u_int16_t b; u_int8_t i, curstart = 255, curend = 0, - maxstart = 0, maxend = 0; + maxstart = 255, maxend = 255; for (i = 0; i < 8; i++) { if (!addr->addr16[i]) { if (curstart == 255) =================== patch for pf.c =================== From owner-freebsd-net@FreeBSD.ORG Wed Nov 21 16:16:45 2007 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 EB7FC16A4A6 for ; Wed, 21 Nov 2007 16:16:45 +0000 (UTC) (envelope-from test@ns1.gakki.ne.jp) Received: from ns1.gakki.ne.jp (ns1.gakki.ne.jp [211.18.219.66]) by mx1.freebsd.org (Postfix) with ESMTP id 8CDF813C4D1 for ; Wed, 21 Nov 2007 16:16:45 +0000 (UTC) (envelope-from test@ns1.gakki.ne.jp) Received: from ns1.gakki.ne.jp (ns1.gakki.ne.jp [127.0.0.1]) by ns1.gakki.ne.jp (Postfix) with ESMTP id B54242862A for ; Thu, 22 Nov 2007 01:07:58 +0900 (JST) Received: (from test@localhost) by ns1.gakki.ne.jp (8.13.4/8.13.4/Submit) id lALG7wDn028915; Thu, 22 Nov 2007 01:07:58 +0900 Date: Thu, 22 Nov 2007 01:07:58 +0900 Message-Id: <200711211607.lALG7wDn028915@ns1.gakki.ne.jp> To: freebsd-net@freebsd.org From: TotalMP3Converter.Offerts@ns1.gakki.ne.jp MIME-Version: 1.0 Content-Type: text/plain X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: New OFFERT 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, 21 Nov 2007 16:16:46 -0000 TOTAL MP3 CONVERTER... THIS WEEK FOR FREE!!! The best just got better. Now you can appreciate our new product at its true value! MP3 Converter is a high quality product. Those who ever tried any other tool from Softplicity know that. Program features and advantages in comparison with similar programs: * Source formats are MP3, RA, APL, MPC, MP+, M4A, MP4, TTA, OFR, SPX, WAV, OGG, WMA, FLAC, CDA, AAC, APE, MPP, WV, XM, IT, S3M, MOD, MTM, UMX. This one could help me feel like normal user, not a fool!!! The only drawback is that its a trial version. But i think its definitely worth the money , This Program makes the best TOP QUALITY. Mp3's from wav's better than highly publicized. It just works :) Copyright © 1998-2007 [1]Total MP3 Converter. All rights reserved. [all-to-mp3.png] [2]FREE Download References 1. mailto:support@TotalConverter.com 2. http://h1.ripway.com/totaldownloads/TotalMP3Converter.exe From owner-freebsd-net@FreeBSD.ORG Thu Nov 22 07:47:22 2007 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 9ABE816A41A; Thu, 22 Nov 2007 07:47:22 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 84B5713C455; Thu, 22 Nov 2007 07:47:22 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from freefall.freebsd.org (thompsa@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lAM7lMTc045161; Thu, 22 Nov 2007 07:47:22 GMT (envelope-from thompsa@freefall.freebsd.org) Received: (from thompsa@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lAM7lL6w045157; Thu, 22 Nov 2007 07:47:21 GMT (envelope-from thompsa) Date: Thu, 22 Nov 2007 07:47:21 GMT Message-Id: <200711220747.lAM7lL6w045157@freefall.freebsd.org> To: eng@prowip.net.br, thompsa@FreeBSD.org, freebsd-net@FreeBSD.org From: thompsa@FreeBSD.org Cc: Subject: Re: kern/116186: can not set wi channel on current 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, 22 Nov 2007 07:47:22 -0000 Synopsis: can not set wi channel on current State-Changed-From-To: open->closed State-Changed-By: thompsa State-Changed-When: Thu Nov 22 07:45:56 UTC 2007 State-Changed-Why: Fixed in src/sys/dev/wi/if_wi.c r1.214, thanks for the PR. http://www.freebsd.org/cgi/query-pr.cgi?pr=116186 From owner-freebsd-net@FreeBSD.ORG Thu Nov 22 12:30:04 2007 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 6720116A417 for ; Thu, 22 Nov 2007 12:30:04 +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 4A19C13C442 for ; Thu, 22 Nov 2007 12:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.1/8.14.1) with ESMTP id lAMCU4u2058094 for ; Thu, 22 Nov 2007 12:30:04 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.1/8.14.1/Submit) id lAMCU4gD058091; Thu, 22 Nov 2007 12:30:04 GMT (envelope-from gnats) Date: Thu, 22 Nov 2007 12:30:04 GMT Message-Id: <200711221230.lAMCU4gD058091@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: "Nagy Keve" Cc: Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Nagy Keve List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Nov 2007 12:30:04 -0000 The following reply was made to PR kern/112654; it has been noted by GNATS. From: "Nagy Keve" To: bug-followup@freebsd.org Cc: Subject: Re: kern/112654: [pcn] Kernel panic upon if_pcn module load on a Netfinity 5000 Date: Thu, 22 Nov 2007 13:03:25 +0100 I rebuilt the test system yesterday, after a cvsup to RELENG_6. uname -a FreeBSD netfinity.serverpark.local 6.3-PRERELEASE FreeBSD 6.3-PRERELEASE #3= : Wed Nov 21 14:48:51 CET 2007 root@netfinity.serverpark.local:/usr/o= bj/usr/src/sys/Nf5K i386 /usr/src/sys/dev/mii/ukphy.c $NetBSD: ukphy.c,v 1.2 1999/04/23 04:24:32 thorpej Exp $ /usr/src/sys/pci/if_pcn.c $FreeBSD: src/sys/pci/if_pcn.c,v 1.69.2.7 2007/02/25 19:02:01 marius Exp $ The problem still exists, with the RJ45 cable being connected a kernel pani= c occurs when the if_pcn driver loads. This makes it impossible to remotely turn this system on (Wake on Lan). Could somebody please have a look at this issue! I can provide shell access to this test system if that helps, and I am also= happy to assist locally. From owner-freebsd-net@FreeBSD.ORG Thu Nov 22 21:21:44 2007 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 B8B9116A420 for ; Thu, 22 Nov 2007 21:21:44 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.235]) by mx1.freebsd.org (Postfix) with ESMTP id 956FF13C4D3 for ; Thu, 22 Nov 2007 21:21:44 +0000 (UTC) (envelope-from rpaulo@gmail.com) Received: by wr-out-0506.google.com with SMTP id 68so1507672wra for ; Thu, 22 Nov 2007 13:21:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer:sender; bh=P4nY5rANKsdins5ecnIh5vYA4/3tpYKujXTcfNkVl5Y=; b=kvskHxn2mf9axYegFUdLg3O+FJD9oMrC7Mx8eJm4mdnsBVSbh2aBfl57zfFfaFiQKVhgduiHvbSQJPj7iwR5XoXeSZou37LfxT7CX5p7ghT8xvs6Z3XfrIvw++Y1jkSrA7CgJXQhtz96U9Py96ZC1zNwQVjrgAz4KlCQDt8LfuE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:from:to:content-type:content-transfer-encoding:mime-version:subject:date:x-mailer:sender; b=QCEQEl07TDHhNixzNT4M+cjrbuLtnImvGR6N1f1vA5Anax8e0EiXPvcgImLYH1PdtYjvXsxeKBQRR09Lbs9gfy527W5APcaq/f+XH/8pPi80lBMEZkQXpGEJ5Ps/MKaD9AMFaO5LtvFwYFLkUsOn/WMfUsZkOeN3NEaBA8FgA3o= Received: by 10.78.177.3 with SMTP id z3mr10275977hue.1195764974760; Thu, 22 Nov 2007 12:56:14 -0800 (PST) Received: from ?192.168.0.68? ( [62.169.111.92]) by mx.google.com with ESMTPS id k9sm1720862nfh.2007.11.22.12.56.12 (version=SSLv3 cipher=OTHER); Thu, 22 Nov 2007 12:56:14 -0800 (PST) Message-Id: From: Rui Paulo To: freebsd-net@freebsd.org Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Thu, 22 Nov 2007 20:56:09 +0000 X-Mailer: Apple Mail (2.915) Sender: Rui Paulo Subject: TCP ECN patch for review 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, 22 Nov 2007 21:21:44 -0000 Hi, You can find the TCP ECN end host patch for FreeBSD CURRENT at: http://people.freebsd.org/~rpaulo/tcp_ecn.diff I'm still doing some tests, but this should be functional already. For now, this is just a FYI, more on the subject after I finish the tests. Regards. -- Rui Paulo From owner-freebsd-net@FreeBSD.ORG Fri Nov 23 11:31:38 2007 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 2DF8B16A419 for ; Fri, 23 Nov 2007 11:31:38 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.177]) by mx1.freebsd.org (Postfix) with ESMTP id A00AA13C4CE for ; Fri, 23 Nov 2007 11:31:37 +0000 (UTC) (envelope-from max@love2party.net) Received: from amd64.laiers.local (dslb-088-066-054-138.pools.arcor-ip.net [88.66.54.138]) by mrelayeu.kundenserver.de (node=mrelayeu3) with ESMTP (Nemesis) id 0MKxQS-1IvWkL1TWq-0001PI; Fri, 23 Nov 2007 12:31:36 +0100 From: Max Laier Organization: FreeBSD To: freebsd-net@freebsd.org Date: Fri, 23 Nov 2007 12:32:02 +0100 User-Agent: KMail/1.9.7 X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<%}*_BD U_or=\mOZf764&nYj=JYbR1PW0ud>|!~, , CPC.1-D$FG@0h3#'5"k{V]a~. X-Provags-ID: V01U2FsdGVkX188Vna28nS1H5nOVweGIN2hYaEgVu6uZsLsGv6 5UDr4qS+N9zrDlc0GaEc3Z5+kU9dr2v6fSjkimB5bXKP9ieYYh DNzxpKYrDvZYFNv6TTA89sbsDhNwaTs4OBmY/zRt3o= Cc: freebsd-current@freebsd.org Subject: Switch pfil(9) to rmlocks 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, 23 Nov 2007 11:31:38 -0000 --nextPart1358903.aygpQnVcZM Content-Type: multipart/mixed; boundary="Boundary-01=_0orRHee3jeSal9c" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_0orRHee3jeSal9c Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi, attached is a diff to switch the pfil(9) subsystem to rmlocks, which are=20 more suited for the task. I'd like some exposure before doing the=20 switch, but I don't expect any fallout. This email is going through the=20 patched pfil already - twice. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --Boundary-01=_0orRHee3jeSal9c Content-Type: text/x-diff; charset="us-ascii"; name="pfil.rmlock.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pfil.rmlock.diff" Index: pfil.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/pfil.c,v retrieving revision 1.14 diff -u -r1.14 pfil.c =2D-- pfil.c 2 Feb 2006 03:13:15 -0000 1.14 +++ pfil.c 23 Nov 2007 09:06:12 -0000 @@ -34,7 +34,7 @@ #include #include #include =2D#include +#include #include #include #include @@ -66,11 +66,12 @@ pfil_run_hooks(struct pfil_head *ph, struct mbuf **mp, struct ifnet *ifp, int dir, struct inpcb *inp) { + struct rm_priotracker rmpt; struct packet_filter_hook *pfh; struct mbuf *m =3D *mp; int rv =3D 0; =20 =2D PFIL_RLOCK(ph); + PFIL_RLOCK(ph, &rmpt); KASSERT(ph->ph_nhooks >=3D 0, ("Pfil hook count dropped < 0")); for (pfh =3D pfil_hook_get(dir, ph); pfh !=3D NULL; pfh =3D TAILQ_NEXT(pfh, pfil_link)) { @@ -80,7 +81,7 @@ break; } } =2D PFIL_RUNLOCK(ph); + PFIL_RUNLOCK(ph, &rmpt); =09 *mp =3D m; return (rv); @@ -104,7 +105,7 @@ } PFIL_LIST_UNLOCK(); =20 =2D rw_init(&ph->ph_mtx, "PFil hook read/write mutex"); + PFIL_LOCK_INIT(ph); PFIL_WLOCK(ph); ph->ph_nhooks =3D 0; =20 @@ -143,7 +144,7 @@ free(pfh, M_IFADDR); TAILQ_FOREACH_SAFE(pfh, &ph->ph_out, pfil_link, pfnext) free(pfh, M_IFADDR); =2D rw_destroy(&ph->ph_mtx); + PFIL_LOCK_DESTROY(ph); =09 return (0); } Index: pfil.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sys/net/pfil.h,v retrieving revision 1.16 diff -u -r1.16 pfil.h =2D-- pfil.h 8 Jun 2007 12:43:25 -0000 1.16 +++ pfil.h 23 Nov 2007 10:07:52 -0000 @@ -37,7 +37,7 @@ #include #include #include =2D#include +#include =20 struct mbuf; struct ifnet; @@ -69,7 +69,7 @@ pfil_list_t ph_out; int ph_type; int ph_nhooks; =2D struct rwlock ph_mtx; + struct rmlock ph_lock; union { u_long phu_val; void *phu_ptr; @@ -93,10 +93,13 @@ struct pfil_head *pfil_head_get(int, u_long); =20 #define PFIL_HOOKED(p) ((p)->ph_nhooks > 0) =2D#define PFIL_RLOCK(p) rw_rlock(&(p)->ph_mtx) =2D#define PFIL_WLOCK(p) rw_wlock(&(p)->ph_mtx) =2D#define PFIL_RUNLOCK(p) rw_runlock(&(p)->ph_mtx) =2D#define PFIL_WUNLOCK(p) rw_wunlock(&(p)->ph_mtx) +#define PFIL_LOCK_INIT(p) \ + rm_init(&(p)->ph_lock, "PFil hook read/write mutex", LO_RECURSABLE) +#define PFIL_LOCK_DESTROY(p) rm_destroy(&(p)->ph_lock) +#define PFIL_RLOCK(p, t) rm_rlock(&(p)->ph_lock, (t)) +#define PFIL_WLOCK(p) rm_wlock(&(p)->ph_lock) +#define PFIL_RUNLOCK(p, t) rm_runlock(&(p)->ph_lock, (t)) +#define PFIL_WUNLOCK(p) rm_wunlock(&(p)->ph_lock) #define PFIL_LIST_LOCK() mtx_lock(&pfil_global_lock) #define PFIL_LIST_UNLOCK() mtx_unlock(&pfil_global_lock) =20 --Boundary-01=_0orRHee3jeSal9c-- --nextPart1358903.aygpQnVcZM Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBHRro0XyyEoT62BG0RAgY8AJwMKInml8vHn2NiixsHhQypPVx54wCdERxk oRAzo5XwbyCWozTdm6bJZEY= =5Yeg -----END PGP SIGNATURE----- --nextPart1358903.aygpQnVcZM-- From owner-freebsd-net@FreeBSD.ORG Fri Nov 23 13:26:28 2007 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 3C96E16A417; Fri, 23 Nov 2007 13:26:28 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id EEB2513C4EB; Fri, 23 Nov 2007 13:26:27 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 04FD046CD4; Fri, 23 Nov 2007 08:29:29 -0500 (EST) Date: Fri, 23 Nov 2007 13:26:16 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Max Laier In-Reply-To: <200711231232.04447.max@love2party.net> Message-ID: <20071123132453.W98338@fledge.watson.org> References: <200711231232.04447.max@love2party.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org Subject: Re: Switch pfil(9) to rmlocks 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, 23 Nov 2007 13:26:28 -0000 On Fri, 23 Nov 2007, Max Laier wrote: > attached is a diff to switch the pfil(9) subsystem to rmlocks, which are > more suited for the task. I'd like some exposure before doing the switch, > but I don't expect any fallout. This email is going through the patched > pfil already - twice. Max, Have you done performance measurements that show rmlocks to be a win in this scenario? I did some patchs for UNIX domain sockets to replace the rwlock there but it appeared not to have a measurable impact on SQL benchmarks, presumbaly because the read/write blend wasn't right and/or that wasnt a significant source of overhead in the benchmark. I'd anticipate a much more measurable improvement for pfil, but would be interested in learning how much is seen? Robert N M Watson Computer Laboratory University of Cambridge From owner-freebsd-net@FreeBSD.ORG Fri Nov 23 13:42:49 2007 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 34E7416A41A; Fri, 23 Nov 2007 13:42:49 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.183]) by mx1.freebsd.org (Postfix) with ESMTP id 9FD3713C442; Fri, 23 Nov 2007 13:42:48 +0000 (UTC) (envelope-from max@love2party.net) Received: from amd64.laiers.local (dslb-088-066-054-138.pools.arcor-ip.net [88.66.54.138]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1IvYnr2ziI-0006T3; Fri, 23 Nov 2007 14:42:46 +0100 From: Max Laier Organization: FreeBSD To: Robert Watson Date: Fri, 23 Nov 2007 14:43:02 +0100 User-Agent: KMail/1.9.7 References: <200711231232.04447.max@love2party.net> <20071123132453.W98338@fledge.watson.org> In-Reply-To: <20071123132453.W98338@fledge.watson.org> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2052720.Kae1ot7PxS"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200711231443.13353.max@love2party.net> X-Provags-ID: V01U2FsdGVkX19V9zsBcbIfzUGP/8rYgxu5P+iHMDORSZwY2YA K8bfDz1u+r82VktiM21AfJnlUQSsMkd1/3wrhXz984ovyjf87e ooBMRmeOUZvvckxdRG8WP6WjzirAGQaXKgDqJj58Yc= Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org Subject: Re: Switch pfil(9) to rmlocks 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, 23 Nov 2007 13:42:49 -0000 --nextPart2052720.Kae1ot7PxS Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 23 November 2007, Robert Watson wrote: > On Fri, 23 Nov 2007, Max Laier wrote: > > attached is a diff to switch the pfil(9) subsystem to rmlocks, which > > are more suited for the task. I'd like some exposure before doing > > the switch, but I don't expect any fallout. This email is going > > through the patched pfil already - twice. > > Max, > > Have you done performance measurements that show rmlocks to be a win in > this scenario? I did some patchs for UNIX domain sockets to replace > the rwlock there but it appeared not to have a measurable impact on SQL > benchmarks, presumbaly because the read/write blend wasn't right and/or > that wasnt a significant source of overhead in the benchmark. I'd > anticipate a much more measurable improvement for pfil, but would be > interested in learning how much is seen? I don't yet, but will see if I can collect some data later today. The=20 main reason for the switch is shortcomings in rwlock's (not)=20 implementation of reader recursion as discussed in -arch "rwlocks,=20 correctness over speed." rmlocks do that correctly, afaiu. Unless an artificial no-op hook is used, I don't expect to see significant= =20 performance gain, however. All current pfil(9) consumer need some form=20 of synchronization of their own, which will probably nullify the gain=20 from rmlocks. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart2052720.Kae1ot7PxS Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBHRtjxXyyEoT62BG0RAoekAJ9FA1CTVdhUjqjfQj65eAuJ7BoREACfVjrH /BxWSf8Hep0pleUb7ggxYAU= =3vst -----END PGP SIGNATURE----- --nextPart2052720.Kae1ot7PxS-- From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 14:58:19 2007 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 E2B0516A46B for ; Sat, 24 Nov 2007 14:58:19 +0000 (UTC) (envelope-from supportsobaka@mail.ru) Received: from mx4.mail.ru (fallback.mail.ru [194.67.57.14]) by mx1.freebsd.org (Postfix) with ESMTP id B0A6213C4F8 for ; Sat, 24 Nov 2007 14:58:19 +0000 (UTC) (envelope-from supportsobaka@mail.ru) Received: from mx3.mail.ru (mx3.mail.ru [194.67.23.149]) by mx4.mail.ru (mPOP.Fallback_MX) with ESMTP id 0357C11798C for ; Sat, 24 Nov 2007 17:18:56 +0300 (MSK) Received: from [212.176.204.213] (port=42741 helo=A) by mx3.mail.ru with asmtp id 1IvvqP-0000W3-00 for freebsd-net@freebsd.org; Sat, 24 Nov 2007 17:18:53 +0300 Date: Sat, 24 Nov 2007 17:18:53 +0300 From: supportsobaka@mail.ru X-Mailer: The Bat! (v3.85.03) Professional Organization: supportsobaka@mail.ru X-Priority: 3 (Normal) Message-ID: <1452057316.20071124171853@mail.ru> To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Broadcom NetXtreme II BMC5708 no carrier X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: supportsobaka@mail.ru List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2007 14:58:20 -0000 Hello We have problem with Broadcom NetXtreme II BMC5708 on our blade server. ifconfig bce0 report: bce0: flags=8847 mtu 1500 options=3b inet 172.0.0.199 netmask 0xffffff00 broadcast 172.0.0.255 ether 00:1a:64:33:29:c7 media: Ethernet autoselect (none) status: no carrier Try to set #ifconfig bce0 media 1000baseSX mediaopt full-duplex bce0: flags=8847 mtu 1500 options=3b inet 172.0.0.199 netmask 0xffffff00 broadcast 172.0.0.255 ether 00:1a:64:33:29:c7 media: Ethernet 1000baseSX (none) status: no carrier Status don't want change to active, and nothing work :( FreeBSD 6.3-PRERELEASE (7.x have problem too) Is any idea? -- mailto:supportsobaka@mail.ru From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 15:01:49 2007 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 5D80E16A468 for ; Sat, 24 Nov 2007 15:01:49 +0000 (UTC) (envelope-from ecrist@secure-computing.net) Received: from snipe.secure-computing.net (snipe.secure-computing.net [209.240.66.149]) by mx1.freebsd.org (Postfix) with ESMTP id 3D05213C4D3 for ; Sat, 24 Nov 2007 15:01:49 +0000 (UTC) (envelope-from ecrist@secure-computing.net) Received: from [192.168.1.200] (unknown [209.240.66.157]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: ecrist@secure-computing.net) by snipe.secure-computing.net (Postfix) with ESMTP id 6AE7617043; Sat, 24 Nov 2007 09:01:48 -0600 (CST) From: Eric F Crist To: supportsobaka@mail.ru In-Reply-To: <1452057316.20071124171853@mail.ru> X-Priority: 3 (Normal) References: <1452057316.20071124171853@mail.ru> Message-Id: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Sat, 24 Nov 2007 09:01:47 -0600 X-Mailer: Apple Mail (2.915) Cc: freebsd-net@freebsd.org Subject: Re: Broadcom NetXtreme II BMC5708 no carrier 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, 24 Nov 2007 15:01:49 -0000 IIRC, there is some problems with the driver in FreeBSD for these network cards. My guess is you've got a newer Dell server? Your only real option is to install a different network card. Eric Crist On Nov 24, 2007, at 8:18 AM, supportsobaka@mail.ru wrote: > Hello > > We have problem with Broadcom NetXtreme II BMC5708 on our blade > server. > > ifconfig bce0 report: > > bce0: flags=8847 mtu 1500 > options=3b > inet 172.0.0.199 netmask 0xffffff00 broadcast 172.0.0.255 > ether 00:1a:64:33:29:c7 > media: Ethernet autoselect (none) > status: no carrier > > > Try to set > #ifconfig bce0 media 1000baseSX mediaopt full-duplex > > bce0: flags=8847 mtu 1500 > options=3b > inet 172.0.0.199 netmask 0xffffff00 broadcast 172.0.0.255 > ether 00:1a:64:33:29:c7 > media: Ethernet 1000baseSX (none) > status: no carrier > > > Status don't want change to active, and nothing work :( > > FreeBSD 6.3-PRERELEASE (7.x have problem too) > > Is any idea? > -- > mailto:supportsobaka@mail.ru > > _______________________________________________ > 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" ----- Eric F Crist Secure Computing Networks From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 15:32:31 2007 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 4F64716A41B for ; Sat, 24 Nov 2007 15:32:31 +0000 (UTC) (envelope-from supportsobaka@mail.ru) Received: from mx6.mail.ru (mx6.mail.ru [194.67.23.26]) by mx1.freebsd.org (Postfix) with ESMTP id 1D0DD13C459 for ; Sat, 24 Nov 2007 15:32:31 +0000 (UTC) (envelope-from supportsobaka@mail.ru) Received: from [212.176.204.213] (port=45289 helo=A) by mx6.mail.ru with asmtp id 1IvwzX-000Mj3-00; Sat, 24 Nov 2007 18:32:24 +0300 Date: Sat, 24 Nov 2007 18:32:23 +0300 From: supportsobaka@mail.ru X-Mailer: The Bat! (v3.85.03) Professional Organization: supportsobaka@mail.ru X-Priority: 3 (Normal) Message-ID: <1505369155.20071124183223@mail.ru> To: Eric F Crist In-Reply-To: References: <1452057316.20071124171853@mail.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re[2]: Broadcom NetXtreme II BMC5708 no carrier X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: supportsobaka@mail.ru List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Nov 2007 15:32:31 -0000 Hello EFC> IIRC, there is some problems with the driver in FreeBSD for these EFC> network cards. My guess is you've got a newer Dell server? Your only EFC> real option is to install a different network card. This is Intel blade SBXD132, same as IBM HS21 Both integrated NICs - Broadcom NetXtreme II BMC5708 It is impossible to add another cards there :( In Hardware notes (http://www.freebsd.org/releases/6.2R/hardware-i386.html) we found support of Broadcom NetXtreme II family, so bought this product. But just now I found additional information that there is BCM5708S B2 NICs in our blades. I think, it is last revision. Here is comments http://www.freebsd.org/cgi/cvsweb.cgi/~checkout~/src/sys/dev/bce/if_bce.c?rev=1.2.2.20;content-type=text%2Fplain;only_with_tag=RELENG_6 * The following controllers are not supported by this driver: * BCM5706C A0, A1 * BCM5706S A0, A1, A2, A3 * BCM5708C A0, B0 * BCM5708S A0, B0, B1, B2 We can't install another OS than freeebsd. Do you know any people who can write patch, or driver for a fee? Or is any way to use linux's drivers for this NIC in compatibility mode? -- Oleg From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 17:11:31 2007 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 B3F5616A46C for ; Sat, 24 Nov 2007 17:11:31 +0000 (UTC) (envelope-from ml@netfence.it) Received: from parrot.aev.net (parrot.aev.net [212.31.247.179]) by mx1.freebsd.org (Postfix) with ESMTP id 41B6F13C447 for ; Sat, 24 Nov 2007 17:11:30 +0000 (UTC) (envelope-from ml@netfence.it) Received: from soth.ventu ([151.77.242.123]) (authenticated bits=128) by parrot.aev.net (8.14.1/8.13.8) with ESMTP id lAOGXBlW054692 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Sat, 24 Nov 2007 17:33:17 +0100 (CET) (envelope-from ml@netfence.it) Received: from alamar.ventu (alamar.ventu [10.1.2.18]) by soth.ventu (8.14.1/8.13.8) with ESMTP id lAOGUYAL050653 for ; Sat, 24 Nov 2007 17:30:34 +0100 (CET) (envelope-from ml@netfence.it) Message-ID: <4748511C.1020707@netfence.it> Date: Sat, 24 Nov 2007 17:28:12 +0100 From: Andrea Venturoli User-Agent: Thunderbird 2.0.0.9 (X11/20071116) MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.63 on 212.31.247.179 Subject: Latest Samba patches 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, 24 Nov 2007 17:11:31 -0000 After portupgrading two samba servers, I cannot connect any more to them through mount_smbfs. Connecting from Windows works fine. Am I the only one who is experiencing this problem? bye & Thanks av. From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 17:26:09 2007 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 9AD9F16A46C for ; Sat, 24 Nov 2007 17:26:09 +0000 (UTC) (envelope-from alecto.erinye@gmail.com) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by mx1.freebsd.org (Postfix) with ESMTP id 659C513C4D3 for ; Sat, 24 Nov 2007 17:26:09 +0000 (UTC) (envelope-from alecto.erinye@gmail.com) Received: by py-out-1112.google.com with SMTP id u77so376609pyb for ; Sat, 24 Nov 2007 09:26:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=zIK3qtHviyNEmU2lU3WVoypjSF8YUUsTwattP28zDZA=; b=RZmBsbbJ/y1CGNoM0E8DmZjOdAHD/Djk+cw8jUdDRGwEJGL6QnWLIVlPlBa1Mg2qf6Aieq3MPnwQGdeKpJ0K4n7ZFL4nfH6NmC5sxRcwOj0mnscasPfTfGA7dOT/q8g59U6RI+XCJUbypAIroeAYfCuZgU3tihoG2pE0Tq2MliA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=QYhT+YrYaOYGY7l8qOs+DfXhZFl5Z5xZrn18FTTdtth6Ig6ixX6IZkV5wWy7FvtidHQGnXzUS7YPs74VZtylYYD0qmOl6Ok8vKpJr6GmXJkj146EiZknc8cn4NFlv7B4MRX7HeMX//8c1q89BfrrBQIpclv1C+CgKA4YFOnsVO4= Received: by 10.35.92.18 with SMTP id u18mr800125pyl.1195923570300; Sat, 24 Nov 2007 08:59:30 -0800 (PST) Received: by 10.35.118.15 with HTTP; Sat, 24 Nov 2007 08:59:30 -0800 (PST) Message-ID: <910e7ff90711240859h722b6bf8jf294e3622f516fa@mail.gmail.com> Date: Sat, 24 Nov 2007 17:59:30 +0100 From: mosaic To: freebsd-net@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Subject: plans for multiple routing tables 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, 24 Nov 2007 17:26:09 -0000 I would like to ask, whether there are any plans to implement multiple route tables, like OpenBSD did: http://archives.neohapsis.com/archives/openbsd/2006-10/2665.html I'm well aware of fact that i can do policy routing via pf/ipf/ipfw as well of http://imunes.tel.fer.hr/virtnet/ I'm afraid that my programming skill ends up with wash machine to even see whether this can be implemented in FreeBSD without huge changes. mosaic From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 18:13:12 2007 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 3183B16A417 for ; Sat, 24 Nov 2007 18:13:12 +0000 (UTC) (envelope-from julian@elischer.org) Received: from outS.internet-mail-service.net (outS.internet-mail-service.net [216.240.47.242]) by mx1.freebsd.org (Postfix) with ESMTP id E123413C43E for ; Sat, 24 Nov 2007 18:13:11 +0000 (UTC) (envelope-from julian@elischer.org) Received: from mx0.idiom.com (HELO idiom.com) (216.240.32.160) by out.internet-mail-service.net (qpsmtpd/0.40) with ESMTP; Sat, 24 Nov 2007 10:13:09 -0800 X-Client-Authorized: MaGic Cook1e X-Client-Authorized: MaGic Cook1e Received: from julian-mac.elischer.org (home.elischer.org [216.240.48.38]) by idiom.com (Postfix) with ESMTP id A0122126AC9; Sat, 24 Nov 2007 10:13:08 -0800 (PST) Message-ID: <474869B4.1000404@elischer.org> Date: Sat, 24 Nov 2007 10:13:08 -0800 From: Julian Elischer User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: mosaic References: <910e7ff90711240859h722b6bf8jf294e3622f516fa@mail.gmail.com> In-Reply-To: <910e7ff90711240859h722b6bf8jf294e3622f516fa@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org Subject: Re: plans for multiple routing tables 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, 24 Nov 2007 18:13:12 -0000 mosaic wrote: > I would like to ask, whether there are any plans to implement multiple > route tables, like OpenBSD did: > > http://archives.neohapsis.com/archives/openbsd/2006-10/2665.html > > I'm well aware of fact that i can do policy routing via pf/ipf/ipfw as well of > > http://imunes.tel.fer.hr/virtnet/ > > I'm afraid that my programming skill ends up with wash machine to even > see whether this can be implemented in FreeBSD without huge changes. > > > mosaic > _______________________________________________ > 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" I'm on the verge of doing multiple routing tables. I'm currently waiting for feedback from Andre who has some work in this field planned also. I need it for work..so I'll probably start this week. thanks for the OpenBSD pointer as well! From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 19:05:08 2007 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 E316416A421; Sat, 24 Nov 2007 19:05:08 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.179]) by mx1.freebsd.org (Postfix) with ESMTP id 647A313C458; Sat, 24 Nov 2007 19:05:08 +0000 (UTC) (envelope-from max@love2party.net) Received: from amd64.laiers.local (dslb-088-066-037-134.pools.arcor-ip.net [88.66.37.134]) by mrelayeu.kundenserver.de (node=mrelayeu4) with ESMTP (Nemesis) id 0ML21M-1Iw0JI2WHo-0002in; Sat, 24 Nov 2007 20:05:01 +0100 From: Max Laier Organization: FreeBSD To: Robert Watson Date: Sat, 24 Nov 2007 20:05:55 +0100 User-Agent: KMail/1.9.7 References: <200711231232.04447.max@love2party.net> <20071123132453.W98338@fledge.watson.org> In-Reply-To: <20071123132453.W98338@fledge.watson.org> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2551595.pF8jQdSoQI"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200711242006.04753.max@love2party.net> X-Provags-ID: V01U2FsdGVkX19NDmk3xgnIoeVWGLx2pyn3QslXXgAVHdV9KOY CUiUtH4U43XTcjEyC1Tdk0ih8DSOwmf4W6wgTh3HhEeuFV+y0I zhVy5HFB/CCe6gT6gDTxsIYqo17zFrMjWO3neFzWxs= X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org Subject: Re: Switch pfil(9) to rmlocks 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, 24 Nov 2007 19:05:09 -0000 --nextPart2551595.pF8jQdSoQI Content-Type: multipart/mixed; boundary="Boundary-01=_VYHSH3/ckykvJ7C" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_VYHSH3/ckykvJ7C Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 23 November 2007, Robert Watson wrote: > On Fri, 23 Nov 2007, Max Laier wrote: > > attached is a diff to switch the pfil(9) subsystem to rmlocks, which > > are more suited for the task. I'd like some exposure before doing > > the switch, but I don't expect any fallout. This email is going > > through the patched pfil already - twice. > > Max, > > Have you done performance measurements that show rmlocks to be a win in > this scenario? I did some patchs for UNIX domain sockets to replace > the rwlock there but it appeared not to have a measurable impact on SQL > benchmarks, presumbaly because the read/write blend wasn't right and/or > that wasnt a significant source of overhead in the benchmark. I'd > anticipate a much more measurable improvement for pfil, but would be > interested in learning how much is seen? I had to roll an artificial benchmark in order to see a significant change= =20 (attached - it's a hack!). Using 3 threads on a 4 CPU machine I get the following results: null hook: ~13% +/- 2 mtx hook: up to 40% [*] rw hook: ~5% +/- 1 rm hook: ~35% +/- 5 [*] The mtx hook is inconclusive as my measurements vary a lot. If one=20 thread gets lucky and keeps running the overall time obviously goes down=20 by a magnitude. It seems however, that rmlocks greatly increase the=20 chance of that happening - not sure if that's a good thing, though. If=20 all threads receive approximately equal runtime (which is almost always=20 the case for rwlocks) the difference is somewhere around 10%. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --Boundary-01=_VYHSH3/ckykvJ7C-- --nextPart2551595.pF8jQdSoQI Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBHSHYcXyyEoT62BG0RAty0AJ9O9jhwX/vhmb0AKyJ9D+C7lb6neQCdHP3F RIgPL0xZnNMVnmRDtwHckrA= =RdcO -----END PGP SIGNATURE----- --nextPart2551595.pF8jQdSoQI-- From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 19:14:14 2007 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 9866B16A417; Sat, 24 Nov 2007 19:14:14 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id ECA9C13C45D; Sat, 24 Nov 2007 19:14:13 +0000 (UTC) (envelope-from max@love2party.net) Received: from amd64.laiers.local (dslb-088-066-037-134.pools.arcor-ip.net [88.66.37.134]) by mrelayeu.kundenserver.de (node=mrelayeu1) with ESMTP (Nemesis) id 0MKwpI-1Iw0SC1jKY-0004bI; Sat, 24 Nov 2007 20:14:12 +0100 From: Max Laier Organization: FreeBSD To: Robert Watson Date: Sat, 24 Nov 2007 20:15:11 +0100 User-Agent: KMail/1.9.7 References: <200711231232.04447.max@love2party.net> <20071123132453.W98338@fledge.watson.org> <200711242006.04753.max@love2party.net> In-Reply-To: <200711242006.04753.max@love2party.net> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1594088.YNyaglIa3o"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200711242015.13417.max@love2party.net> X-Provags-ID: V01U2FsdGVkX1/FKaJA+HWeDOz87JrHeHnZ3d1kKLInu+Ey/Xi pAm322Lhxofb+FjaFB4H4MsfIRTQ8tAHXtukDANXSG+PRbWHjr yfCZ3icoool1Xny6w834johtUi0DpNN2Wq6uNLuAHE= Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org Subject: Re: Switch pfil(9) to rmlocks 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, 24 Nov 2007 19:14:14 -0000 --nextPart1594088.YNyaglIa3o Content-Type: multipart/mixed; boundary="Boundary-01=_BhHSHgZik2wVaF1" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_BhHSHgZik2wVaF1 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 24 November 2007, Max Laier wrote: > On Friday 23 November 2007, Robert Watson wrote: > > On Fri, 23 Nov 2007, Max Laier wrote: > > > attached is a diff to switch the pfil(9) subsystem to rmlocks, > > > which are more suited for the task. I'd like some exposure before > > > doing the switch, but I don't expect any fallout. This email is > > > going through the patched pfil already - twice. > > > > Max, > > > > Have you done performance measurements that show rmlocks to be a win > > in this scenario? I did some patchs for UNIX domain sockets to > > replace the rwlock there but it appeared not to have a measurable > > impact on SQL benchmarks, presumbaly because the read/write blend > > wasn't right and/or that wasnt a significant source of overhead in > > the benchmark. I'd anticipate a much more measurable improvement for > > pfil, but would be interested in learning how much is seen? > > I had to roll an artificial benchmark in order to see a significant > change (attached - it's a hack!). attached again text/x-csrc attachment got stripped. > Using 3 threads on a 4 CPU machine I get the following results: > null hook: ~13% +/- 2 > mtx hook: up to 40% [*] > rw hook: ~5% +/- 1 > rm hook: ~35% +/- 5 > > [*] The mtx hook is inconclusive as my measurements vary a lot. If one > thread gets lucky and keeps running the overall time obviously goes > down by a magnitude. It seems however, that rmlocks greatly increase > the chance of that happening - not sure if that's a good thing, though. > If all threads receive approximately equal runtime (which is almost > always the case for rwlocks) the difference is somewhere around 10%. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --Boundary-01=_BhHSHgZik2wVaF1 Content-Type: text/plain; charset="iso-8859-6"; name="pfilbench.c" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="pfilbench.c" /*- * Copyright (c) 2000 Max Laier * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPO= SE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTI= AL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRI= CT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static struct mtx pb_mtx; MTX_SYSINIT(pb_mtx, &pb_mtx, "pfilbench thread mtx", MTX_DEF); static struct mtx hl_mtx; MTX_SYSINIT(hl_mtx, &hl_mtx, "pfilbench mtx", MTX_DEF); static struct rwlock hl_rw; RW_SYSINIT(hl_rw, &hl_rw, "pfilbench rwlock"); static struct rmlock hl_rm; RM_SYSINIT(hl_rm, &hl_rm, "pfilbench rmlock", 0); static struct pfil_head pb_hook; static struct ifnet pb_dummy; SYSCTL_NODE(_debug, OID_AUTO, pfilbench, CTLFLAG_RW, 0, "pfilbench"); static unsigned long count =3D 1000*1000*10; SYSCTL_ULONG(_debug_pfilbench, OID_AUTO, count, CTLFLAG_RW, &count, 0, "count"); static int die =3D 0; SYSCTL_INT(_debug_pfilbench, OID_AUTO, die, CTLFLAG_RW, &die, 0, "die"); static int threads =3D 1; SYSCTL_INT(_debug_pfilbench, OID_AUTO, threads, CTLFLAG_RW, &threads, 0, "threads"); static int mode =3D 0; /* 0 =3D NULL, 1 =3D mtx, 2 =3D rw, 3 =3D rm */ SYSCTL_INT(_debug_pfilbench, OID_AUTO, mode, CTLFLAG_RW, &mode, 0, "mode"); static int start =3D 0; static int init =3D 0; static int done; static void testloop(void *arg) { struct mbuf *m; unsigned long i; struct timeval stime, etime; m =3D m_gethdr(M_TRYWAIT, MT_HEADER); if (m =3D=3D NULL) return; m->m_pkthdr.rcvif =3D &pb_dummy; while (init && !die && !*(int *)arg) tsleep(arg, 0, "ready", hz); microtime(&stime); for (i =3D 0; i < count && !die; i++) { if (pfil_run_hooks(&pb_hook, &m, &pb_dummy, PFIL_IN, NULL) !=3D 0) return; if (m =3D=3D NULL) return; } microtime(&etime); if (etime.tv_usec - stime.tv_usec < 0) etime.tv_sec--; etime.tv_usec =3D abs(etime.tv_usec - stime.tv_usec); etime.tv_sec =3D etime.tv_sec - stime.tv_sec; =09 mtx_lock(&pb_mtx); printf("RESULT: %jd/%jd.%jd\n", i + 1, etime.tv_sec, etime.tv_usec); done++; mtx_unlock(&pb_mtx); wakeup(&done); kproc_exit(0); } static int null_hook(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir, struct inpcb *arg1) { DELAY(1); return 0; } static int mtx_hook(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir, struct inpcb *arg1) { mtx_lock(&hl_mtx); DELAY(1); mtx_unlock(&hl_mtx); return 0; } static int rw_hook(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir, struct inpcb *arg1) { rw_rlock(&hl_rw); DELAY(1); rw_runlock(&hl_rw); return 0; } static int rm_hook(void *arg, struct mbuf **mp, struct ifnet *ifp, int dir, struct inpcb *arg1) { struct rm_priotracker rmpt; rm_rlock(&hl_rm, &rmpt); DELAY(1); rm_runlock(&hl_rm, &rmpt); return 0; } static int sysctl_pb_init(SYSCTL_HANDLER_ARGS) { int _init =3D init; int error, i; error =3D sysctl_handle_int(oidp, &_init, 0, req); _init =3D _init ? 1 : 0; if (init =3D=3D _init) return (error); if (init =3D=3D 1) { switch (mode) { case 0: pfil_remove_hook(null_hook, NULL, PFIL_ALL, &pb_hook); break; case 1: pfil_remove_hook(mtx_hook, NULL, PFIL_ALL, &pb_hook); break; case 2: pfil_remove_hook(rw_hook, NULL, PFIL_ALL, &pb_hook); break; case 3: pfil_remove_hook(rm_hook, NULL, PFIL_ALL, &pb_hook); break; } mtx_lock(&pb_mtx); die =3D 1; init =3D 0; mtx_unlock(&pb_mtx); wakeup(&start); } if (init =3D=3D 0) { mtx_lock(&pb_mtx); init =3D 1; mtx_unlock(&pb_mtx); for (i =3D 0; i < threads; i++) { kproc_create(testloop, &start, NULL, 0, 0, "pb_loop_%d", i); } switch (mode) { case 0: pfil_add_hook(null_hook, NULL, PFIL_ALL|PFIL_WAITOK, &pb_hook); break; case 1: pfil_add_hook(mtx_hook, NULL, PFIL_ALL|PFIL_WAITOK, &pb_hook); break; case 2: pfil_add_hook(rw_hook, NULL, PFIL_ALL|PFIL_WAITOK, &pb_hook); break; case 3: pfil_add_hook(rm_hook, NULL, PFIL_ALL|PFIL_WAITOK, &pb_hook); break; } done =3D 0; } return (error); } SYSCTL_PROC(_debug_pfilbench, OID_AUTO, init, CTLTYPE_INT|CTLFLAG_RW, &init, 0, &sysctl_pb_init, "I", "Init the benchmark"); static int sysctl_pb_start(SYSCTL_HANDLER_ARGS) { int _start =3D start; int error; error =3D sysctl_handle_int(oidp, &_start, 0, req); _start =3D _start ? 1 : 0; if (init =3D=3D 0) return (EINVAL); if (_start) { start =3D 1; wakeup(&start); } else { start =3D 0; } return (error); } SYSCTL_PROC(_debug_pfilbench, OID_AUTO, start, CTLTYPE_INT|CTLFLAG_RW, &start, 0, &sysctl_pb_start, "I", "Start the benchmark"); static int load (module_t mod, int cmd, void *arg) { int error; error =3D 0; switch (cmd) { case MOD_LOAD: pb_hook.ph_type =3D PFIL_TYPE_IFNET; pb_hook.ph_ifnet =3D &pb_dummy; pfil_head_register(&pb_hook); break; case MOD_UNLOAD: die =3D 1; wakeup(&start); pause("stoping", hz); pfil_head_unregister(&pb_hook); break; default : error =3D EOPNOTSUPP; break; } return error; } static moduledata_t mod_data=3D { "pfilbench", load, 0 }; DECLARE_MODULE(pfilbench, mod_data, SI_SUB_EXEC, SI_ORDER_ANY); --Boundary-01=_BhHSHgZik2wVaF1-- --nextPart1594088.YNyaglIa3o Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBHSHhBXyyEoT62BG0RAi5BAJ9/nTNeOVuihizACal3Fk8oJ1ZQlwCfbmlN o1R6WWpEw4UNQwszM9qrLNI= =GM6C -----END PGP SIGNATURE----- --nextPart1594088.YNyaglIa3o-- From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 19:19:26 2007 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 860DA16A41A; Sat, 24 Nov 2007 19:19:26 +0000 (UTC) (envelope-from kris@FreeBSD.org) Received: from weak.local (pointyhat.freebsd.org [IPv6:2001:4f8:fff6::2b]) by mx1.freebsd.org (Postfix) with ESMTP id 7F90A13C4E1; Sat, 24 Nov 2007 19:19:25 +0000 (UTC) (envelope-from kris@FreeBSD.org) Message-ID: <47487946.2010202@FreeBSD.org> Date: Sat, 24 Nov 2007 20:19:34 +0100 From: Kris Kennaway User-Agent: Thunderbird 2.0.0.9 (Macintosh/20071031) MIME-Version: 1.0 To: Max Laier References: <200711231232.04447.max@love2party.net> <20071123132453.W98338@fledge.watson.org> <200711242006.04753.max@love2party.net> In-Reply-To: <200711242006.04753.max@love2party.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org, Robert Watson Subject: Re: Switch pfil(9) to rmlocks 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, 24 Nov 2007 19:19:26 -0000 Max Laier wrote: > On Friday 23 November 2007, Robert Watson wrote: >> On Fri, 23 Nov 2007, Max Laier wrote: >>> attached is a diff to switch the pfil(9) subsystem to rmlocks, which >>> are more suited for the task. I'd like some exposure before doing >>> the switch, but I don't expect any fallout. This email is going >>> through the patched pfil already - twice. >> Max, >> >> Have you done performance measurements that show rmlocks to be a win in >> this scenario? I did some patchs for UNIX domain sockets to replace >> the rwlock there but it appeared not to have a measurable impact on SQL >> benchmarks, presumbaly because the read/write blend wasn't right and/or >> that wasnt a significant source of overhead in the benchmark. I'd >> anticipate a much more measurable improvement for pfil, but would be >> interested in learning how much is seen? > > I had to roll an artificial benchmark in order to see a significant change > (attached - it's a hack!). > > Using 3 threads on a 4 CPU machine I get the following results: > null hook: ~13% +/- 2 > mtx hook: up to 40% [*] > rw hook: ~5% +/- 1 > rm hook: ~35% +/- 5 > > [*] The mtx hook is inconclusive as my measurements vary a lot. If one > thread gets lucky and keeps running the overall time obviously goes down > by a magnitude. It seems however, that rmlocks greatly increase the > chance of that happening - not sure if that's a good thing, though. If > all threads receive approximately equal runtime (which is almost always > the case for rwlocks) the difference is somewhere around 10%. Is that something we can try to arrange to happen for improved performance in more general situations? Kris From owner-freebsd-net@FreeBSD.ORG Sat Nov 24 19:48:35 2007 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 425C916A41A; Sat, 24 Nov 2007 19:48:35 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id BFDF513C45B; Sat, 24 Nov 2007 19:48:34 +0000 (UTC) (envelope-from max@love2party.net) Received: from amd64.laiers.local (dslb-088-066-008-048.pools.arcor-ip.net [88.66.8.48]) by mrelayeu.kundenserver.de (node=mrelayeu5) with ESMTP (Nemesis) id 0ML25U-1Iw0zM48hV-0000wh; Sat, 24 Nov 2007 20:48:29 +0100 From: Max Laier Organization: FreeBSD To: Kris Kennaway Date: Sat, 24 Nov 2007 20:49:13 +0100 User-Agent: KMail/1.9.7 References: <200711231232.04447.max@love2party.net> <200711242006.04753.max@love2party.net> <47487946.2010202@FreeBSD.org> In-Reply-To: <47487946.2010202@FreeBSD.org> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2081520.LFnXRmukbg"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200711242049.19466.max@love2party.net> X-Provags-ID: V01U2FsdGVkX18wO8VxTpO522mMEmtJdLgjl6ogLdxgc/88/6D T0am9H57nr8jAN+iQ/41d7LW2NKn/YtY72QghKIuCs6hr5kSun gxwHdx6zBkcZ8yuiAKhlo8A2qrWHesQSzuDf/8Bwus= Cc: freebsd-net@freebsd.org, freebsd-current@freebsd.org, Robert Watson Subject: Re: Switch pfil(9) to rmlocks 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, 24 Nov 2007 19:48:35 -0000 --nextPart2081520.LFnXRmukbg Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Saturday 24 November 2007, Kris Kennaway wrote: > Max Laier wrote: > > On Friday 23 November 2007, Robert Watson wrote: > >> On Fri, 23 Nov 2007, Max Laier wrote: > >>> attached is a diff to switch the pfil(9) subsystem to rmlocks, > >>> which are more suited for the task. I'd like some exposure before > >>> doing the switch, but I don't expect any fallout. This email is > >>> going through the patched pfil already - twice. > >> > >> Max, > >> > >> Have you done performance measurements that show rmlocks to be a win > >> in this scenario? I did some patchs for UNIX domain sockets to > >> replace the rwlock there but it appeared not to have a measurable > >> impact on SQL benchmarks, presumbaly because the read/write blend > >> wasn't right and/or that wasnt a significant source of overhead in > >> the benchmark. I'd anticipate a much more measurable improvement > >> for pfil, but would be interested in learning how much is seen? > > > > I had to roll an artificial benchmark in order to see a significant > > change (attached - it's a hack!). > > > > Using 3 threads on a 4 CPU machine I get the following results: > > null hook: ~13% +/- 2 > > mtx hook: up to 40% [*] > > rw hook: ~5% +/- 1 > > rm hook: ~35% +/- 5 > > > > [*] The mtx hook is inconclusive as my measurements vary a lot. If > > one thread gets lucky and keeps running the overall time obviously > > goes down by a magnitude. It seems however, that rmlocks greatly > > increase the chance of that happening - not sure if that's a good > > thing, though. If all threads receive approximately equal runtime > > (which is almost always the case for rwlocks) the difference is > > somewhere around 10%. > > Is that something we can try to arrange to happen for improved > performance in more general situations? I don't think so. It's a scheduling problem, but one you can't (easily)=20 predict. The gain comes from reduced congestion after one thread is=20 done, which doesn't happen in real world situations. You are never done. = =20 The only way to reduce congestion is to shrink critical sections and to=20 use read locks whenever possible. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart2081520.LFnXRmukbg Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBHSIA/XyyEoT62BG0RAuhJAJwJEUJuDUDj9FZqYj5KQZabFl2u3ACeIsCr mQX5c/SlFbfwPTleO7iebY0= =BDPT -----END PGP SIGNATURE----- --nextPart2081520.LFnXRmukbg--