Date: Tue, 11 Oct 2011 10:10:29 -0700 From: YongHyeon PYUN <pyunyh@gmail.com> To: Karim <fodillemlinkarim@gmail.com> Cc: freebsd-net@freebsd.org Subject: Re: if_msk.c link negotiation / packet drops Message-ID: <20111011171029.GA5661@michelle.cdnetworks.com> In-Reply-To: <4E94637A.5090607@gmail.com> References: <4E94637A.5090607@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Oct 11, 2011 at 11:40:42AM -0400, Karim wrote: > Hi List, > > Using a Marvell NIC plugged into a CISCO switch I see the > auto-negotiation failing and even when forcing the device to full-duplex > we sometimes see packet drops. > > Here is the device description from dmesg: > > mskc0: <Marvell Yukon 88E8053 Gigabit Ethernet> port 0xbe00-0xbeff mem > 0xfdefc000-0xfdefffff irq 16 at device 0.0 on pci1 > msk0: <Marvell Technology Group Ltd. Yukon EC Id 0xb6 Rev 0x02> on mskc0 > msk0: Ethernet address: 00:03:2d:09:94:52 > miibus0: <MII bus> on msk0 > e1000phy0: <Marvell 88E1111 Gigabit PHY> PHY 0 on miibus0 > e1000phy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, 1000baseT, > 1000baseT-master, 1000baseT-FDX, 1000baseT-FDX-master, auto, auto-flow > mskc0: [ITHREAD] > > The switch its plugged in (Cisco) is configured for 100baseTX full-duplex. > > ifconfig reports: > > msk0: > flags=608843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,SATELLITE,LAN_NET> > metric 0 mtu 1500 > options=40018<VLAN_MTU,VLAN_HWTAGGING> The flags and options show that you're using very customized driver, right? > ether 00:03:2d:09:94:52 > inet 192.168.122.7 netmask 0xffffff00 broadcast 192.168.122.255 > media: Ethernet autoselect (100baseTX <half-duplex>) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Resolved duplex is half so I guess it would be normal to see dropped frames which may be triggered by collision. > status: active > > I added a bit of debugging code in e1000phy_status in the hope to > understand what was going on: > > bmsr = PHY_READ(sc, E1000_SR) | PHY_READ(sc, E1000_SR); > bmcr = PHY_READ(sc, E1000_CR); > ssr = PHY_READ(sc, E1000_SSR); > > printf("%s ssr 0x%x bmsr 0x%x bmcr 0x%x\n", __func__, ssr, bmsr, bmcr); > > Which consistently gives: > > kernel: e1000phy_status ssr 0x4d00 bmsr 0x796d bmcr 0x1000 > This register value is consistent with media status of ifconfig output. The real question is why auto-negotiation does not work against your switch. It could be a bug in switch side and if you have to manually set full-duplex with msk(4), please make sure your switch's duplex configuration also should be manually set to full-duplex. Otherwise resolved duplex is half. > Now and then the system will report the device is going inactive and we > can see packet drops when that happens. This repeat itself once in a > while without being predictable. > Check MAC H/W statistics counter and see any collisions(dev.msk.0.stats) > By the way on a 7.4 system this was happening every 10 min. Using a > driver from FBSD9 back ported to 7.4 we see the issue at a much lower > frequency (every 30 min) but the issue is still there. > > Cheers, > > Karim.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20111011171029.GA5661>