Sorry, I sent the old patch. Here is the new one.
________________________________________
From: Olivier Martin [olivier.mar...@arm.com]
Sent: 19 July 2013 20:00
To: edk2-devel@lists.sourceforge.net; Tian, Feng
Subject: Re: [edk2] [PATCH] MdeModulePkg/ArpDxe: Retrieved SnpMode only after   
configuring Snp

Ting,
here is a new patch that fixes the issue I have. Here is the details of this 
new fix:

    MdeModulePkg/ArpDxe: Retrieve a copy of SnpMode after SNP has been 
configured

    Before ARP configures its MNP child it gets a copy of SnpMode.
    If it is the first configured MNP child then SNP is also initialized.
    It may only be at this time the MAC address of the network card be valid 
(ie:
    the initial copy of SnpMode would contain an invalid/null MAC address).

    Contributed-under: TianoCore Contribution Agreement 1.0
    Signed-off-by: Olivier Martin <olivier.mar...@arm.com>

Best Regards,
Olivier
________________________________________
From: Ye, Ting [ting...@intel.com]
Sent: 30 January 2013 07:40
To: edk2-devel@lists.sourceforge.net; Tian, Feng
Subject: Re: [edk2] [PATCH] MdeModulePkg/ArpDxe: Retrieved SnpMode only after   
configuring Snp

Olivier,

Thanks for your patch. Though I don’t quite agree with you that SnpMode cannot 
be accessed prior to SNP is configured.

As I known some parameters in SnpMode will be initialized in 
SimpleNetworkDriverStart() by calling undi.GetInitInfo. These parameters will 
not be updated by other APIs in SNP protocol including SNP->initialize. One of 
these parameters is ‘IfType’ used in ARP driver from your patch. Thus I think 
it makes sense that upper layer driver uses this kind of info prior to 
configure SNP to save performance lost in some conditions.

Best Regards,
Ting

From: Olivier Martin [mailto:olivier.mar...@arm.com]
Sent: Friday, January 25, 2013 9:07 PM
To: Tian, Feng
Cc: edk2-devel@lists.sourceforge.net
Subject: [edk2] [PATCH] MdeModulePkg/ArpDxe: Retrieved SnpMode only after 
configuring Snp

Dear MdeModulePkg maintainer,
Please find the attached patch that retrieved SnpMode only after configuring 
Snp.

When Arp driver starts (with ArpDriverBindingStart()), its service will be 
created
and the Mnp child configured (ArpService->Mnp->Configure() called in 
ArpCreateService()).

It is only at this time the Snp protocol will be initialized (at the end of 
MnpStart()).
So, a valid SnpMode could not be expected prior to ArpService->Mnp->Configure().

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin 
<olivier.mar...@arm.com<mailto:olivier.mar...@arm.com>>

Best Regards,
Olivier

-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium.  Thank you.

-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium.  Thank you.
From 1e1c2a3b3b7008be0587e79f0edbad339a366b88 Mon Sep 17 00:00:00 2001
From: Olivier Martin <olivier.mar...@arm.com>
Date: Fri, 19 Jul 2013 19:54:32 +0100
Subject: [PATCH 2/2] MdeModulePkg/ArpDxe: Retrieve a copy of SnpMode after
 SNP has been configured

Before ARP configures its MNP child it gets a copy of SnpMode.
If it is the first configured MNP child then SNP is also initialized.
It may only be at this time the MAC address of the network card be valid (ie:
the initial copy of SnpMode would contain an invalid/null MAC address).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.mar...@arm.com>
---
 MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
index 81ddd62..c0cd677 100644
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
+++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
@@ -140,6 +140,12 @@ ArpCreateService (
     goto ERROR_EXIT;
   }
 
+  // Retrieve the latest SnpMode after Snp has been configured
+  Status = ArpService->Mnp->GetModeData (ArpService->Mnp, NULL, &ArpService->SnpMode);
+  if ((Status != EFI_NOT_STARTED) && EFI_ERROR (Status)) {
+    goto ERROR_EXIT;
+  }
+
   //
   // Create the event used in the RxToken.
   //
-- 
1.7.5.4

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to