public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* reg: MAC address could not change on pre-boot environment and failed to PXE boot.
@ 2023-03-24  4:22 Sivaraman Nainar
  2023-03-24  4:36 ` [edk2-devel] " erichmcmill
  2023-03-24 11:30 ` Rabeda, Maciej
  0 siblings, 2 replies; 4+ messages in thread
From: Sivaraman Nainar @ 2023-03-24  4:22 UTC (permalink / raw)
  To: devel@edk2.groups.io, Maciej Rabeda, Rabeda, Maciej,
	Santhosh Kumar V, Raj V Akilan

[-- Attachment #1: Type: text/plain, Size: 1434 bytes --]

Hello :

We are writing a application to program the MAC from UEFI shell and with the updated MAC address trying to do the PXE Boot which failed.

The application uses the Simple Network Protocols StationAddress() to update the MAC. After update the Current Address in the Mode of SimpleNetwork Interface updated to new MAC address. If we performed IfConfigl -l command the updated MAC not showing. Also in this environment PXE boot also got failed.

To bind the updated MAC, tried giving "reconnect -r" from UEFI shell after running test application and performed PXE boot. With On board Network controller (Intel I219), the MAC address updated in Snp->Mode->CurrentAddress is reverted back to older MAC address.  If reconnect not performed, the MAC Address changing but PXE Failed to boot.

Can someone comment if the method to update the MAC is correct or we missing something.

Thanks
Siva
-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

[-- Attachment #2: Type: text/html, Size: 3585 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] reg: MAC address could not change on pre-boot environment and failed to PXE boot.
  2023-03-24  4:22 reg: MAC address could not change on pre-boot environment and failed to PXE boot Sivaraman Nainar
@ 2023-03-24  4:36 ` erichmcmill
  2023-06-02  2:12   ` Sivaraman Nainar
  2023-03-24 11:30 ` Rabeda, Maciej
  1 sibling, 1 reply; 4+ messages in thread
From: erichmcmill @ 2023-03-24  4:36 UTC (permalink / raw)
  To: Sivaraman Nainar, devel

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

Hi Sivaraman,

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

* Mac Address needs to be programmed before network stack fully loads (pretty 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 that is signalled when Snp->Initialize() is executed. · microsoft/mu_basecore@7dc143d (github.com) ( https://github.com/microsoft/mu_basecore/commit/7dc143d594bfef6d2a2a24b10b96e1258a15a344 )
* DXE Driver code to handle the Mac programming when the SNP is installed Add MacEmulationDxe Support by Erich-McMillan · Pull Request #109 · microsoft/mu_plus (github.com) ( https://github.com/microsoft/mu_plus/pull/109/files#diff-f4bb037877470a0fc3e2f6587ad1295370ce78febdbc49a12fe65fe4b52fb80d ) * If you don't take this driver as is be very careful to copy the 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 · microsoft/mu_basecore@2b8ad03 (github.com) ( https://github.com/microsoft/mu_basecore/commit/2b8ad03c5de4113ffbe85f5301daaad6c9c980e2 )
Let me know if you have any issues/questions. Its been a while since I looked at this code.

-Erich

[-- Attachment #2: Type: text/html, Size: 1514 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: reg: MAC address could not change on pre-boot environment and failed to PXE boot.
  2023-03-24  4:22 reg: MAC address could not change on pre-boot environment and failed to PXE boot Sivaraman Nainar
  2023-03-24  4:36 ` [edk2-devel] " erichmcmill
@ 2023-03-24 11:30 ` Rabeda, Maciej
  1 sibling, 0 replies; 4+ messages in thread
From: Rabeda, Maciej @ 2023-03-24 11:30 UTC (permalink / raw)
  To: Sivaraman Nainar, devel@edk2.groups.io, Maciej Rabeda,
	Santhosh Kumar V, Raj V Akilan

[-- Attachment #1: Type: text/plain, Size: 3553 bytes --]

Hi Nainar,


  1.  Snp->StationAddress() calls UNDI->StationAddress(). Is there a guarantee that the UNDI driver you are using will persist the configuration across driver reloads / platform reboots? If there is no such guarantee, you should not reconnect UNDI driver - else the setting is lost.
  2.  Ipconfig interfaces with Ip4Config2 protocol to obtain MAC address to display.

Check "HwAddress" field in "EFI_IP4_CONFIG2_INTERFACE_INFO" structure.

It is initialized in the Ip4Dxe driver, in Ip4Config2InitIfInfo(). If you follow Ip4Config2InitIfInfo() upwards the stack, you will see that it gets called in Ip4Dxe DriverBinding->Start() function.

What I would suggest is to only reconnect SNP driver.

Thanks,
Maciej

From: Sivaraman Nainar <sivaramann@ami.com>
Sent: Friday, March 24, 2023 5:22 AM
To: devel@edk2.groups.io; Maciej Rabeda <maciej.rabeda@linux.intel.com>; Rabeda, Maciej <maciej.rabeda@intel.com>; Santhosh Kumar V <santhoshkumarv@ami.com>; Raj V Akilan <rajva@ami.com>
Subject: reg: MAC address could not change on pre-boot environment and failed to PXE boot.

Hello :

We are writing a application to program the MAC from UEFI shell and with the updated MAC address trying to do the PXE Boot which failed.

The application uses the Simple Network Protocols StationAddress() to update the MAC. After update the Current Address in the Mode of SimpleNetwork Interface updated to new MAC address. If we performed IfConfigl -l command the updated MAC not showing. Also in this environment PXE boot also got failed.

To bind the updated MAC, tried giving "reconnect -r" from UEFI shell after running test application and performed PXE boot. With On board Network controller (Intel I219), the MAC address updated in Snp->Mode->CurrentAddress is reverted back to older MAC address.  If reconnect not performed, the MAC Address changing but PXE Failed to boot.

Can someone comment if the method to update the MAC is correct or we missing something.

Thanks
Siva
-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.

[-- Attachment #2: Type: text/html, Size: 9462 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [edk2-devel] reg: MAC address could not change on pre-boot environment and failed to PXE boot.
  2023-03-24  4:36 ` [edk2-devel] " erichmcmill
@ 2023-06-02  2:12   ` Sivaraman Nainar
  0 siblings, 0 replies; 4+ messages in thread
From: Sivaraman Nainar @ 2023-06-02  2:12 UTC (permalink / raw)
  To: erichmcmill@gmail.com, devel@edk2.groups.io

[-- Attachment #1: Type: text/plain, Size: 2506 bytes --]

Hello Erich / Maciej:

Thanks for your guidelines. With this approach able to program the MAC and PXE boot works.

Thank you
Siva
From: erichmcmill@gmail.com<mailto:erichmcmill@gmail.com>
Sent: Friday, March 24, 2023 10:06 AM
To: Sivaraman Nainar<mailto:sivaramann@ami.com>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
Subject: [EXTERNAL] Re: [edk2-devel] reg: MAC address could not change on pre-boot environment and failed to PXE boot.


**CAUTION: The e-mail below is from an external source. Please exercise caution before opening attachments, clicking links, or following guidance.**
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 (pretty 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 that is signalled when Snp->Initialize() is executed. · microsoft/mu_basecore@7dc143d (github.com)<https://github.com/microsoft/mu_basecore/commit/7dc143d594bfef6d2a2a24b10b96e1258a15a344>
     *   DXE Driver code to handle the Mac programming when the SNP is installed Add MacEmulationDxe Support by Erich-McMillan · Pull Request #109 · microsoft/mu_plus (github.com)<https://github.com/microsoft/mu_plus/pull/109/files#diff-f4bb037877470a0fc3e2f6587ad1295370ce78febdbc49a12fe65fe4b52fb80d>

        *   If you don't take this driver as is be very careful to copy the TPL levels from event handers not doing this will cause issues

  1.  This change to reload the Snp info in ARP might be needed too ArpDriver: refetch Snp Mode data after running MnpConfigure · microsoft/mu_basecore@2b8ad03 (github.com)<https://github.com/microsoft/mu_basecore/commit/2b8ad03c5de4113ffbe85f5301daaad6c9c980e2>
Let me know if you have any issues/questions. Its been a while since I looked at this code.

-Erich

-The information contained in this message may be confidential and proprietary to American Megatrends (AMI). This communication is intended to be read only by the individual or entity to whom it is addressed or by their designee. If the reader of this message is not the intended recipient, you are on notice that any distribution of this message, in any form, is strictly prohibited. Please promptly notify the sender by reply e-mail or by telephone at 770-246-8600, and then delete or destroy all copies of the transmission.

[-- Attachment #2: Type: text/html, Size: 5633 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-02  2:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-24  4:22 reg: MAC address could not change on pre-boot environment and failed to PXE boot Sivaraman Nainar
2023-03-24  4:36 ` [edk2-devel] " erichmcmill
2023-06-02  2:12   ` Sivaraman Nainar
2023-03-24 11:30 ` Rabeda, Maciej

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox