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.
From a0a5be31a3c13e58dcef6f636041d528ed633ae9 Mon Sep 17 00:00:00 2001
From: Olivier Martin <olivier.mar...@arm.com>
Date: Thu, 10 Jan 2013 11:43:23 +0000
Subject: [PATCH 1/2] MdeModulePkg/ArpDxe: 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().
---
MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c | 33 +++++++++++----------
1 files changed, 17 insertions(+), 16 deletions(-)
mode change 100644 => 100755 MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
diff --git a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
old mode 100644
new mode 100755
index 81ddd62..0c15725
--- a/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
+++ b/MdeModulePkg/Universal/Network/ArpDxe/ArpDriver.c
@@ -103,22 +103,6 @@ ArpCreateService (
}
//
- // Get the underlayer Snp mode data.
- //
- Status = ArpService->Mnp->GetModeData (ArpService->Mnp, NULL, &ArpService->SnpMode);
- if ((Status != EFI_NOT_STARTED) && EFI_ERROR (Status)) {
- goto ERROR_EXIT;
- }
-
- if (ArpService->SnpMode.IfType != NET_IFTYPE_ETHERNET) {
- //
- // Only support the ethernet.
- //
- Status = EFI_UNSUPPORTED;
- goto ERROR_EXIT;
- }
-
- //
// Set the Mnp config parameters.
//
ArpService->MnpConfigData.ReceivedQueueTimeoutValue = 0;
@@ -141,6 +125,23 @@ ArpCreateService (
}
//
+ // Get the underlayer Snp mode data. Must do this after MNP configuration else some parameters
+ // (e.g. current address) may not be set
+ //
+ Status = ArpService->Mnp->GetModeData (ArpService->Mnp, NULL, &ArpService->SnpMode);
+ if ((Status != EFI_NOT_STARTED) && EFI_ERROR (Status)) {
+ goto ERROR_EXIT;
+ }
+
+ if (ArpService->SnpMode.IfType != NET_IFTYPE_ETHERNET) {
+ //
+ // Only support the ethernet.
+ //
+ Status = EFI_UNSUPPORTED;
+ goto ERROR_EXIT;
+ }
+
+ //
// Create the event used in the RxToken.
//
Status = gBS->CreateEvent (
--
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