From owner-freebsd-current@FreeBSD.ORG Sat Oct 4 20:15:14 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2889F207 for ; Sat, 4 Oct 2014 20:15:14 +0000 (UTC) Received: from plane.gmane.org (plane.gmane.org [80.91.229.3]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D544BF3B for ; Sat, 4 Oct 2014 20:15:13 +0000 (UTC) Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XaVjM-0002kI-K3 for freebsd-current@freebsd.org; Sat, 04 Oct 2014 22:15:04 +0200 Received: from c-50-172-79-238.hsd1.il.comcast.net ([50.172.79.238]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Oct 2014 22:15:04 +0200 Received: from ctyz1999 by c-50-172-79-238.hsd1.il.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 04 Oct 2014 22:15:04 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-current@freebsd.org From: Craig Wiesen Subject: Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support Date: Sat, 4 Oct 2014 20:10:06 +0000 (UTC) Lines: 192 Message-ID: References: <20140930015741.GA2451@michelle.fasterthan.com> <20141001013637.GD2632@michelle.fasterthan.com> <20141002050730.GA964@michelle.fasterthan.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 50.172.79.238 (Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.120 Safari/537.36) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2014 20:15:14 -0000 Yonghyeon PYUN gmail.com> writes: > > On Wed, Oct 01, 2014 at 10:36:37AM +0900, Yonghyeon PYUN wrote: > > On Tue, Sep 30, 2014 at 10:57:41AM +0900, Yonghyeon PYUN wrote: > > > Hi, > > > I've added support for QAC AR816x/AR817x ethernet controllers. It > > > passed my limited testing and I need more testers. You can find > > > patches from the following URLs. > > > > > > http://people.freebsd.org/~yongari/alc/pci.quirk.diff > > > and > > > http://people.freebsd.org/~yongari/alc/alc.diff.20140930 > > > > > > pci.qurik.diff is to workaround silicon bug of AR816x. Without it > > > MSI/MSIX interrupt wouldn't work. If you just want to use > > > legacy INTx interrupt you don't have to apply it but you have to > > > tell alc(4) not to use MSI/MSIX interrupt with tunables( > > > hw.alc.msi.disable and hw.alc.msix_disable). > > > > > > alc.diff.20140930 will add support for AR8161/AR8162/AR8171/AR8172 > > > and E2200 controllers. It supports all hardware features except > > > RSS. If you have any QAC AR816x/AR817x or old AR813x/AR815x > > > controllers please test and report how the diff works for you. > > > Thanks. > > > > http://people.freebsd.org/~yongari/alc/pci.quirk.diff > > http://people.freebsd.org/~yongari/alc/alc.diff.20141001 > > > > Patch updated to address link establishment issue. > > http://people.freebsd.org/~yongari/alc/alc.diff.20141002 > Patch updated again to correct wrong lock assertion. > _______________________________________________ Hi- I can add that I tested your patches on a 9.3 Stable machine. The motherboard is a GA-Z77-D3H (rev. 1.1) with onboard Atheros AR816x. I did have to apply one of the patch hunks by hand, see below. I am able to ssh into the machine, and remotely access apache/poudriere. I have not seen any problems so far. I've included a few outputs for you to examine. # uname -a FreeBSD desktop.home.org 9.3-STABLE FreeBSD 9.3-STABLE #0 r272523M: Sat Oct 4 11:50:08 CDT 2014 root@desktop.home.org:/usr/obj/usr/src/sys/SANDYBRIDGE amd64 # ifconfig -a em0: flags=8843 metric 0 mtu 1500 options=4219b ether 68:05:ca:xx:xx:xx inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 nd6 options=29 media: Ethernet autoselect status: no carrier alc0: flags=8843 metric 0 mtu 1500 options=c319a ether 90:2b:34:xx:xx:xx inet 192.168.100.48 netmask 0xffffff00 broadcast 192.168.100.255 inet6 -redacted-%alc0 prefixlen 64 scopeid 0x4 nd6 options=29 media: Ethernet autoselect (1000baseT ) status: active I left em0 above for comparison: Rejected hunk: # cat if_alc.c.rej *************** *** 831,843 **** CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val); } /* Disable ASPM L0S and L1. */ - cap = CSR_READ_2(sc, base + PCIER_LINK_CAP); if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { - ctl = CSR_READ_2(sc, base + PCIER_LINK_CTL); if ((ctl & PCIEM_LINK_CTL_RCB) != 0) sc->alc_rcb = DMA_CFG_RCB_128; if (bootverbose) - device_printf(dev, "RCB %u bytes\n", sc->alc_rcb == DMA_CFG_RCB_64 ? 64 : 128); state = ctl & PCIEM_LINK_CTL_ASPMC; if (state & PCIEM_LINK_CTL_ASPMC_L0S) --- 1279,1291 ---- CSR_WRITE_4(sc, ALC_PCIE_PHYMISC2, val); } /* Disable ASPM L0S and L1. */ + cap = CSR_READ_2(sc, sc->alc_expcap + PCIER_LINK_CAP); if ((cap & PCIEM_LINK_CAP_ASPM) != 0) { + ctl = CSR_READ_2(sc, sc->alc_expcap + PCIER_LINK_CTL); if ((ctl & PCIEM_LINK_CTL_RCB) != 0) sc->alc_rcb = DMA_CFG_RCB_128; if (bootverbose) + device_printf(sc->alc_dev, "RCB %u bytes\n", sc->alc_rcb == DMA_CFG_RCB_64 ? 64 : 128); state = ctl & PCIEM_LINK_CTL_ASPMC; if (state & PCIEM_LINK_CTL_ASPMC_L0S) >From verbose boot log: pcib5: irq 18 at device 28.6 on pci0 pcib0: allocated type 4 (0xd000-0xdfff) for rid 1c of pcib5 pcib0: allocated type 3 (0xf7900000-0xf79fffff) for rid 20 of pcib5 pcib5: domain 0 pcib5: secondary bus 5 pcib5: subordinate bus 5 pcib5: I/O decode 0xd000-0xdfff pcib5: memory decode 0xf7900000-0xf79fffff pci5: on pcib5 pci5: domain=0, physical bus=5 found-> vendor=0x1969, dev=0x1091, revid=0x10 domain=0, bus=5, slot=0, func=0 class=02-00-00, hdrtype=0x00, mfdev=0 cmdreg=0x0007, statreg=0x0010, cachelnsz=16 (dwords) lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) intpin=a, irq=11 powerspec 3 supports D0 D3 current D0 MSI supports 16 messages, 64 bit, vector masks MSI-X supports 16 messages in map 0x10 map[10]: type Memory, range 64, base 0xf7900000, size 18, enabled pcib5: allocated memory range (0xf7900000-0xf793ffff) for rid 10 of pci0:5:0:0 map[18]: type I/O Port, range 32, base 0xd000, size 7, enabled pcib5: allocated I/O port range (0xd000-0xd07f) for rid 18 of pci0:5:0:0 pcib5: matched entry for 5.0.INTA pcib5: slot 0 INTA hardwired to IRQ 18 alc0: port 0xd000-0xd07f mem 0xf7900000-0xf793ffff irq 18 at device 0.0 on pci5 alc0: PCI device revision : 0x0010 alc0: Chip id/revision : 0xc002 alc0: AR816x revision : 0x2 alc0: 11776 Tx FIFO, 12032 Rx FIFO alc0: Read request size : 512 bytes. alc0: TLP payload size : 128 bytes. alc0: MSIX count : 16 alc0: MSI count : 16 alc0: attempting to allocate 1 MSI-X vectors (16 supported) msi: routing MSI-X IRQ 269 to local APIC 0 vector 66 alc0: using IRQ 269 for MSI-X alc0: Using 1 MSIX message(s). miibus0: on alc0 atphy0: PHY 0 on miibus0 atphy0: OUI 0x00c82e, model 0x0007, rev. 9 atphy0: none, 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT- FDX, 1000baseT-FDX-master, auto, auto- flow alc0: bpf attached alc0: Ethernet address: 90:2b:34:xx:xx:xx Excerpt from: # pciconf -lv pcib5@pci0:0:28:6: class=0x060400 card=0x50011458 chip=0x1e1c8086 rev=0xc4 hdr=0x01 vendor = 'Intel Corporation' device = 'Panther Point PCI Express Root Port 7' class = bridge subclass = PCI-PCI alc0@pci0:5:0:0: class=0x020000 card=0xe0001458 chip=0x10911969 rev=0x10 hdr=0x00 vendor = 'Atheros Communications' class = network subclass = ethernet Thanks for your efforts! Craig