From: Denis Vlasenko <vda.linux@googlemail.com>
To: "Alex Owen" <r.alex.owen@gmail.com>
Cc: linux-kernel@vger.kernel.org, c-d.hailfinger.kernel.2004@gmx.net,
aabdulla@nvidia.com
Subject: Re: forcedeth net driver: reverse mac address after pxe boot
Date: Thu, 5 Oct 2006 16:28:40 +0200 [thread overview]
Message-ID: <200610051628.40247.vda.linux@googlemail.com> (raw)
In-Reply-To: <55c223960610040919u221deffei5a5b6c37cfc8eb5a@mail.gmail.com>
On Wednesday 04 October 2006 18:19, Alex Owen wrote:
> I an issue with the forcedeth driver when used after the BIOS PXE routines.
> When booting directly from disk the ethernet MAC address is normal.
> eg: 00:16:17:xx:yy:zz
> But is the BIOS PXE boot stack loads pxelinux which then boots the
> local disk, or if pxelinux loads a kernel/initrd, then the MAC address
> detected by the forcedeth linux driver is reversed.
> eg zz:yy:xx:17:16:00
>
> This is obviously causes me a problem with automated installs started
> via PXE boot as the installed cannot DHCP as the MAC address is wrong.
>
> I have read some of the bug reports and LKML threads on WOL and
> forcedeth and I have looked at the code of the driver... most closely
> forcedeth v57 as per comment #22 of
> http://bugzilla.kernel.org/show_bug.cgi?id=6604
>
> My understanding of the code is that the driver determines the cards
> MAC address by reading from registers in the ethernet controller, but
> that for reasons best known to nvidia this address backwards and so
> the driver "fixes" this by itself reversing the read values and
> writing them back to the controller.
>
> This normally works ok and there has been some work to put the old
> "wrong" MAC address back at close down to get WOL to work to.
>
> Enter PXE... Booting from PXE (in BIOS) seems to "fixup" the "wrong"
> MAC address so when the driver determines the cards MAC address by
> reading from registers in the ethernet controller then MAC address
> there is now CORRECT. The driver however assumes it is reversed and in
> trying to "fix" the MAC address is infact writes back the
> revesed/broken MAC back to the controller.
>
> The obvious fix for this is to try and read the MAC address from the
> canonical location... ie where is the source of the address writen
> into the controlers registers at power on? But do we know where that
> may be?
>
> The other solution would be unconditionally reset the controler to
> it's power on state then use the current logic? can we reset the
> controller via software?
> There does seem to be an nv_mac_reset function... and this does seem
> to be called if the card has a capability DEV_HAS_POWER_CONTROL but it
> is called in nv_open() while the MAC is read in nv_probe().
>
> Perhaps we need to unconditionally run nv_mac_reset just before
> reading the MAC in nv_probe() ?
>
> Anyway I hope that someone who knows kernel internals and this driver
> inparticular feels the urge to look at this!
Also MAC addresses cannot be arbitrary. If nothing else would work,
we can add OUI numbers (3 most significant bytes of MAC)
of known suppliers of nvidia eth and check whether they are
in lower bytes or in higher ones.
--
vda
next prev parent reply other threads:[~2006-10-05 14:30 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-04 16:19 forcedeth net driver: reverse mac address after pxe boot Alex Owen
2006-10-04 16:50 ` H. Peter Anvin
2006-10-04 17:30 ` Alan Cox
2006-10-04 18:06 ` Ayaz Abdulla
2006-10-20 17:33 ` Alex Owen
2006-10-05 14:28 ` Denis Vlasenko [this message]
2006-10-05 14:44 ` John W. Linville
2006-10-05 18:35 ` Carl-Daniel Hailfinger
2006-10-05 19:31 ` John W. Linville
2006-10-05 19:45 ` Ayaz Abdulla
2006-10-06 14:37 ` Alex Owen
2006-10-06 17:29 ` Ayaz Abdulla
2006-10-06 19:11 ` John W. Linville
2006-10-06 21:02 ` Ayaz Abdulla
2006-10-05 19:45 ` Andrew de Quincey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200610051628.40247.vda.linux@googlemail.com \
--to=vda.linux@googlemail.com \
--cc=aabdulla@nvidia.com \
--cc=c-d.hailfinger.kernel.2004@gmx.net \
--cc=linux-kernel@vger.kernel.org \
--cc=r.alex.owen@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox