[edk2] [PATCH edk2-platforms] Platform/AMD/OverdriveBoard: fix byte order of default MAC addresses

Andrew Fish afish at apple.com
Mon Dec 10 15:38:30 PST 2018



> On Dec 10, 2018, at 3:33 PM, Leif Lindholm <leif.lindholm at linaro.org> wrote:
> 
> On Mon, Dec 10, 2018 at 11:51:43PM +0100, Ard Biesheuvel wrote:
>> On Mon, 10 Dec 2018 at 23:14, Leif Lindholm <leif.lindholm at linaro.org> wrote:
>>> 
>>> On Wed, Dec 05, 2018 at 09:10:48PM +0100, Ard Biesheuvel wrote:
>>>> The PCDs containing the default MAC addresses are of type UINT64,
>>>> and so the byte order needs to be inverted. As they are currently,
>>>> both default MAC addresses are invalid since they have the multicast
>>>> bit set.
>>> 
>>> Ah, oops.
>>> That would also prevent them from being "locally administered" and
>>> hence permissible without registering an entry in the OUI.
>>> 
>>> However, to reduce someone interpreting the _new_ values that way
>>> instead, could you do one of:
>>> - Adding a comment explaining these are in reverse byte order.
>>> or
>>> - Convert them to the new Array type PCD[1], to make the bytes appear
>>>  in natural order?
>>> 
>>> [1] edk2 72a1d77694d51914c0dd6aa97dbfa58634b0a4a5
>> 
>> How does one refer to such a PCD from C code?
> 
> Good question :)
> 

Seems like you would need cast the pointer to the data structure in the C code. If I understand correctly the change in the PCD creation code is you can now better structure the data, but it is no different on the consumer end and you got a blob of bytes in both cases. 

Thanks,

Andrew Fish

> /
>    Leif
> 
>>>> Contributed-under: TianoCore Contribution Agreement 1.1
>>>> Signed-off-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
>>>> ---
>>>> Platform/AMD/OverdriveBoard/OverdriveBoard.dsc | 4 ++--
>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>> 
>>>> diff --git a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
>>>> index 05433d4472e8..2843e51f93f7 100644
>>>> --- a/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
>>>> +++ b/Platform/AMD/OverdriveBoard/OverdriveBoard.dsc
>>>> @@ -469,8 +469,8 @@ DEFINE DO_CAPSULE   = FALSE
>>>>   gAmdModulePkgTokenSpaceGuid.PcdPort1NetSpeed|1
>>>> 
>>>> [PcdsDynamicDefault.common]
>>>> -  gAmdStyxTokenSpaceGuid.PcdEthMacA|0x02A1A2A3A4A5
>>>> -  gAmdStyxTokenSpaceGuid.PcdEthMacB|0x02B1B2B3B4B5
>>>> +  gAmdStyxTokenSpaceGuid.PcdEthMacA|0xA5A4A3A2A102
>>>> +  gAmdStyxTokenSpaceGuid.PcdEthMacB|0xB5B4B3B2B102
>>>> 
>>>> [PcdsPatchableInModule]
>>>>   gAmdModulePkgTokenSpaceGuid.PcdXgbeUseMacFromIscp|TRUE
>>>> --
>>>> 2.19.2
>>>> 
> _______________________________________________
> edk2-devel mailing list
> edk2-devel at lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



More information about the edk2-devel mailing list