From 20080111.freebsd.org@ab.ote.we.lv  Thu Jun 26 20:26:25 2008
Return-Path: <20080111.freebsd.org@ab.ote.we.lv>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 06BE21065676
	for <freebsd-gnats-submit@freebsd.org>; Thu, 26 Jun 2008 20:26:25 +0000 (UTC)
	(envelope-from 20080111.freebsd.org@ab.ote.we.lv)
Received: from purple.the-7.net (purple.the-7.net [IPv6:2001:470:1f01:622:230:48ff:fe23:4c67])
	by mx1.freebsd.org (Postfix) with ESMTP id D3D018FC1E
	for <freebsd-gnats-submit@freebsd.org>; Thu, 26 Jun 2008 20:26:24 +0000 (UTC)
	(envelope-from 20080111.freebsd.org@ab.ote.we.lv)
Received: from sushi.local (c-76-21-113-189.hsd1.ca.comcast.net [76.21.113.189])
	by purple.the-7.net (8.14.2/8.14.2) with ESMTP id m5QKQ7Hd078047
	for <freebsd-gnats-submit@freebsd.org>; Thu, 26 Jun 2008 13:26:07 -0700 (PDT)
	(envelope-from 20080111.freebsd.org@ab.ote.we.lv)
Message-Id: <4863FB65.2060902@ab.ote.we.lv>
Date: Thu, 26 Jun 2008 13:26:13 -0700
From: "Eugene M. Kim" <20080111.freebsd.org@ab.ote.we.lv>
To: freebsd-gnats-submit@freebsd.org
Subject: vr(4) does not see incoming multicast packets in non-promiscuous mode (broadcast is fine); breaks IPv6

>Number:         125024
>Category:       kern
>Synopsis:       [vr] does not see incoming multicast packets in non-promiscuous mode (broadcast is fine); breaks IPv6
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    yongari
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jun 26 20:30:05 UTC 2008
>Closed-Date:    Wed Jul 23 08:48:27 UTC 2008
>Last-Modified:  Wed Jul 23 08:48:27 UTC 2008
>Originator:     Eugene M. Kim
>Release:        FreeBSD 7.0-STABLE i386
>Organization:
>Environment:
System: FreeBSD net5501 7.0-STABLE FreeBSD 7.0-STABLE #0: Thu Jun 26 
01:17:36 PDT 2008 
ab@redion.astralblue.net:/home/FreeBSD/build/RELENG_7/obj/i386/home/FreeBSD/build/RELENG_7/src/sys/GENERIC 
i386

Hardware: Soekris Engineering net5501

--- BEGIN /var/run/dmesg.boot ---
Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
    The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.0-STABLE #0: Thu Jun 26 01:17:36 PDT 2008
    
ab@redion.astralblue.net:/home/FreeBSD/build/RELENG_7/obj/i386/home/FreeBSD/build/RELENG_7/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: Geode(TM) Integrated Processor by AMD PCS (499.90-MHz 586-class CPU)
  Origin = "AuthenticAMD"  Id = 0x5a2  Stepping = 2
  Features=0x88a93d<FPU,DE,PSE,TSC,MSR,CX8,SEP,PGE,CMOV,CLFLUSH,MMX>
  AMD Features=0xc0400000<MMX+,3DNow!+,3DNow!>
real memory  = 536870912 (512 MB)
avail memory = 511565824 (487 MB)
kbd1 at kbdmux0
K6-family MTRR support enabled (2 registers)
ath_hal: 0.9.20.3 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
cpu0 on motherboard
pcib0: <Host to PCI bridge> pcibus 0 on motherboard
pci0: <PCI bus> on pcib0
pci0: <encrypt/decrypt, entertainment crypto> at device 1.2 (no driver 
attached)
vr0: <VIA VT6105M Rhine III 10/100BaseTX> port 0xe100-0xe1ff mem 
0xa0004000-0xa00040ff irq 11 at device 6.0 on pci0
vr0: Quirks: 0x6
vr0: Revision: 0x96
miibus0: <MII bus> on vr0
ukphy0: <Generic IEEE 802.3u media interface> PHY 1 on miibus0
ukphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
vr0: Ethernet address: 00:00:24:ca:92:68
vr0: [ITHREAD]
vr1: <VIA VT6105M Rhine III 10/100BaseTX> port 0xe200-0xe2ff mem 
0xa0004100-0xa00041ff irq 5 at device 7.0 on pci0
vr1: Quirks: 0x6
vr1: Revision: 0x96
miibus1: <MII bus> on vr1
ukphy1: <Generic IEEE 802.3u media interface> PHY 1 on miibus1
ukphy1:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
vr1: Ethernet address: 00:00:24:ca:92:69
vr1: [ITHREAD]
vr2: <VIA VT6105M Rhine III 10/100BaseTX> port 0xe300-0xe3ff mem 
0xa0004200-0xa00042ff irq 9 at device 8.0 on pci0
vr2: Quirks: 0x6
vr2: Revision: 0x96
miibus2: <MII bus> on vr2
ukphy2: <Generic IEEE 802.3u media interface> PHY 1 on miibus2
ukphy2:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
vr2: Ethernet address: 00:00:24:ca:92:6a
vr2: [ITHREAD]
vr3: <VIA VT6105M Rhine III 10/100BaseTX> port 0xe400-0xe4ff mem 
0xa0004300-0xa00043ff irq 12 at device 9.0 on pci0
vr3: Quirks: 0x6
vr3: Revision: 0x96
miibus3: <MII bus> on vr3
ukphy3: <Generic IEEE 802.3u media interface> PHY 1 on miibus3
ukphy3:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
vr3: Ethernet address: 00:00:24:ca:92:6b
vr3: [ITHREAD]
pci0: <network> at device 14.0 (no driver attached)
pci0: <processor> at device 17.0 (no driver attached)
isab0: <PCI-ISA bridge> at device 20.0 on pci0
isa0: <ISA bus> on isab0
atapci0: <AMD CS5536 UDMA100 controller> port 
0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xe000-0xe00f at device 20.2 on pci0
ata0: <ATA channel 0> on atapci0
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci0
ata1: [ITHREAD]
ohci0: <OHCI (generic) USB controller> mem 0xa0018000-0xa0018fff irq 7 
at device 21.0 on pci0
ohci0: [GIANT-LOCKED]
ohci0: [ITHREAD]
usb0: OHCI version 1.0, legacy support
usb0: <OHCI (generic) USB controller> on ohci0
usb0: USB revision 1.0
uhub0: <AMD OHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb0
uhub0: 4 ports with 4 removable, self powered
ehci0: <EHCI (generic) USB 2.0 controller> mem 0xa0019000-0xa0019fff irq 
7 at device 21.1 on pci0
ehci0: [GIANT-LOCKED]
ehci0: [ITHREAD]
usb1: EHCI version 1.0
usb1: companion controller, 4 ports each: usb0
usb1: <EHCI (generic) USB 2.0 controller> on ehci0
usb1: USB revision 2.0
uhub1: <AMD EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> on usb1
uhub1: 4 ports with 4 removable, self powered
pmtimer0 on isa0
orm0: <ISA Option ROM> at iomem 0xc8000-0xd27ff pnpid ORM0000 on isa0
atkbdc0: <Keyboard controller (i8042)> at port 0x60,0x64 on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
ppc0: parallel port not found.
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A, console
sio0: [FILTER]
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
sio1: [FILTER]
Timecounter "TSC" frequency 499904083 Hz quality 800
Timecounters tick every 1.000 msec
Trying to mount root from nfs:10.0.0.16:/home/nfsroot
NFS ROOT: 10.0.0.16:/home/nfsroot
--- END /var/run/dmesg.boot ---

>Description:
vr(4) does not see incoming Ethernet multicast (non-broadcast) packets,
except when the interface is put into promiscuous mode, e.g. by running
tcpdump without the -p option.

This breaks IPv6, whose router solicitation and neighbor discovery rely
upon multicast.

>How-To-Repeat:

1. Hook vr0 onto an IPv6 network with a router that responds to ICMPv6
   router solicitation (most IPv6 routers do).

2. Tell the IPv6 stack to accept incoming router advertisements:

    sysctl net.inet6.ip6.accept_rtadv=1

3. Run tcpdump in non-promiscuous mode in one terminal:

        tcpdump -ivr0 -nvvvv -es0 -p 'multicast and not broadcast'

4. Run rtsol in another terminal:

        time rtsol vr0

5. The tcpdump shows only outgoing router solicitations, but not
   incoming router advertisements (sent by the router to Ethernet
   multicast address 33:33:00:00:00:01, for IPv6 link-local multicast
   address ff02::1).  rtsol times out in about 10 seconds.

6. Interrupt the tcpdump, and run another in promiscuous mode:

        tcpdump -ivr0 -nvvvv -es0 'multicast and not broadcast'

7. Run rtsol again:

        time rtsol vr0

8. This time, tcpdump shows both outgoing router solicitations and
   incoming router advertisements.  rtsol completes successfully,
   typically in 1 to 3 seconds.

