From owner-freebsd-net@FreeBSD.ORG Tue Jan 22 21:23:19 2008 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C80716A420 for ; Tue, 22 Jan 2008 21:23:19 +0000 (UTC) (envelope-from paketix@bluewin.ch) Received: from mx31.bluewin.ch (mx31.bluewin.ch [195.186.18.42]) by mx1.freebsd.org (Postfix) with ESMTP id 296FF13C4D1 for ; Tue, 22 Jan 2008 21:23:19 +0000 (UTC) (envelope-from paketix@bluewin.ch) Received: from hbnnbsddev91.sharedtcs.net (213.3.8.216) by mx31.bluewin.ch (Bluewin wppuqpqq 7.3.121) id 4795E272000DBC2F for freebsd-net@freebsd.org; Tue, 22 Jan 2008 21:11:54 +0000 Received: from hbnnbsddev01.sharedtcs.net (localhost.sharedtcs.net [127.0.0.1]) by hbnnbsddev01.sharedtcs.net (8.13.8/8.13.8) with ESMTP id m0MHeT0c064335 for ; Tue, 22 Jan 2008 18:40:29 +0100 (CET) (envelope-from tbeoepa1@hbnnbsddev01.sharedtcs.net) Received: (from tbeoepa1@localhost) by hbnnbsddev01.sharedtcs.net (8.13.8/8.13.8/Submit) id m0MHeSvj064334 for freebsd-net@freebsd.org; Tue, 22 Jan 2008 18:40:28 +0100 (CET) (envelope-from tbeoepa1) Date: Tue, 22 Jan 2008 18:40:28 +0100 From: Patrick Oeschger To: freebsd-net@freebsd.org Message-ID: <20080122174028.GA64136@hbnnbsddev01.sharedtcs.net> Mail-Followup-To: freebsd-net@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Subject: 6.3-RELEASE/7.0-RC1: em(4) fails on 82571EB_SERDES X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Jan 2008 21:23:19 -0000 maybe i found two issues which are em(4) related... i tested the 6.3-RELEASE on a appliance which has two on-board SFP slots chipset: i82571eb (serdes with tbi-interface) em4@pci8:0:0: class=0x020000 card=0x10761903 chip=0x10608086 rev=0x06 hdr=0x00 em5@pci8:0:1: class=0x020000 card=0x10761903 chip=0x10608086 rev=0x06 hdr=0x00 first issue: on the SFP ports link status is always up - even if no fiber optic cable is attached this problem seems to be E1000_STATUS_LU related (in serdes mode the chipset will use the LU flag to indicate 'signal loss' which it gets signaled from the SFP module - PCIe* Gbe Controllers Open Source Software Developer's Manual DocID: 316080-001 (December 2006) 8.3.3 Loss of Signal/Link Status Indication 14.8.3 Mac/SerDes (TBI-Mode) Link Setup the following patch resolved this issue during my test: --- sys/dev/em/if_em.c.orig 2008-01-22 16:55:06.000000000 +0100 +++ sys/dev/em/if_em.c 2008-01-22 13:33:58.000000000 +0100 @@ -2491,9 +2494,21 @@ { struct ifnet *ifp = adapter->ifp; device_t dev = adapter->dev; + bool status_lu = E1000_READ_REG(&adapter->hw, E1000_STATUS) & + E1000_STATUS_LU; + + if ((adapter->hw.device_id == E1000_DEV_ID_82571EB_SERDES) && + (!(E1000_READ_REG(&adapter->hw, E1000_TXCW) & E1000_TXCW_ANE)) && + (E1000_READ_REG(&adapter->hw, E1000_CTRL) & E1000_CTRL_SLU)) { + if (E1000_READ_REG(&adapter->hw, E1000_STATUS) & + E1000_STATUS_LU) { + status_lu = 0; + } else { + status_lu = 1; + } + } - if (E1000_READ_REG(&adapter->hw, E1000_STATUS) & - E1000_STATUS_LU) { + if (status_lu) { if (adapter->link_active == 0) { e1000_get_speed_and_duplex(&adapter->hw, &adapter->link_speed, &adapter->link_duplex); second issue: during branching of the fibre optic cabling i get a few messages regarding 'coalesced states' Jan 22 10:36:00 test kernel: em4: 2 link states coalesced this seems to be because of link state interrupts generated by the chipset during branching of the fiber optic cable the link can change quickly multiple times the following patch resolved this issue during my test: ...maybe the driver needs the same for EM_FAST_IRQ and POLLING(?) --- sys/dev/em/if_em.c.orig 2008-01-22 16:55:06.000000000 +0100 +++ sys/dev/em/if_em.c 2008-01-22 13:33:58.000000000 +0100 @@ -1460,7 +1460,9 @@ struct adapter *adapter = arg; struct ifnet *ifp; uint32_t reg_icr; - + bool do_update = (adapter->hw.device_id == + E1000_DEV_ID_82571EB_SERDES) ? + FALSE : TRUE; EM_CORE_LOCK(adapter); ifp = adapter->ifp; @@ -1499,7 +1501,8 @@ callout_stop(&adapter->timer); adapter->hw.mac.get_link_status = 1; e1000_check_for_link(&adapter->hw); - em_update_link_status(adapter); + if (do_update) + em_update_link_status(adapter); /* Deal with TX cruft when link lost */ em_tx_purge(adapter); callout_reset(&adapter->timer, hz, - is there any way to get 82571_SERDES working in a future release of the em(4) driver? input on this issue is very welcome br -pat-