[ipxe-devel] Intel 82576 MAC swapping

Kieran Evans keyz182 at gmail.com
Fri Jul 27 16:32:49 UTC 2012


Thanks Anton,

http://dbyz.co.uk/ipxe6.png

As can be seen, the no-offset patch worked with one small modification:

+        if (offset == 0xffff) {
+                /* There is no Alternate MAC Address */
+                return rc;
+        }

rc is uninitialised at this point, and the offset == 0xffff check 
doesn't touch it, so it returns as 0 (technically undefined, in 
practice, it seems to be 0), so the driver tries to use blank memory 
space as the MAC, so both MACs end up as 00:00:00:00:00:00.
I changed it to return -1; to make sure it works, not sure if there's a 
predefined error code that would be better suited?

Would there be any benefit in putting an is_valid_ether_addr check at 
the end of intel_fetch_mac_eeprom  before returning 0, just in case?

/Kieran

On 27/07/2012 16:38, Anton D. Kachalov wrote:
> Here is another one without shifting an offset.
>
> 27.07.2012, 19:36, "Anton D. Kachalov" <mouse at yandex-team.ru>:
>> Kieran,
>>
>> regarding to "igb" driver, offset (in words) to EEPROM's MAC should be placed at 0x37 (in words) of EEPROM (page 178, table 6-1). It is 0xffff.
>>
>> Try the attached patch.
>>
>> I accidentally has added left shift by 2 instead of 1 :))
>>
>>>>     if ( ( rc = nvs_read ( &intel->eeprom, 0x37 << 2 /* NVM_ALT_MAC_ADDR_PTR */,
>>>>
>>>>     to this one:
>>>>
>>>>     if ( ( rc = nvs_read ( &intel->eeprom, 0x37 << 1 /* NVM_ALT_MAC_ADDR_PTR */,
>> 27.07.2012, 19:01, "Kieran Evans" <keyz182 at gmail.com>:
>>
>>>    Anton, no luck there I'm afraid.
>>>
>>>    http://dbyz.co.uk/ipxe4.png
>>>
>>>    If you check the EEPROM dumps I sent earlier, you'll see that there is
>>>    only one MAC in the whole EEPROM. Looking for it at different offsets
>>>    will return garbage.
>>>
>>>    Just to be sure, I dumped the EEPROM from both interfaces (both linked
>>>    in an earlier email) and they are identical, so they are sharing the
>>>    same EEPROM.
>>>
>>>    /Kieran
>>>
>>>    On 27/07/2012 14:55, Anton D. Kachalov wrote:
>>>>     Kieran,
>>>>
>>>>     my fault.
>>>>
>>>>     Fix this line:
>>>>
>>>>     if ( ( rc = nvs_read ( &intel->eeprom, 0x37 /* NVM_ALT_MAC_ADDR_PTR */,
>>>>
>>>>     to this one:
>>>>
>>>>     if ( ( rc = nvs_read ( &intel->eeprom, 0x37 << 2 /* NVM_ALT_MAC_ADDR_PTR */,
>> --
>> Anton D. Kachalov
>>
>> ITO, R&D group, Senior System Engineer
>> Tel: +7 (495) 739-70-00 ext.7613
>> _______________________________________________
>> ipxe-devel mailing list
>> ipxe-devel at lists.ipxe.org
>> https://lists.ipxe.org/mailman/listinfo.cgi/ipxe-devel




More information about the ipxe-devel mailing list