>Fix:
No fix is known; it seems that the only workaround is to keep the
interface in promiscuous mode, e.g. by running a background tcpdump.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: gnats-admin->freebsd-net 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Thu Jun 26 20:36:10 UTC 2008 
Responsible-Changed-Why:  
Over to maintainers 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125024 
State-Changed-From-To: open->feedback 
State-Changed-By: yongari 
State-Changed-When: Fri Jun 27 03:43:26 UTC 2008 
State-Changed-Why:  
Would you try patch at the following URL? 
http://people.freebsd.org/~yongari/vr/vr.cam.patch 


Responsible-Changed-From-To: freebsd-net->yongari 
Responsible-Changed-By: yongari 
Responsible-Changed-When: Fri Jun 27 03:43:26 UTC 2008 
Responsible-Changed-Why:  
Grab. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125024 
Responsible-Changed-From-To: yongari->yongari 
Responsible-Changed-By: gavin 
Responsible-Changed-When: Sun Jun 29 22:03:30 UTC 2008 
Responsible-Changed-Why:  


http://www.freebsd.org/cgi/query-pr.cgi?pr=125024 
State-Changed-From-To: feedback->open 
State-Changed-By: yongari 
State-Changed-When: Tue Jul 1 10:02:58 UTC 2008 
State-Changed-Why:  
feedback received. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/125024: commit references a PR
Date: Wed, 16 Jul 2008 08:35:47 +0000 (UTC)

 yongari     2008-07-16 08:35:29 UTC
 
   FreeBSD src repository
 
   Modified files:
     sys/dev/vr           if_vr.c if_vrreg.h 
   Log:
   SVN rev 180552 on 2008-07-16 08:35:29Z by yongari
   
   Fix a multicast handling regression on VT6105M introduced in
   vr(4) overhauling(r177050).
   
   It seems that filtering multicast addresses with multicast CAM
   entries require accessing 'CAM enable bit' for each CAM entry.
   Subsequent accessing multicast CAM control register without
   toggling the 'CAM enable bit' seem to no effects.
   In order to fix that separate CAM setup from CAM mask configuration
   and CAM entry modification. While I'm here add VLAN CAM filtering
   feature which will be enabled in future(FreeBSD now can receive
   VLAN id insertion/removal event from vlan(4) on the fly).
   
   For VT6105M hardware, explicitly disable VLAN hardware tag
   insertion/stripping and enable VLAN CAM filtering for VLAN id 0.
   This shall make non-VLAN frames set VR_RXSTAT_VIDHIT bit in Rx
   status word.
   
   Added multicast/VLAN CAM address definition to header file.
   
   PR:     kern/125010, kern/125024
   MFC after:      1 week
   
   Revision  Changes    Path
   1.132     +48 -25    src/sys/dev/vr/if_vr.c
   1.38      +12 -0     src/sys/dev/vr/if_vrreg.h
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: yongari 
State-Changed-When: Wed Jul 16 09:07:39 UTC 2008 
State-Changed-Why:  
Patch committed to HEAD with change set r180552. 

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

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/125024: commit references a PR
Date: Wed, 23 Jul 2008 08:19:02 +0000 (UTC)

 yongari     2008-07-23 08:18:42 UTC
 
   FreeBSD src repository
 
   Modified files:        (Branch: RELENG_7)
     sys/dev/vr           if_vr.c if_vrreg.h 
   Log:
   SVN rev 180737 on 2008-07-23 08:18:42Z by yongari
   
   MFC r180552.
     Fix a multicast handling regression on VT6105M introduced in
     vr(4) overhauling(r177050).
   
     It seems that filtering multicast addresses with multicast CAM
     entries require accessing 'CAM enable bit' for each CAM entry.
     Subsequent accessing multicast CAM control register without
     toggling the 'CAM enable bit' seem to no effects.
     In order to fix that separate CAM setup from CAM mask configuration
     and CAM entry modification. While I'm here add VLAN CAM filtering
     feature which will be enabled in future(FreeBSD now can receive
     VLAN id insertion/removal event from vlan(4) on the fly).
   
     For VT6105M hardware, explicitly disable VLAN hardware tag
     insertion/stripping and enable VLAN CAM filtering for VLAN id 0.
     This shall make non-VLAN frames set VR_RXSTAT_VIDHIT bit in Rx
     status word.
   
     Added multicast/VLAN CAM address definition to header file.
   
     PR:   kern/125010, kern/125024
   
   Revision   Changes    Path
   1.130.2.3  +48 -25    src/sys/dev/vr/if_vr.c
   1.36.2.3   +12 -0     src/sys/dev/vr/if_vrreg.h
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: yongari 
State-Changed-When: Wed Jul 23 08:47:25 UTC 2008 
State-Changed-Why:  
MFC done(r180737). Thanks for reporting. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=125024 
>Unformatted:
