Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > 27922b4260f65d317aabda37e42bbbff > files > 2717

kernel-2.6.18-238.el5.src.rpm

From: Stefan Assmann <sassmann@redhat.com>
Date: Thu, 13 Aug 2009 11:37:50 +0200
Subject: [net] igb: set lan id prior to configuring phy
Message-id: 4A83DEEE.80200@redhat.com
O-Subject: Re: [RHEL 5.5 PATCH] igb: set lan id prior to configuring phy
Bugzilla: 508870
RH-Acked-by: Jiri Pirko <jpirko@redhat.com>
RH-Acked-by: Dean Nelson <dnelson@redhat.com>
RH-Acked-by: Andy Gospodarek <gospo@redhat.com>
RH-Acked-by: John W. Linville <linville@redhat.com>

On 12.08.2009 18:37, Dean Nelson wrote:
> On 08/12/2009 11:05 AM, Stefan Assmann wrote:
>> Bugzilla:
>> https://bugzilla.redhat.com/show_bug.cgi?id=508870
>>
>> Description:
>> The igb driver was defaulting to using the lock for pci-e function 0 for
>> all of the phys due to the fact that the lan id was not being set prior
>> to initialization. This change makes it so that the function id is set
>> prior to checking for the phy id.
>>
>> According to comment #38 this patch addresses the following issues
>> mentione in comment #18:
>> 2. With shared management LAN, no management LAN connection after DC off
>> (shutdown -h), DC on via LAN is impossible
>> 3. In DC on/off test, the igb driver sporadically reports "error -2"
>> (E1000_ERR_PHY) during HW detection. The shared management port (eth0)
>> is unusable in this case.
>> 4. In a "repeat ethtool -r" test with shared management LAN, the igb
>> driver sometimes reports "Hardware error", or negotiates a wrong speed
>> (10 or 100 MBit instead of 1Gbit).
>>
>> Upstream Status:
>> http://git.kernel.org/linus/19e588e7d156cc4415585edd8c27c3075f62eaf8
>>
>> Brew Build:
>> https://brewweb.devel.redhat.com/taskinfo?taskID=1924846
>>
>> Test Status:
>> I successfully compiled the source but can't test it myself. Testing of
>> the patch has been done by Takeshi Suzuki from Fujitsu.
>>

Hopefully things are sorted out now. Here's a repost of the patch. Let
me know of any issues and thanks for all the feedback.

  Stefan

diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c
index 66a688b..45e0638 100644
--- a/drivers/net/igb/e1000_82575.c
+++ b/drivers/net/igb/e1000_82575.c
@@ -190,6 +190,10 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw)
 		phy->ops.write_reg          = igb_write_phy_reg_igp;
 	}
 
+	/* set lan id */
+	hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >>
+	               E1000_STATUS_FUNC_SHIFT;
+
 	/* Set phy->phy_addr and phy->id. */
 	ret_val = igb_get_phy_id_82575(hw);
 	if (ret_val)