From owner-freebsd-net@freebsd.org Sun Aug 16 11:56:33 2015 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 91F0B99891B for ; Sun, 16 Aug 2015 11:56:33 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: from mail-pa0-x229.google.com (mail-pa0-x229.google.com [IPv6:2607:f8b0:400e:c03::229]) (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 61363104B; Sun, 16 Aug 2015 11:56:33 +0000 (UTC) (envelope-from pyunyh@gmail.com) Received: by pacum4 with SMTP id um4so3406344pac.3; Sun, 16 Aug 2015 04:56:32 -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:reply-to:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=wr1+bjzOcDqRvqGgR1wLAMfZEmSUpueny/zxwB81seY=; b=uy1GQkWJsyUunI23f685Bsumo1z3cfT9pAyTz8ITHCSnWQhMVi4xQzkNe9jhWcysvW jFm2aE25/Onn2x6klIC39gRy1+2CbOxiUMYR1505esP6NzUoyD1KNQMmhyraHduwUyUE CxLZkvE8yG6bixCzrEYV5emHpMR07VjpgeA5Bf/Uk8q8N7pAMvMEMFXzVqk60C3DKWEv X4NrrGeCFnOAs9VLO/1RHK1Ra7uBVO0r07C//QtUi4EZ3cEC4KXSxPvzxUbXAgDPs/fA w+0yJLY93PAtvJ4qiDByqV4V8/rHE5v1dJb7YSP80SbTZR9bLjEXdHfXkBDP818foAxL sakg== X-Received: by 10.66.253.170 with SMTP id ab10mr107030272pad.135.1439726192565; Sun, 16 Aug 2015 04:56:32 -0700 (PDT) Received: from pyunyh@gmail.com ([106.247.248.2]) by smtp.gmail.com with ESMTPSA id ya3sm11228885pbb.71.2015.08.16.04.56.28 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 16 Aug 2015 04:56:31 -0700 (PDT) From: Yonghyeon PYUN X-Google-Original-From: "Yonghyeon PYUN" Received: by pyunyh@gmail.com (sSMTP sendmail emulation); Sun, 16 Aug 2015 20:56:23 +0900 Date: Sun, 16 Aug 2015 20:56:23 +0900 To: Kim Culhan Cc: sbruno@freebsd.org, freebsd-net@freebsd.org Subject: Re: RE not working on 10.2-RELEASE #0 r286731M Message-ID: <20150816115623.GA1288@michelle.fasterthan.com> Reply-To: pyunyh@gmail.com References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="x+6KMIRAuhnl3hBn" 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: Sun, 16 Aug 2015 11:56:33 -0000 --x+6KMIRAuhnl3hBn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Aug 14, 2015 at 06:29:08PM -0400, Kim Culhan wrote: [...] > > On 08/14/15 13:34, Kim Culhan wrote: > >> RE on 10.2-RELEASE #0 r286731M appears to pass only arp traffic. > >> > >> Replaced if_re.c with version from 273757, appears to work > >> normally. > >> > >> The diff: > >> > >> 34c34 < __FBSDID("$FreeBSD: stable/10/sys/dev/re/if_re.c 273757 > >> 2014-10-28 00:43:00Z yongari $"); --- > >>> __FBSDID("$FreeBSD: releng/10.2/sys/dev/re/if_re.c 285177 > >>> 2015-07-05 > >> 20:16:38Z marius $"); 3198,3202d3197 < * Enable transmit and > >> receive. < */ < CSR_WRITE_1(sc, RL_COMMAND, > >> RL_CMD_TX_ENB|RL_CMD_RX_ENB); < < /* 3227a3223,3227 > >>> /* * Enable transmit and receive. */ CSR_WRITE_1(sc, RL_COMMAND, > >>> RL_CMD_TX_ENB | RL_CMD_RX_ENB); > >>> > >> 3251,3254d3250 < #ifdef notdef < /* Enable receiver and > >> transmitter. */ < CSR_WRITE_1(sc, RL_COMMAND, > >> RL_CMD_TX_ENB|RL_CMD_RX_ENB); < #endif > >> > >> Let me know what additional info I can provide. [...] > > I'm running -current with all changes in place, I'm not seeing the > > issues noted here with my hardware. Can you post your hardware from > > pciconf -lv? > > > > re0@pci0:3:0:0: class=0x020000 card=0x84321043 chip=0x816810ec > > rev=0x06 hdr=0x00 > > vendor = 'Realtek Semiconductor Co., Ltd.' > > device = 'RTL8111/8168B PCI Express Gigabit Ethernet controller' > > class = network > > subclass = ethernet > > re1@pci0:4:5:0: class=0x020000 card=0x43021186 chip=0x43021186 > > rev=0x10 hdr=0x00 > > vendor = 'D-Link System Inc' > > device = 'DGE-530T Gigabit Ethernet Adapter (rev.C1) [Realtek > > RTL8169]' > > class = network > > subclass = ethernet > > > > > > sean > > pciconf -lv > > re0@pci0:2:0:0: class=0x020000 card=0x83671043 chip=0x816810ec rev=0x02 > hdr=0x00 > vendor = 'Realtek Semiconductor Co., Ltd.' > device = 'RTL8111/8168B PCI Express Gigabit Ethernet controller' > class = network > subclass = ethernet > re1@pci0:6:0:0: class=0x020000 card=0x816910ec chip=0x816910ec rev=0x10 > hdr=0x00 > vendor = 'Realtek Semiconductor Co., Ltd.' > device = 'RTL8169 PCI Gigabit Ethernet Controller' > class = network > subclass = ethernet > re2@pci0:6:1:0: class=0x020000 card=0x4c001186 chip=0x43001186 rev=0x10 > hdr=0x00 > vendor = 'D-Link System Inc' > device = 'DGE-528T Gigabit Ethernet Adapter' > class = network > subclass = ethernet > > The problem was noted on re2, re0 and re1 appeared to be working normally. > Hmm, it seems your PCI controller does not work. I can't explain why Sean's re1 still works though. Would you try attached patch? BTW, it would be better to see the re(4) related dmesg output. Driver will show Chip/MAC revision and that is the only way to identify each MAC revision. --x+6KMIRAuhnl3hBn Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="re.pci_mac.diff" Index: sys/dev/re/if_re.c =================================================================== --- sys/dev/re/if_re.c (revision 286823) +++ sys/dev/re/if_re.c (working copy) @@ -3197,6 +3197,12 @@ re_init_locked(struct rl_softc *sc) ~0x00080000); /* + * Enable transmit and receive for non-PCIe controllers. + * RX/TX MACs should be enabled before RX/TX configuration. + */ + if ((sc->rl_flags & RL_FLAG_PCIE) == 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB | RL_CMD_RX_ENB); + /* * Set the initial TX configuration. */ if (sc->rl_testmode) { @@ -3223,9 +3229,11 @@ re_init_locked(struct rl_softc *sc) } /* - * Enable transmit and receive. + * Enable transmit and receive for PCIe controllers. + * RX/TX MACs should be enabled after RX/TX configuration. */ - CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB | RL_CMD_RX_ENB); + if ((sc->rl_flags & RL_FLAG_PCIE) != 0) + CSR_WRITE_1(sc, RL_COMMAND, RL_CMD_TX_ENB | RL_CMD_RX_ENB); #ifdef DEVICE_POLLING /* --x+6KMIRAuhnl3hBn--