From owner-freebsd-net@FreeBSD.ORG Tue Oct 11 16:12:23 2011 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 AA11D106564A for ; Tue, 11 Oct 2011 16:12:23 +0000 (UTC) (envelope-from fodillemlinkarim@gmail.com) Received: from mail-qw0-f54.google.com (mail-qw0-f54.google.com [209.85.216.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6C6DC8FC12 for ; Tue, 11 Oct 2011 16:12:23 +0000 (UTC) Received: by qadz30 with SMTP id z30so6469762qad.13 for ; Tue, 11 Oct 2011 09:12:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=L93af44lFmgxBgyb5ChzPIfMxqF0kjwczYNfoRVcApQ=; b=kKY5zEgDuI/yHK4o2Q5yINN4m1QihXz+NaCjAeKlBw3jewf/M7kkgycsPmfQDhqSOE E2Q6SpCXaf7S/gR9DEaNxB65Fqj7Tw/LFkVI64/DuuIuz5IQxVEPwi636btWNMLTcBGB Xiy44QxFV5VQ7G/kbRLFDU6ZuzeBn3TynKDSA= Received: by 10.224.185.145 with SMTP id co17mr15423298qab.1.1318347647428; Tue, 11 Oct 2011 08:40:47 -0700 (PDT) Received: from [192.168.1.71] ([208.85.112.101]) by mx.google.com with ESMTPS id du5sm27951665qab.14.2011.10.11.08.40.45 (version=SSLv3 cipher=OTHER); Tue, 11 Oct 2011 08:40:46 -0700 (PDT) Message-ID: <4E94637A.5090607@gmail.com> Date: Tue, 11 Oct 2011 11:40:42 -0400 From: Karim User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15 MIME-Version: 1.0 To: freebsd-net@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: if_msk.c link negotiation / packet drops 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, 11 Oct 2011 16:12:23 -0000 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: port 0xbe00-0xbeff mem 0xfdefc000-0xfdefffff irq 16 at device 0.0 on pci1 msk0: on mskc0 msk0: Ethernet address: 00:03:2d:09:94:52 miibus0: on msk0 e1000phy0: 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 metric 0 mtu 1500 options=40018 ether 00:03:2d:09:94:52 inet 192.168.122.7 netmask 0xffffff00 broadcast 192.168.122.255 media: Ethernet autoselect (100baseTX ) 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 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. 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.