Bug 187179 - Wandboard ffec cannot receive IPv6 multicast
Summary: Wandboard ffec cannot receive IPv6 multicast
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: arm (show other bugs)
Version: CURRENT
Hardware: Any Any
: Normal Affects Only Me
Assignee: Hiroki Sato
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-01 18:00 UTC by tak.swd
Modified: 2014-07-26 04:34 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (664 bytes, patch)
2014-03-01 18:00 UTC, tak.swd
no flags Details | Diff
_if_ffec.c.patch.txt (614 bytes, text/plain; charset=US-ASCII)
2014-03-05 16:02 UTC, tak.swd
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description tak.swd 2014-03-01 18:00:00 UTC
Wandboard ffec cannot receive IPv6 multicast.

- ping6 (From Wandboard to Test Server)
ping6 ff02::1%ffec0
netstat -i
===> Cannot receive NS multicast. transmit OK.

ping6 server_linklocal_address%ffec0
netstat -i
===> Cannot receive NS multicast. transmit OK.



- ping6 (From Test Server to Wandboard)
tcpdump -i ffec0

ping6 Wandboard_ffec_linklocal_address%em0
===> Cannot receive ICMPv6 Echo Request Multicast.

Fix: I found ffec multicast filter problem.
Patch file attached.

Patch attached with submission follows:
Comment 1 Hiroki Sato freebsd_committer freebsd_triage 2014-03-02 05:49:06 UTC
Responsible Changed
From-To: freebsd-arm->hrs

Take.
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-03-04 06:56:01 UTC
Author: hrs
Date: Tue Mar  4 06:55:54 2014
New Revision: 262728
URL: http://svnweb.freebsd.org/changeset/base/262728

Log:
  Fix multicast filtering.
  
  Submitted by:	Takanori Sawada
  PR:		arm/187179

Modified:
  head/sys/dev/ffec/if_ffec.c

Modified: head/sys/dev/ffec/if_ffec.c
==============================================================================
--- head/sys/dev/ffec/if_ffec.c	Tue Mar  4 05:09:46 2014	(r262727)
+++ head/sys/dev/ffec/if_ffec.c	Tue Mar  4 06:55:54 2014	(r262728)
@@ -961,7 +961,7 @@ ffec_setup_rxfilter(struct ffec_softc *s
 				continue;
 			crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
 			    ifma->ifma_addr), ETHER_ADDR_LEN);
-			ghash |= 1 << (crc & 0x3f);
+			ghash |= 1LLU << (crc & 0x3f);
 		}
 		if_maddr_runlock(ifp);
 	}
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 3 Hiroki Sato freebsd_committer freebsd_triage 2014-03-04 07:12:56 UTC
State Changed
From-To: open->patched

Committed into head.
Comment 4 tak.swd 2014-03-05 16:02:36 UTC
I test IPv6 multicast carefully.
I noticed IPv6 all node multicast recieve fail.
(ping6 ff02::1%ffec0 a part of node success.)

So I read i.MX 6Solo/6DualLite Applications Processor Reference Manual.
(23.4.4.3.2 Multicast and unicast address resolution (P1104-1105) )

RM says
- CRC is 802.3 standard CRC(ether_crc32_le())
- six(6) most significant bits of the CRC use

Patch file attached.
Description's  test pattarn all success.
(I cleared Wandboard/Server ND cache beforehand.(ndp -c))
Comment 5 dfilter service freebsd_committer freebsd_triage 2014-03-08 14:58:50 UTC
Author: hrs
Date: Sat Mar  8 14:58:39 2014
New Revision: 262929
URL: http://svnweb.freebsd.org/changeset/base/262929

Log:
  Fix another bug in multicast filtering.  i.MX uses 6 bits from MSB in
  LE CRC32 for the hash value, not the lowest 6 bits in BE CRC32.
  
  Tested by:	Takanori Sawada
  PR:		arm/187179

Modified:
  head/sys/dev/ffec/if_ffec.c

Modified: head/sys/dev/ffec/if_ffec.c
==============================================================================
--- head/sys/dev/ffec/if_ffec.c	Sat Mar  8 12:26:17 2014	(r262928)
+++ head/sys/dev/ffec/if_ffec.c	Sat Mar  8 14:58:39 2014	(r262929)
@@ -959,9 +959,10 @@ ffec_setup_rxfilter(struct ffec_softc *s
 		TAILQ_FOREACH(ifma, &sc->ifp->if_multiaddrs, ifma_link) {
 			if (ifma->ifma_addr->sa_family != AF_LINK)
 				continue;
-			crc = ether_crc32_be(LLADDR((struct sockaddr_dl *)
+			/* 6 bits from MSB in LE CRC32 are used for hash. */
+			crc = ether_crc32_le(LLADDR((struct sockaddr_dl *)
 			    ifma->ifma_addr), ETHER_ADDR_LEN);
-			ghash |= 1LLU << (crc & 0x3f);
+			ghash |= 1LLU << (((uint8_t *)&crc)[3] >> 2);
 		}
 		if_maddr_runlock(ifp);
 	}
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
Comment 6 Ian Lepore freebsd_committer freebsd_triage 2014-07-26 04:34:38 UTC
mfc to 10 done as r266277