From owner-freebsd-net@FreeBSD.ORG Fri Dec 6 22:54:42 2013 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0024BA3D for ; Fri, 6 Dec 2013 22:54:41 +0000 (UTC) Received: from mail-yh0-x230.google.com (mail-yh0-x230.google.com [IPv6:2607:f8b0:4002:c01::230]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id B5CBB192C for ; Fri, 6 Dec 2013 22:54:41 +0000 (UTC) Received: by mail-yh0-f48.google.com with SMTP id f73so1008990yha.21 for ; Fri, 06 Dec 2013 14:54:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=xjntvCHfUWHfvlMVypviH0HxyFQaECAq6HOHVseK69s=; b=PS0CtaqHwcoA763gFgdQnSb1JFTMMgUwGMTsDd3rk8ReaoQBr54xbaataZmR1Z8xld TKvoYzkstPsg+gVId2/hMtRSGYOKrGOmMaJ066jLJGY9H+qsdrfvS2nfx0vERrCAGh9k qbb/03fBXsXGm1f1G7PDl5YW7vOFQPtSj4jCbDO5FUhUao7gVLVaZ01o2xMd5XtITaEc nI72NTpgsM5UQUzTcBq8/zF7jkS1s93jXlcj+OKzRd/30Ht+k7lkVyoLnrzWhI39ejfC 3JrHw3Xjmil8Pi+WPfFW/myg++BBCdmKfzgAmn7hKiXpbpZ5Req2MH28EYs/b1Nk2Bif iEJQ== X-Received: by 10.236.174.37 with SMTP id w25mr4623808yhl.36.1386370480977; Fri, 06 Dec 2013 14:54:40 -0800 (PST) Received: from [10.10.1.35] ([192.252.130.194]) by mx.google.com with ESMTPSA id b30sm106230yhm.5.2013.12.06.14.54.40 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 06 Dec 2013 14:54:40 -0800 (PST) Message-ID: <52A255AB.8040905@gmail.com> Date: Fri, 06 Dec 2013 17:54:35 -0500 From: Karim Fodil-Lemelin User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 MIME-Version: 1.0 To: freebsd-net@FreeBSD.org Subject: Avoiding an infinite loop in e1000 82575 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Jack Vogel X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Dec 2013 22:54:42 -0000 Hi, I have encountered a strange issue were the igb driver goes into an infinite loop (I'm using version - 2.3.10) if many incantations of ifconfig are running in a while loop very fast. The following patch fixed it for me: @@ -1052,12 +1052,11 @@ static void e1000_release_swfw_sync_82575(struct e1000_hw *hw, u16 mask) { u32 swfw_sync; DEBUGFUNC("e1000_release_swfw_sync_82575"); - while (e1000_get_hw_semaphore_generic(hw) != E1000_SUCCESS) - ; /* Empty */ + e1000_get_hw_semaphore_generic(hw); swfw_sync = E1000_READ_REG(hw, E1000_SW_FW_SYNC); swfw_sync &= ~mask; E1000_WRITE_REG(hw, E1000_SW_FW_SYNC, swfw_sync); Now, I haven't seen any side effect of this change except that it fixed my issue although I wonder what they are and what effect will this change have on the system? Thanks, Karim. PS: Some more information on the devices: dmesg: igb0: port 0xc880-0xc89f mem 0xfba80000-0xfbafffff,0xfbb78000-0xfbb7bfff irq 16 at device 0.0 on pci4 igb0: Using MSIX interrupts with 2 vectors igb0: Ethernet address: 00:90:0b:2f:b8:00 igb0: [ITHREAD] igb0: [ITHREAD] igb1: port 0xcc00-0xcc1f mem 0xfbb80000-0xfbbfffff,0xfbb7c000-0xfbb7ffff irq 17 at device 0.1 on pci4 igb1: Using MSIX interrupts with 2 vectors igb1: Ethernet address: 00:90:0b:2f:b8:01 igb1: [ITHREAD] igb1: [ITHREAD] igb2: port 0xd880-0xd89f mem 0xfbc80000-0xfbcfffff,0xfbd78000-0xfbd7bfff irq 16 at device 0.0 on pci5 igb2: Using MSIX interrupts with 2 vectors igb2: Ethernet address: 00:90:0b:2f:b8:02 igb2: [ITHREAD] igb2: [ITHREAD] igb3: port 0xdc00-0xdc1f mem 0xfbd80000-0xfbdfffff,0xfbd7c000-0xfbd7ffff irq 17 at device 0.1 on pci5 igb3: Using MSIX interrupts with 2 vectors igb3: Ethernet address: 00:90:0b:2f:b8:03 igb3: [ITHREAD] igb3: [ITHREAD] pciconf igb0@pci0:4:0:0: class=0x020000 card=0x00008086 chip=0x150e8086 rev=0x01 hdr=0x00 igb1@pci0:4:0:1: class=0x020000 card=0x00008086 chip=0x150e8086 rev=0x01 hdr=0x00 igb2@pci0:5:0:0: class=0x020000 card=0x00008086 chip=0x150e8086 rev=0x01 hdr=0x00 igb3@pci0:5:0:1: class=0x020000 card=0x00008086 chip=0x150e8086 rev=0x01 hdr=0x00