From owner-freebsd-current@FreeBSD.ORG Mon Oct 6 16:21:50 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 D5407FA9 for ; Mon, 6 Oct 2014 16:21:50 +0000 (UTC) Received: from mail-lb0-x234.google.com (mail-lb0-x234.google.com [IPv6:2a00:1450:4010:c04::234]) (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 4BF7C370 for ; Mon, 6 Oct 2014 16:21:50 +0000 (UTC) Received: by mail-lb0-f180.google.com with SMTP id f15so4612407lbj.11 for ; Mon, 06 Oct 2014 09:21:48 -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=IGRwvzw3CtMvVMevo9fb0IbfWUjm5y3QjopgLOFVKCA=; b=DupZ3AxVl1aqHGe3rE36A7zZ1YPZ2PwIFciBq1dIst40TgVCisF6jO4W39Af8YdB7C RegvzdNHNtFy+WTcGtnyy5i04nN73rKKD7I+WNaBVCpdGBOGdcFjRWNYiuRgOeK5535J 6u+wGun6ga4ZV7o4PT7+mpOyCqVjDB9n/ZusKmN995ptpmqFCiHoTM+XRP1AWzz3ZX2n evOMuJqhgfBTpG8lflb3AEPtN/RZuUiJW7sem4rgAFhAaxubWfiewjMHyqfUEf3y8twb cEldUgVeRlUvhMzpobggWKTZANqfTmDZy6FAPq5KBzfZ/kamKpefEVEt/URWs6Crr1xv EUBA== X-Received: by 10.112.26.103 with SMTP id k7mr4359743lbg.86.1412612508170; Mon, 06 Oct 2014 09:21:48 -0700 (PDT) Received: from dw.org.pl (afov98.neoplus.adsl.tpnet.pl. [178.42.125.98]) by mx.google.com with ESMTPSA id f6sm5881644lbh.10.2014.10.06.09.21.46 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Oct 2014 09:21:47 -0700 (PDT) From: Dariusz Wierzbicki X-Google-Original-From: Dariusz Wierzbicki Date: Mon, 6 Oct 2014 18:21:45 +0200 To: Yonghyeon PYUN Subject: Re: [CFT] alc(4) QAC AR816x/AR817x ethernet controller support Message-ID: <20141006182145.07b0441c@dw.org.pl> In-Reply-To: <20141006023213.GC3131@michelle.fasterthan.com> References: <20140930015741.GA2451@michelle.fasterthan.com> <20141001013637.GD2632@michelle.fasterthan.com> <20141002050730.GA964@michelle.fasterthan.com> <20141003212946.1499d68f@dw.org.pl> <20141006023213.GC3131@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: Mon, 06 Oct 2014 16:21:50 -0000 Dnia 2014-10-06, o godz. 11:32:13 Yonghyeon PYUN napisa=C5=82(a): > On Fri, Oct 03, 2014 at 09:29:46PM +0200, Dariusz Wierzbicki wrote: > > Dnia 2014-10-02, o godz. 14:07:30 > > Yonghyeon PYUN napisa=C5=82(a): > >=20 > > > 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. > >=20 > > Hi ! > >=20 > > Thanks for your work ! > >=20 > > Are your patches only for current ? I tried on 10 stable. > >=20 >=20 > No, it should be applied to stable/10 as well. I intentionally > didn't include additional diff for MAC statistics which will not > work on stable/10 and stable/9 due to if_inc_counter changes made > in HEAD. >=20 > I tried to apply the diff again against stable/10 and it succeeded > with minor fuzz and offset differences. Thanks for your answer. I tried again and I succeeded. I used --ignore-whitespace option with patch command and the alc.diff applied successfully. >=20 > >=20 > > My system: > >=20 > > 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 > >=20 >=20 > [...] >=20 > > I applied that part manually. Compiled and rebooted system. > >=20 > >=20 > > dmesg | grep alc : > >=20 > > alc0: could not disable Rx/Tx MAC(0x4000cb20)! > > alc0: reset timeout(0x4000cb20)! > > alc0: could not disable Rx/Tx MAC(0x4000cb20)! > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >=20 > I'm more worried about MAC reset and master reset timeout shown > below. The MAC reset timeout makes me wonder how this can happen > since driver just checks bit 0 and bit 1, the low nibble of the > register value can't be 0. >=20 > > 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)! > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >=20 > I think this also can't happen since driver checks bit[0-3], the > low byte should be non-zero when the timeout triggers. >=20 > > alc0: 11776 Tx FIFO, 12032 Rx FIFO > > miibus0: on alc0 > > alc0: Ethernet address: 74:d4:35:91:32:04 >=20 > [...] >=20 > >=20 > > If you need other data or more testing, let me know. > >=20 >=20 > Do you have any local changes in alc(4)? As I said, the diff > could be applied to stable/10 without any manual modification. >=20 > Thanks for testing! You were right. I had a minor local change in if_alc.c file. Now everything seems to work: dw@dw:~ % dmesg | grep alc Preloaded elf obj module "/boot/kernel/if_alc.ko" at 0xffffffff81bd6b38. 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 alc0: port 0xd000-0xd07f mem 0xf7200000-0xf723ffff irq 18 at device 0.0 on pci3 alc0: 11776 Tx FIFO, 12032 Rx FIFO alc0: Using 1 MSIX message(s). miibus0: on alc0 alc0: Ethernet address: 74:d4:35:91:32:04 alc0: link state changed to UP Thanks again for the patches and for your work ! Darek