Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Feb 2016 10:26:12 +0900
From:      YongHyeon PYUN <pyunyh@gmail.com>
To:        Tino Engel <tino.engel@hotmail.com>
Cc:        "freebsd-net@freebsd.org" <freebsd-net@freebsd.org>
Subject:   Re: Support for Killer E2400 Ethernet
Message-ID:  <20160219012612.GA1267@michelle.fasterthan.co.kr>
In-Reply-To: <DUB109-W140BA030126A753EEE1E8F398AF0@phx.gbl>
References:  <DUB109-W140BA030126A753EEE1E8F398AF0@phx.gbl>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20160219012612.GA1267>