Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Jun 2016 18:48:08 +0300
From:      Guy Yur <guyyur@gmail.com>
To:        freebsd-arm <freebsd-arm@freebsd.org>, jmcneill@freebsd.org
Subject:   multicast filtering doesn't work for ODROID C1+ with if_dwc even after r301693
Message-ID:  <CAC67Hz8z65Ru5r7WS7gu5rDheRd1zyJ=Om_tQQvfLNmZNPT=Ng@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
--089e0118388a029a8605350295e1
Content-Type: text/plain; charset=UTF-8

Hi,

Multicast filtering doesn't work on my ODROID C1+.
IPv6 connections to the board fail unless the card is put
in promiscuous mode.

Posting again since I see some changes to if_dwc were done in r301693.
My previous post:
https://lists.freebsd.org/pipermail/freebsd-arm/2016-March/013528.html

The board uses if_dwc and I am using a newer build than r301693
which added hashing fixes for DWC_GMAC_ALT_DESC.
Filtering didn't work for me with builds before r301693 either.

I don't have the dwc manual so I looked at the NetBSD and Linux drivers.
NetBSD only supports the Allwinner configuration with 64 hash entries.
Linux uses snps,multicast-filter-bins dts property when the interface
has more than 64 entries, for example socfpga.dtsi (on FreeBSD it doesn't
have the property, probably older version of the file).

Both use the upper 6-bits and not the upper 8-bits when the hash table
has only 64 entries.
Linux uses the upper 8-bits when the hash table has 256 entries.

They also program registers 0x08 and 0x0c instead of
HASH_TABLE_REG(n) 0x500 + (0x4 * n) for 64 entries.
AWIN_GMAC_MAC_HTHIGH and AWIN_GMAC_MAC_HTLOW in NetBSD driver.

Attached crude patch that uses 6-lower bits (when reversed) instead
of 8-lower bits for DWC_GMAC_ALT_DESC and also uses registers 0x08
and 0x0c instead.

With the patch changes I can connect to the board using IPv6.

Thanks,
Guy

--089e0118388a029a8605350295e1
Content-Type: application/octet-stream; 
	name="if_dwc_64entry_multicast.patch"
Content-Disposition: attachment; filename="if_dwc_64entry_multicast.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_ipbbkpj70

SW5kZXg6IHN5cy9kZXYvZHdjL2lmX2R3Yy5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iAzMSk7CiAJCQloYXNoW2hh
c2hyZWddIHw9ICgxIDw8IGhhc2hiaXQpOwogCQl9CkBAIC02NDIsOCArNjQwLDEzIEBAIGR3Y19z
ZXR1cF9yeGZpbHRlcihzdHJ1Y3QgZHdjX3NvZnRjICpzYykKIAlXUklURTQoc2MsIE1BQ19BRERS
RVNTX0xPVygwKSwgbG8pOwogCVdSSVRFNChzYywgTUFDX0FERFJFU1NfSElHSCgwKSwgaGkpOwog
CVdSSVRFNChzYywgTUFDX0ZSQU1FX0ZJTFRFUiwgZmZ2YWwpOwotCWZvciAoaSA9IDA7IGkgPCBu
aGFzaDsgaSsrKQotCQlXUklURTQoc2MsIEhBU0hfVEFCTEVfUkVHKGkpLCBoYXNoW2ldKTsKKwlp
ZiAoc2MtPm1hY3R5cGUgPT0gRFdDX0dNQUNfQUxUX0RFU0MpIHsKKwkJV1JJVEU0KHNjLCBHTUFD
X01BQ19IVExPVywgaGFzaFswXSk7CisJCVdSSVRFNChzYywgR01BQ19NQUNfSFRISUdILCBoYXNo
WzFdKTsKKwl9IGVsc2UgeworCQlmb3IgKGkgPSAwOyBpIDwgbmhhc2g7IGkrKykKKwkJCVdSSVRF
NChzYywgSEFTSF9UQUJMRV9SRUcoaSksIGhhc2hbaV0pOworCX0KIH0KIAogc3RhdGljIGludAo=
--089e0118388a029a8605350295e1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAC67Hz8z65Ru5r7WS7gu5rDheRd1zyJ=Om_tQQvfLNmZNPT=Ng>