From owner-freebsd-current@FreeBSD.ORG Fri Oct 3 19:29:53 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 100D4B89 for ; Fri, 3 Oct 2014 19:29:53 +0000 (UTC) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com [IPv6:2a00:1450:4010:c03::22e]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C35DB2C for ; Fri, 3 Oct 2014 19:29:52 +0000 (UTC) Received: by mail-la0-f46.google.com with SMTP id gi9so1651694lab.33 for ; Fri, 03 Oct 2014 12:29:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=A75AuIS7E8JiAuThIfD3o7SK2UX6tXYr/2vSMR58SeU=; b=xQ/67EMnDGiWZzk31I66B7ESk8gyPHKxhE8LDBysT7tJh0xJjwyBwy2N1o/lln4GES u+Adwj+h0PdwAhbQlWqVkXHraJRlkuT/xO/EWP9amGHTKbdGUlFH5SCVdDuoOHua4148 Yz3tK4KjS/TW6OqFgsxwnhV8vfIUSNcRfkMy4+jwK+AORRjMmSFJPmccG43U9mYvrT6G MXOGd+P5BltJmjJ2xADliKMBHkWXQsmEAbSAHWXxqqo+8FbmQLRxXdqxYsK42r9vqdkL 2X5cKQBHd8LHpauvOoNJbwmJhEe58gxwayIG6CcG5SaDRc1QPwWo5eV0F3YTJCC28fse 9KRQ== X-Received: by 10.152.197.35 with SMTP id ir3mr8321751lac.82.1412364590494; Fri, 03 Oct 2014 12:29:50 -0700 (PDT) Received: from dw.org.pl (aekq203.neoplus.adsl.tpnet.pl. [79.191.16.203]) by mx.google.com with ESMTPSA id rl6sm2987033lac.17.2014.10.03.12.29.49 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Oct 2014 12:29:49 -0700 (PDT) From: Dariusz Wierzbicki X-Google-Original-From: Dariusz Wierzbicki Date: Fri, 3 Oct 2014 21:29:46 +0200 To: Yonghyeon PYUN Subject: Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support Message-ID: <20141003212946.1499d68f@dw.org.pl> In-Reply-To: <20141002050730.GA964@michelle.fasterthan.com> References: <20140930015741.GA2451@michelle.fasterthan.com> <20141001013637.GD2632@michelle.fasterthan.com> <20141002050730.GA964@michelle.fasterthan.com> X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.22; amd64-portbld-freebsd10.1) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org 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: Fri, 03 Oct 2014 19:29:53 -0000 Dnia 2014-10-02, o godz. 14:07:30 Yonghyeon PYUN napisa=C5=82(a): > 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. > > >=20 > > > http://people.freebsd.org/~yongari/alc/pci.quirk.diff > > > and > > > http://people.freebsd.org/~yongari/alc/alc.diff.20140930 > > >=20 > > > 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). > > >=20 > > > 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. > >=20 > > http://people.freebsd.org/~yongari/alc/pci.quirk.diff > > http://people.freebsd.org/~yongari/alc/alc.diff.20141001 > >=20 > > Patch updated to address link establishment issue. >=20 > http://people.freebsd.org/~yongari/alc/alc.diff.20141002 > Patch updated again to correct wrong lock assertion. Hi ! Thanks for your work ! Are your patches only for current ? I tried on 10 stable. My system: dw@dw:~ % uname -a FreeBSD dw 10.1-RC1 FreeBSD 10.1-RC1 #1 r272477M: Fri Oct 3 20:48:05 CEST 2014 dw@dw:/usr/obj/usr/src/sys/DW amd64 I applied your patches (pci.quirk.diff & alc.diff.20141002). There was a minor problem with alc.diff.20141002 - hunk 1 failed: @@ -111,17 +111,31 @@ "Atheros AR8152 v1.1 PCIe Fast Ethernet" }, { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8152_B2, 6 * 1024, "Atheros AR8152 v2.0 PCIe Fast Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8161, 9 * 1024, + "Atheros AR8161 PCIe Gigabit Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8162, 9 * 1024, + "Atheros AR8161 PCIe Fast Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8171, 9 * 1024, + "Atheros AR8161 PCIe Gigabit Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_AR8172, 9 * 1024, + "Atheros AR8161 PCIe Fast Ethernet" }, + { VENDORID_ATHEROS, DEVICEID_ATHEROS_E2200, 9 * 1024, + "Atheros AR8161 PCIe Killer E2200 Gigabit Ethernet" }, { 0, 0, 0, NULL} }; =20 -static void alc_aspm(struct alc_softc *, int); +static void alc_aspm(struct alc_softc *, int, int); +static void alc_aspm_813x(struct alc_softc *, int); +static void alc_aspm_816x(struct alc_softc *, int); static int alc_attach(device_t); static int alc_check_boundary(struct alc_softc *); +static void alc_config_msi(struct alc_softc *); static int alc_detach(device_t); static void alc_disable_l0s_l1(struct alc_softc *); static int alc_dma_alloc(struct alc_softc *); static void alc_dma_free(struct alc_softc *); static void alc_dmamap_cb(void *, bus_dma_segment_t *, int, int); +static void alc_dsp_fixup(struct alc_softc *, int); static int alc_encap(struct alc_softc *, struct mbuf **); static struct alc_ident * alc_find_ident(device_t); I applied that part manually. Compiled and rebooted system. dmesg | grep alc : alc0: could not disable Rx/Tx MAC(0x4000cb20)! alc0: reset timeout(0x4000cb20)! alc0: could not disable Rx/Tx MAC(0x4000cb20)! alc0: link state changed to UP alc0: could not disable Rx/Tx MAC(0x4000cb20)! alc0: port 0xd000-0xd07f mem 0xf7200000-0xf723ffff irq 18 at device 0.0 on pci3 alc0: reset timeout(0x4000cd00)! alc0: 11776 Tx FIFO, 12032 Rx FIFO miibus0: on alc0 alc0: Ethernet address: 74:d4:35:91:32:04 alc0: could not disable Rx/Tx MAC(0x4000cd00)! alc0: reset timeout(0x4000cd00)! alc0: port 0xd000-0xd07f mem 0xf7200000-0xf723ffff irq 18 at device 0.0 on pci3 alc0: reset timeout(0x4000ca00)! alc0: 11776 Tx FIFO, 12032 Rx FIFO miibus0: on alc0 alc0: Ethernet address: 74:d4:35:91:32:04 alc0: port 0xd000-0xd07f mem 0xf7200000-0xf723ffff irq 18 at device 0.0 on pci3 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) alc0: using IRQ 268 for MSI-X alc0: Using 1 MSIX message(s). miibus0: on alc0 alc0: bpf attached alc0: Ethernet address: 74:d4:35:91:32:04 alc0: link state changed to UP pciconf -vlc : alc0@pci0:3:0:0: class=3D0x020000 card=3D0xe0001458 chip=3D0x10911969 rev=3D0x10 hdr=3D0x00 vendor =3D 'Atheros Communications Inc.' device =3D 'AR8161 Gigabit Ethernet' class =3D network subclass =3D ethernet cap 01[40] =3D powerspec 3 supports D0 D3 current D0 cap 10[58] =3D PCI-Express 1 endpoint max data 128(4096) link x1(x1) speed 2.5(2.5) ASPM disabled(L0s/L1) cap 05[c0] =3D MSI supports 16 messages, 64 bit, vector masks=20 cap 11[d8] =3D MSI-X supports 16 messages, enabled Table in map 0x10[0x2000], PBA in map 0x10[0x3000] ecap 0001[100] =3D AER 1 0 fatal 0 non-fatal 0 corrected ecap 0003[180] =3D Serial 1 ff91320474d435ff ifconfig : alc0: flags=3D8843 metric 0 mtu 1500 options=3Dc319a ether 74:d4:35:91:32:04 inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255 media: Ethernet autoselect (100baseTX ) status: active If you need other data or more testing, let me know. Kind regards, Darek