From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.136; helo=mga12.intel.com; envelope-from=liming.gao@intel.com; receiver=edk2-devel@lists.01.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4292B21196812 for ; Mon, 10 Dec 2018 16:53:54 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Dec 2018 16:53:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,340,1539673200"; d="scan'208";a="282547829" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 10 Dec 2018 16:53:54 -0800 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 16:53:53 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.408.0; Mon, 10 Dec 2018 16:53:53 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.203]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.176]) with mapi id 14.03.0415.000; Tue, 11 Dec 2018 08:53:51 +0800 From: "Gao, Liming" To: Andrew Fish , Leif Lindholm CC: "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH edk2-platforms] Platform/AMD/OverdriveBoard: fix byte order of default MAC addresses Thread-Index: AQHUjNasKbrlpbDlW0y9L4luOMUjRaV4C7SAgAAKWYCAAAvKgIAAAUgAgACRvZA= Date: Tue, 11 Dec 2018 00:53:51 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E389AA3@SHSMSX104.ccr.corp.intel.com> References: <20181205201049.10590-1-ard.biesheuvel@linaro.org> <20181210221441.2xwqqzgafxpvqguu@bivouac.eciton.net> <20181210233355.4v5guv5nwmbun5w3@bivouac.eciton.net> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH edk2-platforms] Platform/AMD/OverdriveBoard: fix byte order of default MAC addresses X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Dec 2018 00:53:55 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable If PCD is related to one structure in DEC/DSC, it can be refer as structure= pointer in C source code. Here is wiki for its usage: https://github.com/l= gao4/edk2/wiki/StrucutrePcd-Usage Thanks Liming >-----Original Message----- >From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of >Andrew Fish via edk2-devel >Sent: Tuesday, December 11, 2018 7:39 AM >To: Leif Lindholm >Cc: edk2-devel@lists.01.org >Subject: Re: [edk2] [PATCH edk2-platforms] Platform/AMD/OverdriveBoard: >fix byte order of default MAC addresses > > > >> On Dec 10, 2018, at 3:33 PM, Leif Lindholm wr= ote: >> >> On Mon, Dec 10, 2018 at 11:51:43PM +0100, Ard Biesheuvel wrote: >>> On Mon, 10 Dec 2018 at 23:14, Leif Lindholm >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 >>>>> --- >>>>> 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 =3D 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@lists.01.org >> https://lists.01.org/mailman/listinfo/edk2-devel > >_______________________________________________ >edk2-devel mailing list >edk2-devel@lists.01.org >https://lists.01.org/mailman/listinfo/edk2-devel