From owner-freebsd-net@freebsd.org Fri Feb 19 01:26:21 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E947AAAD72B for ; Fri, 19 Feb 2016 01:26:20 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pf0-x233.google.com (mail-pf0-x233.google.com [IPv6:2607:f8b0:400e:c00::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5E041B09 for ; Fri, 19 Feb 2016 01:26:20 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by mail-pf0-x233.google.com with SMTP id c10so42615233pfc.2 for ; Thu, 18 Feb 2016 17:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:date:to:cc:subject:message-id:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=u2aRUuxeDjOoPjXFI8x+CajzA7d+AYEvdxG3KxS/lds=; b=lLtRny08TU8xaErsiil4IFkNOGUxGSV1L0L7x2nB3sUiDJElsjoxvYboyjpCjOsIcI X3ZcIiqZq5/gwD7c8AJl4uaYmYgHpnhv6JnHlV7H1sSG6aBKXkWbYqoq9+XQ5qfitxic 8X/3quW74uL7NLaBP04C2i5x52Z3K/BYqzZlP8bHvihmx9h5ZjkcdfjUqJMewshfBoSc s1jJyIaw7my3Yr2uyAEFugFGljs2ygO5clzwLrMl/71YgEdpaNTFvshCiWo4D/mi34Fl 5rF/HYEB5uoCtHYJpR25jvC7B1FMZZzqRPNdCKq+TaKnZUHfMva6toCR7hsDJfcdA9W7 0fEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:date:to:cc:subject:message-id:reply-to :references:mime-version:content-type:content-disposition :in-reply-to:user-agent; bh=u2aRUuxeDjOoPjXFI8x+CajzA7d+AYEvdxG3KxS/lds=; b=fdxSV1UkeJEyhbohDXpJcoDgpkfxEspQnFOOI9oMLWLlaq3k19/QFc9ZOhqi2hxZOd S6bx33bCFKvcJPMWisR+qMzRhz5rRoIXohl08IIh76A/sf3OzYnchqx9JURB3m1ux59y CAx2wPc3Roq9uz87JqQvOTvJjhuM2eqL7w1QgvpWiZHikKjyAzCoSgKGbudyZzgKwhpi f1SkY6pFM6Un6Gn631zrF4EPtMXxGqWKNRcB9Ys8Z5QkC16MfqyyexLT/61FrkIbKMOt jGp3lUxRiXQ5VUftgs0ld0W7hB1w3gZhD+cAM4OPiA9w+Uy7G0tFyof60obH7/qDt9Ut +stw== X-Gm-Message-State: AG10YOT5Pn1fTvzl7HVnLLE3PrCwjh9XBGfye0fZmnCnbI5fCDD7dYvRZPUm0BzKkt8wKg== X-Received: by 10.98.74.93 with SMTP id x90mr14500036pfa.80.1455845180315; Thu, 18 Feb 2016 17:26:20 -0800 (PST) Received: from localhost ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id fn3sm13115286pab.20.2016.02.18.17.26.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Feb 2016 17:26:18 -0800 (PST) From: YongHyeon PYUN X-Google-Original-From: "YongHyeon PYUN" Received: by localhost (sSMTP sendmail emulation); Fri, 19 Feb 2016 10:26:12 +0900 Date: Fri, 19 Feb 2016 10:26:12 +0900 To: Tino Engel Cc: "freebsd-net@freebsd.org" Subject: Re: Support for Killer E2400 Ethernet Message-ID: <20160219012612.GA1267@michelle.fasterthan.co.kr> Reply-To: pyunyh@gmail.com References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="3MwIy2ne0vdjdPXF" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Feb 2016 01:26:21 -0000 --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 18, 2016 at 04:17:30PM +0100, Tino Engel wrote: > > > > Hello all, > I am trying to establish support for the Killer E2400 ethernet adapter. > I am following the approach that works for the linux driver, which is basically:- Add the E2400 device ID- Copy all device related stuff from the E2200 > What works:- DHCP- Ping any host in the internet > What does not work:- Downloading stuff using "fetch"- Setup pkg- Therefore cannot browse since I even cannot install pkg in order to obtain a browser > The error message I continously receive is "alc0: DMA write error". > I have so far played with all the loader tunables and sysctls supported by the alc driver, but no improvement of the situation. > Any ideas how to proceed? Due to lack of access to Killer E2200 controller, alc(4) was not fully tested for the controller. One user also reported that alc(4) shows DMA errors as you saw. To narrow down the issue, could you please add the following to /boot/loader.conf file and test it again if your system has more than 4GB memory? hw.physmem="3G" The tunable above will limit system memory to 3GB. Also show me the output of "sysctl dev.alc.0.stats" before and after running "ping -s 1472 remote_ip_addr" command. (Note, the ping command with -s option requires root privilege and you have to reboot to take changes effect). If limiting system memory have no effect, could you try attached patch and let me know whether it makes any difference? The patch will print "alc0: DMA CFG : 0xXXXXXXXX". Let me know the value of XXXXXXXX. Thanks. --3MwIy2ne0vdjdPXF Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="alc.e2200.diff4" Index: sys/dev/alc/if_alc.c =================================================================== --- sys/dev/alc/if_alc.c (revision 295117) +++ sys/dev/alc/if_alc.c (working copy) @@ -4184,16 +4184,22 @@ alc_init_locked(struct alc_softc *sc) reg = (RXQ_CFG_RD_BURST_DEFAULT << RXQ_CFG_RD_BURST_SHIFT) & RXQ_CFG_RD_BURST_MASK; reg |= RXQ_CFG_RSS_MODE_DIS; - if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) + if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) != 0) { reg |= (RXQ_CFG_816X_IDT_TBL_SIZE_DEFAULT << RXQ_CFG_816X_IDT_TBL_SIZE_SHIFT) & RXQ_CFG_816X_IDT_TBL_SIZE_MASK; - if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && - sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) - reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_1M; + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } else { + if ((sc->alc_flags & ALC_FLAG_FASTETHER) == 0 && + sc->alc_ident->deviceid != DEVICEID_ATHEROS_AR8151_V2) + reg |= RXQ_CFG_ASPM_THROUGHPUT_LIMIT_100M; + } CSR_WRITE_4(sc, ALC_RXQ_CFG, reg); /* Configure DMA parameters. */ + reg = CSR_READ_4(sc, ALC_DMA_CFG); + device_printf(sc->alc_dev, "DMA CFG : 0x%08x\n", reg); reg = DMA_CFG_OUT_ORDER | DMA_CFG_RD_REQ_PRI; reg |= sc->alc_rcb; if ((sc->alc_flags & ALC_FLAG_CMB_BUG) == 0) @@ -4200,8 +4206,10 @@ alc_init_locked(struct alc_softc *sc) reg |= DMA_CFG_CMB_ENB; if ((sc->alc_flags & ALC_FLAG_SMB_BUG) == 0) reg |= DMA_CFG_SMB_ENB; - else - reg |= DMA_CFG_SMB_DIS; + else { + if ((sc->alc_flags & ALC_FLAG_AR816X_FAMILY) == 0) + reg |= DMA_CFG_SMB_DIS; + } reg |= (sc->alc_dma_rd_burst & DMA_CFG_RD_BURST_MASK) << DMA_CFG_RD_BURST_SHIFT; reg |= (sc->alc_dma_wr_burst & DMA_CFG_WR_BURST_MASK) << @@ -4293,16 +4301,16 @@ alc_stop(struct alc_softc *sc) /* Disable interrupts. */ CSR_WRITE_4(sc, ALC_INTR_MASK, 0); CSR_WRITE_4(sc, ALC_INTR_STATUS, 0xFFFFFFFF); - /* Disable DMA. */ - reg = CSR_READ_4(sc, ALC_DMA_CFG); - reg &= ~(DMA_CFG_CMB_ENB | DMA_CFG_SMB_ENB); - reg |= DMA_CFG_SMB_DIS; - CSR_WRITE_4(sc, ALC_DMA_CFG, reg); - DELAY(1000); + if ((sc->alc_flags & (ALC_FLAG_CMB_BUG | ALC_FLAG_SMB_BUG)) == 0) { + /* Disable DMA. */ + reg = CSR_READ_4(sc, ALC_DMA_CFG); + reg &= ~(DMA_CFG_CMB_ENB | DMA_CFG_SMB_ENB); + reg |= DMA_CFG_SMB_DIS; + CSR_WRITE_4(sc, ALC_DMA_CFG, reg); + DELAY(1000); + } /* Stop Rx/Tx MACs. */ alc_stop_mac(sc); - /* Disable interrupts which might be touched in taskq handler. */ - CSR_WRITE_4(sc, ALC_INTR_STATUS, 0xFFFFFFFF); /* Disable L0s/L1s */ alc_aspm(sc, 0, IFM_UNKNOWN); /* Reclaim Rx buffers that have been processed. */ --3MwIy2ne0vdjdPXF--