Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive Pxe-Http Boot Issue

2024-03-25 Thread Sivaraman Nainar via groups.io
Hi Saloni:

" On 2/27/24 05:49, Sivaraman Nainar wrote:
> Hi Laszlo,
>
> We can see the issue not only with SLES, it can be seen with Ubuntu 22 also.
>
> Do we have any channel to work with grub team to fix this issue?

No particular channel. Oliver has been participating in upstream grub2 
development (CC'd), so I figure bug analysis and bugfix posting should occur on 
their normal development mailing list.

Laszlo"

This is the last update from Lazlo. I am not directly involved working with 
Grub team.

Thanks
Siva
-Original Message-
From: Kasbekar, Saloni 
Sent: Saturday, March 23, 2024 3:33 AM
To: Sivaraman Nainar ; devel@edk2.groups.io; Laszlo Ersek 
; Santhosh Kumar V ; Clark-williams, 
Zachary 
Cc: Raj V Akilan ; Soundharia R 
Subject: RE: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved 
Consecutive Pxe-Http Boot Issue

Hi Siva,

Have you looked into getting this fixed in grub as Laszlo suggested? What's the 
expected timeline for this workaround?

Thanks,
Saloni

-Original Message-
From: Sivaraman Nainar 
Sent: Tuesday, March 19, 2024 4:32 AM
To: devel@edk2.groups.io; Laszlo Ersek ; Santhosh Kumar V 
; Kasbekar, Saloni ; 
Clark-williams, Zachary 
Cc: Raj V Akilan ; Soundharia R 
Subject: RE: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved 
Consecutive Pxe-Http Boot Issue

@Saloni Kasbekar,

Can you please comment on the changes?

Thanks
Siva
-Original Message-
From: Sivaraman Nainar
Sent: Monday, February 26, 2024 4:01 PM
To: devel@edk2.groups.io; Sivaraman Nainar ; Laszlo Ersek 
; Santhosh Kumar V ; Saloni Kasbekar 
; Zachary Clark-williams 

Cc: Raj V Akilan ; Soundharia R 
Subject: RE: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved 
Consecutive Pxe-Http Boot Issue

@Saloni Kasbekar, @Zachary Clark-williams,

Could you please add your feedback on the changes proposed?

Thanks
Siva
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sivaraman Nainar 
via groups.io
Sent: Thursday, February 22, 2024 7:33 AM
To: Laszlo Ersek ; devel@edk2.groups.io; Santhosh Kumar V 
; Saloni Kasbekar ; Zachary 
Clark-williams 
Cc: Raj V Akilan ; Soundharia R 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

Laszlo:

Thanks for the detailed feedback on the changes for this issue. Since we are 
not sure if this change are valid / violate some purpose of SNP driver, it 
mentioned as Workaround.

@Saloni Kasbekar and @Clark-williams, Zachary can add more on these changes.

As you recommended, we can have PCD which controls these changes till the 
changes are addressed in grub.

@Santhosh Kumar V is this issue can be seen only in SLES 15 or it can be found 
in any OS having Grub 2.x?

Thanks
Siva
-Original Message-
From: Laszlo Ersek 
Sent: Thursday, February 22, 2024 5:15 AM
To: devel@edk2.groups.io; Santhosh Kumar V 
Cc: Sivaraman Nainar ; Raj V Akilan ; 
Soundharia R ; Saloni Kasbekar 
; Zachary Clark-williams 

Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

On 2/21/24 18:15, Santhosh Kumar V via groups.io wrote:
> The customer has a server environment where PXE and HTTP service run in same 
> Linux Server. In this environment a SUT trying to boot to SLES 15 OS via PXE 
> from the Boot Menu. After PXE Boot file downloaded and grub Loaded without 
> continuing for installation Exit is pressed and control back to Setup.
> Now the HTTP boot to SLES 15 OS tried in the same environment and failed to 
> download the file. If there is a reconnect -r performed before this HTTP Boot 
> then boot file download and installation is getting success.
> Root cause of the issue is, when Exit from grub performed, boot Loader Stops 
> the SNP Driver and starts the same.

This sentence feels like the key one.

Are you saying that grub calls Snp->Start() just before it exits?

If so, am I right to suspect that that's a grub bug? It sounds like a resource 
leak, after all.

Can you perhaps include a grub source code location / pointer in the commit 
message?

> During this process SNP is in Initialized State. When HTTP boot is performed 
> immediately after PXE Failure, the MNP configure method initiates the SNP 
> Start again. Since the SNP already started by grub it returns 
> EFI_ALREADY_STARTED and none of the upper Layer drivers are getting started.
> As a work around in MNPConfigure(), if the SNP Start failed with Already 
> Started and in Initialized state we can return success so that rest of the 
> drivers can be loaded and HTTP boot can work.
>
>
> Cc: Saloni 

Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive Pxe-Http Boot Issue

2024-03-19 Thread Sivaraman Nainar via groups.io
@Saloni Kasbekar,

Can you please comment on the changes?

Thanks
Siva
-Original Message-
From: Sivaraman Nainar
Sent: Monday, February 26, 2024 4:01 PM
To: devel@edk2.groups.io; Sivaraman Nainar ; Laszlo Ersek 
; Santhosh Kumar V ; Saloni Kasbekar 
; Zachary Clark-williams 

Cc: Raj V Akilan ; Soundharia R 
Subject: RE: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved 
Consecutive Pxe-Http Boot Issue

@Saloni Kasbekar, @Zachary Clark-williams,

Could you please add your feedback on the changes proposed?

Thanks
Siva
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sivaraman Nainar 
via groups.io
Sent: Thursday, February 22, 2024 7:33 AM
To: Laszlo Ersek ; devel@edk2.groups.io; Santhosh Kumar V 
; Saloni Kasbekar ; Zachary 
Clark-williams 
Cc: Raj V Akilan ; Soundharia R 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

Laszlo:

Thanks for the detailed feedback on the changes for this issue. Since we are 
not sure if this change are valid / violate some purpose of SNP driver, it 
mentioned as Workaround.

@Saloni Kasbekar and @Clark-williams, Zachary can add more on these changes.

As you recommended, we can have PCD which controls these changes till the 
changes are addressed in grub.

@Santhosh Kumar V is this issue can be seen only in SLES 15 or it can be found 
in any OS having Grub 2.x?

Thanks
Siva
-Original Message-
From: Laszlo Ersek 
Sent: Thursday, February 22, 2024 5:15 AM
To: devel@edk2.groups.io; Santhosh Kumar V 
Cc: Sivaraman Nainar ; Raj V Akilan ; 
Soundharia R ; Saloni Kasbekar 
; Zachary Clark-williams 

Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

On 2/21/24 18:15, Santhosh Kumar V via groups.io wrote:
> The customer has a server environment where PXE and HTTP service run in same 
> Linux Server. In this environment a SUT trying to boot to SLES 15 OS via PXE 
> from the Boot Menu. After PXE Boot file downloaded and grub Loaded without 
> continuing for installation Exit is pressed and control back to Setup.
> Now the HTTP boot to SLES 15 OS tried in the same environment and failed to 
> download the file. If there is a reconnect -r performed before this HTTP Boot 
> then boot file download and installation is getting success.
> Root cause of the issue is, when Exit from grub performed, boot Loader Stops 
> the SNP Driver and starts the same.

This sentence feels like the key one.

Are you saying that grub calls Snp->Start() just before it exits?

If so, am I right to suspect that that's a grub bug? It sounds like a resource 
leak, after all.

Can you perhaps include a grub source code location / pointer in the commit 
message?

> During this process SNP is in Initialized State. When HTTP boot is performed 
> immediately after PXE Failure, the MNP configure method initiates the SNP 
> Start again. Since the SNP already started by grub it returns 
> EFI_ALREADY_STARTED and none of the upper Layer drivers are getting started.
> As a work around in MNPConfigure(), if the SNP Start failed with Already 
> Started and in Initialized state we can return success so that rest of the 
> drivers can be loaded and HTTP boot can work.
>
>
> Cc: Saloni Kasbekar 
> Cc: Zachary Clark-williams 
>
> Signed-off-by: SanthoshKumar 
> ---
>  NetworkPkg/MnpDxe/MnpConfig.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/NetworkPkg/MnpDxe/MnpConfig.c
> b/NetworkPkg/MnpDxe/MnpConfig.c index 93587d53aa..0f2df28d73 100644
> --- a/NetworkPkg/MnpDxe/MnpConfig.c
> +++ b/NetworkPkg/MnpDxe/MnpConfig.c
> @@ -1120,7 +1120,9 @@ MnpStartSnp (
>// Start the simple network.
>
>//
>
>Status = Snp->Start (Snp);
>
> -
>
> +  if ((Status == EFI_ALREADY_STARTED ) && (Snp->Mode->State ==
> + EfiSimpleNetworkInitialized)) {
>
> +  return EFI_SUCCESS;
>
> +  }
>
>if (!EFI_ERROR (Status)) {
>
>  //
>
>  // Initialize the simple network.
>

The commit message does say this is a workaround, and I don't immediately any 
see why this workaround (in the code) would be problematic in practice, but it 
still leaves a bad taste in my mouth.

Consider: the call path is the following:

MnpConfigure()   [NetworkPkg/MnpDxe/MnpConfig.c] -- public .Configure() 
protocol member function
  MnpConfigureInstance() [NetworkPkg/MnpDxe/MnpConfig.c]
MnpStart()   [NetworkPkg/MnpDxe/MnpConfig.c]
  // see notes!
  MnpStartSnp()  [NetworkPkg/MnpDxe/

Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive Pxe-Http Boot Issue

2024-02-26 Thread Sivaraman Nainar via groups.io
Hi Laszlo,

We can see the issue not only with SLES, it can be seen with Ubuntu 22 also.

Do we have any channel to work with grub team to fix this issue?

Thanks
Siva
-Original Message-
From: Sivaraman Nainar
Sent: Monday, February 26, 2024 4:01 PM
To: devel@edk2.groups.io; Sivaraman Nainar ; Laszlo Ersek 
; Santhosh Kumar V ; Saloni Kasbekar 
; Zachary Clark-williams 

Cc: Raj V Akilan ; Soundharia R 
Subject: RE: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved 
Consecutive Pxe-Http Boot Issue

@Saloni Kasbekar, @Zachary Clark-williams,

Could you please add your feedback on the changes proposed?

Thanks
Siva
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sivaraman Nainar 
via groups.io
Sent: Thursday, February 22, 2024 7:33 AM
To: Laszlo Ersek ; devel@edk2.groups.io; Santhosh Kumar V 
; Saloni Kasbekar ; Zachary 
Clark-williams 
Cc: Raj V Akilan ; Soundharia R 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

Laszlo:

Thanks for the detailed feedback on the changes for this issue. Since we are 
not sure if this change are valid / violate some purpose of SNP driver, it 
mentioned as Workaround.

@Saloni Kasbekar and @Clark-williams, Zachary can add more on these changes.

As you recommended, we can have PCD which controls these changes till the 
changes are addressed in grub.

@Santhosh Kumar V is this issue can be seen only in SLES 15 or it can be found 
in any OS having Grub 2.x?

Thanks
Siva
-Original Message-
From: Laszlo Ersek 
Sent: Thursday, February 22, 2024 5:15 AM
To: devel@edk2.groups.io; Santhosh Kumar V 
Cc: Sivaraman Nainar ; Raj V Akilan ; 
Soundharia R ; Saloni Kasbekar 
; Zachary Clark-williams 

Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

On 2/21/24 18:15, Santhosh Kumar V via groups.io wrote:
> The customer has a server environment where PXE and HTTP service run in same 
> Linux Server. In this environment a SUT trying to boot to SLES 15 OS via PXE 
> from the Boot Menu. After PXE Boot file downloaded and grub Loaded without 
> continuing for installation Exit is pressed and control back to Setup.
> Now the HTTP boot to SLES 15 OS tried in the same environment and failed to 
> download the file. If there is a reconnect -r performed before this HTTP Boot 
> then boot file download and installation is getting success.
> Root cause of the issue is, when Exit from grub performed, boot Loader Stops 
> the SNP Driver and starts the same.

This sentence feels like the key one.

Are you saying that grub calls Snp->Start() just before it exits?

If so, am I right to suspect that that's a grub bug? It sounds like a resource 
leak, after all.

Can you perhaps include a grub source code location / pointer in the commit 
message?

> During this process SNP is in Initialized State. When HTTP boot is performed 
> immediately after PXE Failure, the MNP configure method initiates the SNP 
> Start again. Since the SNP already started by grub it returns 
> EFI_ALREADY_STARTED and none of the upper Layer drivers are getting started.
> As a work around in MNPConfigure(), if the SNP Start failed with Already 
> Started and in Initialized state we can return success so that rest of the 
> drivers can be loaded and HTTP boot can work.
>
>
> Cc: Saloni Kasbekar 
> Cc: Zachary Clark-williams 
>
> Signed-off-by: SanthoshKumar 
> ---
>  NetworkPkg/MnpDxe/MnpConfig.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/NetworkPkg/MnpDxe/MnpConfig.c
> b/NetworkPkg/MnpDxe/MnpConfig.c index 93587d53aa..0f2df28d73 100644
> --- a/NetworkPkg/MnpDxe/MnpConfig.c
> +++ b/NetworkPkg/MnpDxe/MnpConfig.c
> @@ -1120,7 +1120,9 @@ MnpStartSnp (
>// Start the simple network.
>
>//
>
>Status = Snp->Start (Snp);
>
> -
>
> +  if ((Status == EFI_ALREADY_STARTED ) && (Snp->Mode->State ==
> + EfiSimpleNetworkInitialized)) {
>
> +  return EFI_SUCCESS;
>
> +  }
>
>if (!EFI_ERROR (Status)) {
>
>  //
>
>  // Initialize the simple network.
>

The commit message does say this is a workaround, and I don't immediately any 
see why this workaround (in the code) would be problematic in practice, but it 
still leaves a bad taste in my mouth.

Consider: the call path is the following:

MnpConfigure()   [NetworkPkg/MnpDxe/MnpConfig.c] -- public .Configure() 
protocol member function
  MnpConfigureInstance() [NetworkPkg/MnpDxe/MnpConfig.c]
MnpStart()

Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive Pxe-Http Boot Issue

2024-02-26 Thread Sivaraman Nainar via groups.io
@Saloni Kasbekar, @Zachary Clark-williams,

Could you please add your feedback on the changes proposed?

Thanks
Siva
-Original Message-
From: devel@edk2.groups.io  On Behalf Of Sivaraman Nainar 
via groups.io
Sent: Thursday, February 22, 2024 7:33 AM
To: Laszlo Ersek ; devel@edk2.groups.io; Santhosh Kumar V 
; Saloni Kasbekar ; Zachary 
Clark-williams 
Cc: Raj V Akilan ; Soundharia R 
Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

Laszlo:

Thanks for the detailed feedback on the changes for this issue. Since we are 
not sure if this change are valid / violate some purpose of SNP driver, it 
mentioned as Workaround.

@Saloni Kasbekar and @Clark-williams, Zachary can add more on these changes.

As you recommended, we can have PCD which controls these changes till the 
changes are addressed in grub.

@Santhosh Kumar V is this issue can be seen only in SLES 15 or it can be found 
in any OS having Grub 2.x?

Thanks
Siva
-Original Message-
From: Laszlo Ersek 
Sent: Thursday, February 22, 2024 5:15 AM
To: devel@edk2.groups.io; Santhosh Kumar V 
Cc: Sivaraman Nainar ; Raj V Akilan ; 
Soundharia R ; Saloni Kasbekar 
; Zachary Clark-williams 

Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

On 2/21/24 18:15, Santhosh Kumar V via groups.io wrote:
> The customer has a server environment where PXE and HTTP service run in same 
> Linux Server. In this environment a SUT trying to boot to SLES 15 OS via PXE 
> from the Boot Menu. After PXE Boot file downloaded and grub Loaded without 
> continuing for installation Exit is pressed and control back to Setup.
> Now the HTTP boot to SLES 15 OS tried in the same environment and failed to 
> download the file. If there is a reconnect -r performed before this HTTP Boot 
> then boot file download and installation is getting success.
> Root cause of the issue is, when Exit from grub performed, boot Loader Stops 
> the SNP Driver and starts the same.

This sentence feels like the key one.

Are you saying that grub calls Snp->Start() just before it exits?

If so, am I right to suspect that that's a grub bug? It sounds like a resource 
leak, after all.

Can you perhaps include a grub source code location / pointer in the commit 
message?

> During this process SNP is in Initialized State. When HTTP boot is performed 
> immediately after PXE Failure, the MNP configure method initiates the SNP 
> Start again. Since the SNP already started by grub it returns 
> EFI_ALREADY_STARTED and none of the upper Layer drivers are getting started.
> As a work around in MNPConfigure(), if the SNP Start failed with Already 
> Started and in Initialized state we can return success so that rest of the 
> drivers can be loaded and HTTP boot can work.
>
>
> Cc: Saloni Kasbekar 
> Cc: Zachary Clark-williams 
>
> Signed-off-by: SanthoshKumar 
> ---
>  NetworkPkg/MnpDxe/MnpConfig.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/NetworkPkg/MnpDxe/MnpConfig.c
> b/NetworkPkg/MnpDxe/MnpConfig.c index 93587d53aa..0f2df28d73 100644
> --- a/NetworkPkg/MnpDxe/MnpConfig.c
> +++ b/NetworkPkg/MnpDxe/MnpConfig.c
> @@ -1120,7 +1120,9 @@ MnpStartSnp (
>// Start the simple network.
>
>//
>
>Status = Snp->Start (Snp);
>
> -
>
> +  if ((Status == EFI_ALREADY_STARTED ) && (Snp->Mode->State ==
> + EfiSimpleNetworkInitialized)) {
>
> +  return EFI_SUCCESS;
>
> +  }
>
>if (!EFI_ERROR (Status)) {
>
>  //
>
>  // Initialize the simple network.
>

The commit message does say this is a workaround, and I don't immediately any 
see why this workaround (in the code) would be problematic in practice, but it 
still leaves a bad taste in my mouth.

Consider: the call path is the following:

MnpConfigure()   [NetworkPkg/MnpDxe/MnpConfig.c] -- public .Configure() 
protocol member function
  MnpConfigureInstance() [NetworkPkg/MnpDxe/MnpConfig.c]
MnpStart()   [NetworkPkg/MnpDxe/MnpConfig.c]
  // see notes!
  MnpStartSnp()  [NetworkPkg/MnpDxe/MnpConfig.c]

Notes: the MnpStartSnp() call in MnpStart() is conditional on two circumstances 
(at the same time):
- "If it's not a configuration update, increase the configured children number."
- "It's the first configured child, start the simple network."

In other words, the MNP driver has just bound SNP "BY_DRIVER" (i.e., 
exclusively), installed the MNP service binding pr

Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive Pxe-Http Boot Issue

2024-02-21 Thread Sivaraman Nainar via groups.io
Laszlo:

Thanks for the detailed feedback on the changes for this issue. Since we are 
not sure if this change are valid / violate some purpose of SNP driver, it 
mentioned as Workaround.

@Saloni Kasbekar and @Clark-williams, Zachary can add more on these changes.

As you recommended, we can have PCD which controls these changes till the 
changes are addressed in grub.

@Santhosh Kumar V is this issue can be seen only in SLES 15 or it can be found 
in any OS having Grub 2.x?

Thanks
Siva
-Original Message-
From: Laszlo Ersek 
Sent: Thursday, February 22, 2024 5:15 AM
To: devel@edk2.groups.io; Santhosh Kumar V 
Cc: Sivaraman Nainar ; Raj V Akilan ; 
Soundharia R ; Saloni Kasbekar 
; Zachary Clark-williams 

Subject: [EXTERNAL] Re: [edk2-devel] [PATCH] NetworkPkg:Resolved Consecutive 
Pxe-Http Boot Issue


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**

On 2/21/24 18:15, Santhosh Kumar V via groups.io wrote:
> The customer has a server environment where PXE and HTTP service run in same 
> Linux Server. In this environment a SUT trying to boot to SLES 15 OS via PXE 
> from the Boot Menu. After PXE Boot file downloaded and grub Loaded without 
> continuing for installation Exit is pressed and control back to Setup.
> Now the HTTP boot to SLES 15 OS tried in the same environment and failed to 
> download the file. If there is a reconnect -r performed before this HTTP Boot 
> then boot file download and installation is getting success.
> Root cause of the issue is, when Exit from grub performed, boot Loader Stops 
> the SNP Driver and starts the same.

This sentence feels like the key one.

Are you saying that grub calls Snp->Start() just before it exits?

If so, am I right to suspect that that's a grub bug? It sounds like a resource 
leak, after all.

Can you perhaps include a grub source code location / pointer in the commit 
message?

> During this process SNP is in Initialized State. When HTTP boot is performed 
> immediately after PXE Failure, the MNP configure method initiates the SNP 
> Start again. Since the SNP already started by grub it returns 
> EFI_ALREADY_STARTED and none of the upper Layer drivers are getting started.
> As a work around in MNPConfigure(), if the SNP Start failed with Already 
> Started and in Initialized state we can return success so that rest of the 
> drivers can be loaded and HTTP boot can work.
>
>
> Cc: Saloni Kasbekar 
> Cc: Zachary Clark-williams 
>
> Signed-off-by: SanthoshKumar 
> ---
>  NetworkPkg/MnpDxe/MnpConfig.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/NetworkPkg/MnpDxe/MnpConfig.c
> b/NetworkPkg/MnpDxe/MnpConfig.c index 93587d53aa..0f2df28d73 100644
> --- a/NetworkPkg/MnpDxe/MnpConfig.c
> +++ b/NetworkPkg/MnpDxe/MnpConfig.c
> @@ -1120,7 +1120,9 @@ MnpStartSnp (
>// Start the simple network.
>
>//
>
>Status = Snp->Start (Snp);
>
> -
>
> +  if ((Status == EFI_ALREADY_STARTED ) && (Snp->Mode->State ==
> + EfiSimpleNetworkInitialized)) {
>
> +  return EFI_SUCCESS;
>
> +  }
>
>if (!EFI_ERROR (Status)) {
>
>  //
>
>  // Initialize the simple network.
>

The commit message does say this is a workaround, and I don't immediately any 
see why this workaround (in the code) would be problematic in practice, but it 
still leaves a bad taste in my mouth.

Consider: the call path is the following:

MnpConfigure()   [NetworkPkg/MnpDxe/MnpConfig.c] -- public .Configure() 
protocol member function
  MnpConfigureInstance() [NetworkPkg/MnpDxe/MnpConfig.c]
MnpStart()   [NetworkPkg/MnpDxe/MnpConfig.c]
  // see notes!
  MnpStartSnp()  [NetworkPkg/MnpDxe/MnpConfig.c]

Notes: the MnpStartSnp() call in MnpStart() is conditional on two circumstances 
(at the same time):
- "If it's not a configuration update, increase the configured children number."
- "It's the first configured child, start the simple network."

In other words, the MNP driver has just bound SNP "BY_DRIVER" (i.e., 
exclusively), installed the MNP service binding protocol for each vlan (IIUC), 
and one of those SB instances is now being used to create the first MNP 
instance. I think that under these circumstances, it is reasonable for the MNP 
driver to expect that the underlying SNP be in stopped state. :/

How long would NetworkPkg have to carry this workaround? (I.e., how long before 
the grub issue is fixed, and the buggy version deprecated?)

I'd prefer at least a comment in the code that the return path is a workaround 
for (I feel) an earlier SNP usage violation.

A FeaturePCD to disable the workaround could be reasonable too (but the 
NetworkPkg maintainers could disagree about that).


BTW, the commit message should be wrapped at 75 characters. These long lines 
(in the body) will pass PatchCheck, but generate warnings. Those warnings are 
tolerable for log quotes, URLs, etc, but for normal English text, wrapping 

Re: [edk2-devel] Clarification on LoadFile2 Protocol Installation for Network Boot Devices

2023-12-20 Thread Sivaraman Nainar via groups.io
Hi Saloni:

I will try to file a Mantis with these details and update you.

Thanks
Siva
From: Natalya Kalistratova 
Sent: Thursday, December 21, 2023 4:04 AM
To: Kasbekar, Saloni ; Sivaraman Nainar 
; devel@edk2.groups.io; Clark-williams, Zachary 

Cc: Dhanaraj V ; Santhosh Kumar V ; 
GengYou Zhou (周庚佑) ; Triveni H ; 
Vairalakshmi M 
Subject: RE: [EXTERNAL] RE: Clarification on LoadFile2 Protocol Installation 
for Network Boot Devices

Including Triveni and Vairalakshmi to this thread

From: Kasbekar, Saloni 
mailto:saloni.kasbe...@intel.com>>
Sent: Tuesday, December 19, 2023 10:46 PM
To: Sivaraman Nainar mailto:sivaram...@ami.com>>; 
devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary 
mailto:zachary.clark-willi...@intel.com>>
Cc: Natalya Kalistratova mailto:natal...@ami.com>>; Dhanaraj 
V mailto:vdhana...@ami.com>>; Santhosh Kumar V 
mailto:santhoshkum...@ami.com>>; GengYou Zhou (周庚佑) 
mailto:gengyouz...@ami.com>>
Subject: RE: [EXTERNAL] RE: Clarification on LoadFile2 Protocol Installation 
for Network Boot Devices

Hi Siva,

We can file a Mantis for the UEFI forum with the proposal to update the wording 
for #18 to include Network devices.

Thanks,
Saloni

From: Sivaraman Nainar mailto:sivaram...@ami.com>>
Sent: Monday, December 18, 2023 10:54 PM
To: Kasbekar, Saloni 
mailto:saloni.kasbe...@intel.com>>; 
devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary 
mailto:zachary.clark-willi...@intel.com>>
Cc: Natalya Kalistratova mailto:natal...@ami.com>>; Dhanaraj 
V mailto:vdhana...@ami.com>>; Santhosh Kumar V 
mailto:santhoshkum...@ami.com>>; GengYou Zhou (周庚佑) 
mailto:gengyouz...@ami.com>>
Subject: RE: [EXTERNAL] RE: Clarification on LoadFile2 Protocol Installation 
for Network Boot Devices

Hello Saloni:

Thanks for Clarifying.

Yes. If Network Devices MUST install LoadFile2 then it would be good that 
section 18 includes network devices. Do we need to request UEFI forum for the 
same?

Thanks
Siva
From: Kasbekar, Saloni 
mailto:saloni.kasbe...@intel.com>>
Sent: Tuesday, December 19, 2023 1:41 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Sivaraman Nainar 
mailto:sivaram...@ami.com>>; Clark-williams, Zachary 
mailto:zachary.clark-willi...@intel.com>>
Cc: Natalya Kalistratova mailto:natal...@ami.com>>; Dhanaraj 
V mailto:vdhana...@ami.com>>; Santhosh Kumar V 
mailto:santhoshkum...@ami.com>>; GengYou Zhou (周庚佑) 
mailto:gengyouz...@ami.com>>
Subject: [EXTERNAL] RE: Clarification on LoadFile2 Protocol Installation for 
Network Boot Devices


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**
Hi Siva,

“The EFI_LOAD_FILE2_PROTOCOL is a simple protocol used to obtain files from 
arbitrary devices that are not boot
options”
“The EFI_LOAD_FILE_PROTOCOL is used for devices that do not directly support 
file systems. Network devices
commonly boot in this model where the image is materialized without the need of 
a file system.”

Based on the above statements, I believe the Network stack is fine using the 
current EFI_LOAD_FILE_PROTOCOL and not the EFI_LOAD_FILE2_PROTOCOL as they are 
currently loaded as boot options. We currently do install the 
EFI_LOAD_FILE_PROTOCOL within the Network stack. Eg -
  //
  // Create a child handle for the HTTP boot and install DevPath and Load file 
protocol on it.
  //
  CopyMem (&Private->Ip6Nic->LoadFile, &gHttpBootDxeLoadFile, sizeof 
(Private->LoadFile));
  Status = gBS->InstallMultipleProtocolInterfaces (
  &Private->Ip6Nic->Controller,
  &gEfiLoadFileProtocolGuid,
  &Private->Ip6Nic->LoadFile,
  &gEfiDevicePathProtocolGuid,
  Private->Ip6Nic->DevicePath,
  NULL
          );

Maybe we need to update #18 to include Network devices?

Thanks,
Saloni

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> On Behalf Of Sivaraman 
Nainar via groups.io
Sent: Friday, December 15, 2023 3:29 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary 
mailto:zachary.clark-willi...@intel.com>>; 
Kasbekar, Saloni mailto:saloni.kasbe...@intel.com>>
Cc: Natalya Kalistratova mailto:natal...@ami.com>>; Dhanaraj 
V mailto:vdhana...@ami.com>>; Santhosh Kumar V 
mailto:santhoshkum...@ami.com>>; GengYou Zhou (周庚佑) 
mailto:gengyouz...@ami.com>>
Subject: [edk2-devel] reg: Clarification on LoadFile2 Protocol Installation for 
Network Boot Devices

Hello ZClarkWilliams:

Could you please help to clarify if NetworkStack MUST install the LoadFile2 
Protocol or not. With reference to the below spec item, the LoadFile2 protocol 
must be implemented

Re: [edk2-devel] Clarification on LoadFile2 Protocol Installation for Network Boot Devices

2023-12-18 Thread Sivaraman Nainar via groups.io
Hello Saloni:

Thanks for Clarifying.

Yes. If Network Devices MUST install LoadFile2 then it would be good that 
section 18 includes network devices. Do we need to request UEFI forum for the 
same?

Thanks
Siva
From: Kasbekar, Saloni 
Sent: Tuesday, December 19, 2023 1:41 AM
To: devel@edk2.groups.io; Sivaraman Nainar ; 
Clark-williams, Zachary 
Cc: Natalya Kalistratova ; Dhanaraj V ; 
Santhosh Kumar V ; GengYou Zhou (周庚佑) 

Subject: [EXTERNAL] RE: Clarification on LoadFile2 Protocol Installation for 
Network Boot Devices


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**
Hi Siva,

“The EFI_LOAD_FILE2_PROTOCOL is a simple protocol used to obtain files from 
arbitrary devices that are not boot
options”
“The EFI_LOAD_FILE_PROTOCOL is used for devices that do not directly support 
file systems. Network devices
commonly boot in this model where the image is materialized without the need of 
a file system.”

Based on the above statements, I believe the Network stack is fine using the 
current EFI_LOAD_FILE_PROTOCOL and not the EFI_LOAD_FILE2_PROTOCOL as they are 
currently loaded as boot options. We currently do install the 
EFI_LOAD_FILE_PROTOCOL within the Network stack. Eg -
  //
  // Create a child handle for the HTTP boot and install DevPath and Load file 
protocol on it.
  //
  CopyMem (&Private->Ip6Nic->LoadFile, &gHttpBootDxeLoadFile, sizeof 
(Private->LoadFile));
  Status = gBS->InstallMultipleProtocolInterfaces (
  &Private->Ip6Nic->Controller,
  &gEfiLoadFileProtocolGuid,
  &Private->Ip6Nic->LoadFile,
  &gEfiDevicePathProtocolGuid,
  Private->Ip6Nic->DevicePath,
  NULL
  );

Maybe we need to update #18 to include Network devices?

Thanks,
Saloni

From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> 
mailto:devel@edk2.groups.io>> On Behalf Of Sivaraman 
Nainar via groups.io
Sent: Friday, December 15, 2023 3:29 AM
To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Clark-williams, Zachary 
mailto:zachary.clark-willi...@intel.com>>; 
Kasbekar, Saloni mailto:saloni.kasbe...@intel.com>>
Cc: Natalya Kalistratova mailto:natal...@ami.com>>; Dhanaraj 
V mailto:vdhana...@ami.com>>; Santhosh Kumar V 
mailto:santhoshkum...@ami.com>>; GengYou Zhou (周庚佑) 
mailto:gengyouz...@ami.com>>
Subject: [edk2-devel] reg: Clarification on LoadFile2 Protocol Installation for 
Network Boot Devices

Hello ZClarkWilliams:

Could you please help to clarify if NetworkStack MUST install the LoadFile2 
Protocol or not. With reference to the below spec item, the LoadFile2 protocol 
must be implemented.

In one of the BIOS environment, the Setup Browser Locates the LoadFile2 
instance of Network Boot Device and it not found as it not installed by the 
current NetworkPkg.

Can you please comment if there is any reason behind not installing during the 
HTTP Boot.
“UEFI SPEC
2.6.3 Driver-Specific Elements There are a number of UEFI elements that can be 
added or removed depending on the features that a specific driver requires. 
Drivers can be implemented by platform firmware developers to support buses and 
devices in a specific platform. Drivers can also be implemented by add-in card 
vendors for devices that might be integrated into the platform hardware or 
added to a platform through an expansion slot. The following list includes 
possible driver features, and the UEFI elements that are required for each 
feature type:

  1.  If a driver is written for a boot device that is not a block-oriented 
device, a file system-based device, or a console device, then the 
EFI_LOAD_FILE2_PROTOCOL must be implemented.
“

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.

-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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Lin

[edk2-devel] reg: Clarification on LoadFile2 Protocol Installation for Network Boot Devices

2023-12-15 Thread Sivaraman Nainar via groups.io
Hello ZClarkWilliams:

Could you please help to clarify if NetworkStack MUST install the LoadFile2 
Protocol or not. With reference to the below spec item, the LoadFile2 protocol 
must be implemented.

In one of the BIOS environment, the Setup Browser Locates the LoadFile2 
instance of Network Boot Device and it not found as it not installed by the 
current NetworkPkg.

Can you please comment if there is any reason behind not installing during the 
HTTP Boot.
“UEFI SPEC
2.6.3 Driver-Specific Elements There are a number of UEFI elements that can be 
added or removed depending on the features that a specific driver requires. 
Drivers can be implemented by platform firmware developers to support buses and 
devices in a specific platform. Drivers can also be implemented by add-in card 
vendors for devices that might be integrated into the platform hardware or 
added to a platform through an expansion slot. The following list includes 
possible driver features, and the UEFI elements that are required for each 
feature type:

  1.  If a driver is written for a boot device that is not a block-oriented 
device, a file system-based device, or a console device, then the 
EFI_LOAD_FILE2_PROTOCOL must be implemented.
“

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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#112601): https://edk2.groups.io/g/devel/message/112601
Mute This Topic: https://groups.io/mt/103188580/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] reg: Two IAID assignment for single MAC Address

2023-10-03 Thread Sivaraman Nainar via groups.io
+ Saloni and Zachary.

From: Sivaraman Nainar
Sent: Tuesday, October 3, 2023 10:39 PM
To: devel@edk2.groups.io; Maciej Rabeda 
Cc: Santhosh Kumar V ; Mike Su (蘇得緣) ; 
Dhanaraj V 
Subject: reg: Two IAID assignment for single MAC Address

Hello Maciej:

When IPV6 PXE Boot performed in the environment where client and server are 
connected behind Routers, there are two SARR process happens, and both are 
using different IAID’s.

During the PXE Boot IPV6, SARR Process Initiated to get the Boot File 
information. During that time one IAID Created (ff76fdbd). 
PxeBcCreateIp6Children()
During the Router Advertisement , SARR Process Initiated to get the Boot File. 
Ip6ConfigInitInstance()

Besides, according to the definition of 
IA(RFC-3315):

An "identity-association" (IA) is a construct through which a server
and a client can identify, group, and manage a set of related IPv6
addresses. Each IA consists of an IAID and associated configuration
information.

A client must associate at least one distinct IA with each of its
network interfaces for which it is to request the assignment of IPv6
addresses from a DHCP server. The client uses the IAs assigned to an
interface to obtain configuration information from a server for that
interface. Each IA must be associated with exactly one interface.

But as per EDK2 Network Implementation it defines two IA IDs for same client.  
Is there any reasoning behind this implementation?

What if both the process uses Same IAID?

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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109299): https://edk2.groups.io/g/devel/message/109299
Mute This Topic: https://groups.io/mt/101738223/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] reg: Two IAID assignment for single MAC Address

2023-10-03 Thread Sivaraman Nainar via groups.io
Hello Maciej:

When IPV6 PXE Boot performed in the environment where client and server are 
connected behind Routers, there are two SARR process happens, and both are 
using different IAID’s.

During the PXE Boot IPV6, SARR Process Initiated to get the Boot File 
information. During that time one IAID Created (ff76fdbd). 
PxeBcCreateIp6Children()
During the Router Advertisement , SARR Process Initiated to get the Boot File. 
Ip6ConfigInitInstance()

Besides, according to the definition of 
IA(RFC-3315):

An "identity-association" (IA) is a construct through which a server
and a client can identify, group, and manage a set of related IPv6
addresses. Each IA consists of an IAID and associated configuration
information.

A client must associate at least one distinct IA with each of its
network interfaces for which it is to request the assignment of IPv6
addresses from a DHCP server. The client uses the IAs assigned to an
interface to obtain configuration information from a server for that
interface. Each IA must be associated with exactly one interface.

But as per EDK2 Network Implementation it defines two IA IDs for same client.  
Is there any reasoning behind this implementation?

What if both the process uses Same IAID?

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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109296): https://edk2.groups.io/g/devel/message/109296
Mute This Topic: https://groups.io/mt/101738223/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] reg: HTTP Boot failure

2023-07-28 Thread Sivaraman Nainar via groups.io
Hello:

In the environment of PXE and Http server setup configured in same Linux 
machine HTTP Boot is gettin failed. If the PXE Server and HTTP Server 
configured in two different machines then the boot is fine.


Failure Test case:

1.Select PXE IPv4/6 to boot

2.Booted into Grub Boot loader File successfully, then exit back to setup from 
grub boot loader

3.select HTTP IPv4/6 to boot -> HTTP boot FAIL



Root Cause: When Pxe boot is successfully booted to grub, All network drivers 
are stopped,

And when we select Http Boot , All network drivers are getting started again, 
but Dhcp->start interface is failed with EFI_NO_MAPPING



As EFI_NO_MAPPING is reported from Dhcp->start ,we have suspected link local is 
not updated properly. Hence added few seconds delay before starting http boot 
and Http Boot is working properly.



Pass test case:

Select HTTP IPv4/6 to boot into Grub boot loader file, then exit back to setup 
from grub boot loader console

then -> select PXE IPv4/6 to boot -> PXE can boot PASS



When http boot is successfully booted to grub, Network Driver are not stopped.  
Since the drivers are not stopped,  when we select Pxe Boot it is working as 
all network drivers configured the instance properly.



For this test case #1 is there any recommendation to address the issue 
generically without havin hardcoded delay before HTTP Boot?


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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#107374): https://edk2.groups.io/g/devel/message/107374
Mute This Topic: https://groups.io/mt/100407101/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] reg: Load File 2 Protocol

2023-06-01 Thread Sivaraman Nainar via groups.io
Hello Maciej:

This is regarding an inquiry about usage of Load File 2 Protocol in HTTP Boot. 
From the  UEFI Specification refence below the driver supposed to install Load 
File 2 Protocol to get the HTTP boot file loaded. The HTTPBootDxe driver 
installs the Load File protocol only.

2.6.3 Driver-Specific Elements There are a number of UEFI elements that can be 
added or removed depending on the features that a specific driver requires. 
Drivers can be implemented by platform firmware developers to support buses and 
devices in a specific platform. Drivers can also be implemented by add-in card 
vendors for devices that might be integrated into the platform hardware or 
added to a platform through an expansion slot. The following list includes 
possible driver features, and the UEFI elements that are required for each 
feature type:

  1.  If a driver is written for a boot device that is not a block-oriented 
device, a file system-based device, or a console device, then the 
EFI_LOAD_FILE2_PROTOCOL must be implemented.
Do you think the driver should install Load File 2 Protocol also? May you 
please comment on the above recommendation from UEFI Spec to install Load File2 
protocol.

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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105612): https://edk2.groups.io/g/devel/message/105612
Mute This Topic: https://groups.io/mt/99279060/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] reg: MAC address could not change on pre-boot environment and failed to PXE boot.

2023-06-01 Thread Sivaraman Nainar via groups.io
Hello Erich / Maciej:

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

Thank you
Siva
From: erichmcm...@gmail.com
Sent: Friday, March 24, 2023 10:06 AM
To: Sivaraman Nainar; 
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)
 *   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)

*   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)
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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#105611): https://edk2.groups.io/g/devel/message/105611
Mute This Topic: https://groups.io/mt/97817537/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] reg: MAC address could not change on pre-boot environment and failed to PXE boot.

2023-03-23 Thread Sivaraman Nainar via groups.io
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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#101722): https://edk2.groups.io/g/devel/message/101722
Mute This Topic: https://groups.io/mt/97817537/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] How to restrict HTTPS boot to a single address

2022-08-28 Thread Sivaraman Nainar via groups.io
Hello Rafael.

HttpBootCheckUriScheme() in HttpBootDxe\HttpBootSupport.c should be the right 
place to filter the URI.

Please give a try.

-Siva
From: devel@edk2.groups.io  On Behalf Of Rafael Machado 
via groups.io
Sent: Friday, August 26, 2022 7:46 PM
To: devel@edk2.groups.io
Subject: [EXTERNAL] [edk2-devel] How to restrict HTTPS boot to a single address


**CAUTION: The e-mail below is from an external source. Please exercise caution 
before opening attachments, clicking links, or following guidance.**
Hello everyone.

Quick question for the ones that understand better the HTTPBoot architecture at 
the edk2 structure.

Suppose I have to restrict HTTPS boot to accept only the download of images 
from a specific url.
For example, instead of allowing the download of images from any valid CA 
certificate address, I would like to restrict HTTPSBoot to allow only downloads 
from some specific domain I have.

Probably filtering some information, CN or something like that, from the url 
certificate.

What is the best way to do that?
In which driver/library should this logic be added?

Thanks
Rafael

-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.


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#92895): https://edk2.groups.io/g/devel/message/92895
Mute This Topic: https://groups.io/mt/93270616/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH 1/2] NetworkPkg:UEFIPXEBC

2021-12-30 Thread Sivaraman Nainar via groups.io
From: "INDIA\\sivaramann" 

Issue on the PxeBcDhcp4CallBack() functions of UEFIPXEBC Driver.
In this function any non allowed events are recieved as input it
will exit in beginning itself. But the switch case handling the
default and Dhcp4SendRequest which is not reachable.

Signed-off-by: Sivaraman 
---
 NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c | 12 ++--
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c 
b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
index fb63cf61a9..e85176f9bb 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDhcp4.c
@@ -1256,19 +1256,10 @@ PxeBcDhcp4CallBack (
 

 //

 // Cache the DHCPv4 discover packet to mode data directly.

-// It need to check SendGuid as well as Dhcp4SendRequest.

+// It need to check SendGuid.

 //

 CopyMem (&Mode->DhcpDiscover.Dhcpv4, &Packet->Dhcp4, Packet->Length);

 

-  case Dhcp4SendRequest:

-if (Packet->Length > PXEBC_DHCP4_PACKET_MAX_SIZE) {

-  //

-  // If the to be sent packet exceeds the maximum length, abort the DHCP 
process.

-  //

-  Status = EFI_ABORTED;

-  break;

-}

-

 if (Mode->SendGUID) {

   //

   // Send the system Guid instead of the MAC address as the hardware 
address if required.

@@ -1332,6 +1323,7 @@ PxeBcDhcp4CallBack (
 break;

 

   default:

+ASSERT (FALSE);

 break;

   }

 

-- 
2.28.0.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#85236): https://edk2.groups.io/g/devel/message/85236
Mute This Topic: https://groups.io/mt/88031471/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-