From mboxrd@z Thu Jan 1 00:00:00 1970 Subject: Re: [edk2-devel] reg: MAC address could not change on pre-boot environment and failed to PXE boot. To: Sivaraman Nainar ,devel@edk2.groups.io From: erichmcmill@gmail.com X-Originating-Location: Katy, Texas, US (98.39.83.207) X-Originating-Platform: Windows Chrome 111 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Thu, 23 Mar 2023 21:36:16 -0700 References: In-Reply-To: Message-ID: <21387.1679632576228070434@groups.io> Content-Type: multipart/alternative; boundary="DSCrg9tv4Skry4NqYET8" --DSCrg9tv4Skry4NqYET8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Sivaraman, We did this recently in project mu, trying to find exactly the changes need= ed but I recall the following: * Mac Address needs to be programmed before network stack fully loads (pret= ty sure I only got it working in DXE), possible to add changes from this PR= and have an event callback to set mac address * Event Add a named event th= at is signalled when Snp->Initialize() is executed. =C2=B7 microsoft/mu_bas= ecore@7dc143d (github.com) ( https://github.com/microsoft/mu_basecore/commi= t/7dc143d594bfef6d2a2a24b10b96e1258a15a344 ) * DXE Driver code to handle the Mac programming when the SNP is installed A= dd MacEmulationDxe Support by Erich-McMillan =C2=B7 Pull Request #109 =C2= =B7 microsoft/mu_plus (github.com) ( https://github.com/microsoft/mu_plus/p= ull/109/files#diff-f4bb037877470a0fc3e2f6587ad1295370ce78febdbc49a12fe65fe4= b52fb80d ) * If you don't take this driver as is be very careful to copy th= e TPL levels from event handers not doing this will cause issues * This change to reload the Snp info in ARP might be needed too ArpDriver: = refetch Snp Mode data after running MnpConfigure =C2=B7 microsoft/mu_baseco= re@2b8ad03 (github.com) ( https://github.com/microsoft/mu_basecore/commit/2= b8ad03c5de4113ffbe85f5301daaad6c9c980e2 ) Let me know if you have any issues/questions. Its been a while since I look= ed at this code. -Erich --DSCrg9tv4Skry4NqYET8 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Hi Sivaraman,

We did this recently in project mu, trying to find= exactly the changes needed but I recall the following:

  1. Mac Address needs to be programmed before network stack fully loads (pr= etty sure I only got it working in DXE), possible to add changes from this = PR and have an event callback to set mac address
    1. Event Add a named event that is signalled whe= n Snp->Initialize() is executed. · microsoft/mu_basecore@7dc143d = (github.com)
    2. DXE Driver code to handle the Mac programming when the SNP is installed=  Add MacEmu= lationDxe Support by Erich-McMillan · Pull Request #109 · mic= rosoft/mu_plus (github.com)
      1. If you don't take this driver as is be very careful to copy the TPL lev= els from event handers not doing this will cause issues
  2. This change to reload the Snp info in ARP might be needed too ArpDriver: refetch Snp Mode data after running MnpCon= figure · microsoft/mu_basecore@2b8ad03 (github.com)
Let me know if you have any issues/questions. Its been a while since I look= ed at this code.

-Erich --DSCrg9tv4Skry4NqYET8--