Re: [edk2] [Patch] NetworkPkg: Fix issue in Ip6Dxe SetData

2016-04-12 Thread Hegde, Nagaraj P
Reviewed-by: Hegde Nagaraj P <nagaraj-p.he...@hpe.com>
Tested-by: Hegde Nagaraj P <nagaraj-p.he...@hpe.com>

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of 
Subramanian, Sriram (EG Servers Platform SW)
Sent: Wednesday, April 13, 2016 8:54 AM
To: Jiaxin Wu <jiaxin...@intel.com>; edk2-devel@lists.01.org
Cc: Ye Ting <ting...@intel.com>; Fu Siyuan <siyuan...@intel.com>
Subject: Re: [edk2] [Patch] NetworkPkg: Fix issue in Ip6Dxe SetData

Thanks Jiaxin for the quick fix.

Code looks fine. Reviewed-by: Sriram Subramanian <srira...@hpe.com>

We'll also test it and let you know.

Thanks,
Sriram.

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jiaxin Wu
Sent: Wednesday, April 13, 2016 8:39 AM
To: edk2-devel@lists.01.org
Cc: Ye Ting <ting...@intel.com>; Fu Siyuan <siyuan...@intel.com>
Subject: [edk2] [Patch] NetworkPkg: Fix issue in Ip6Dxe SetData

EFI_NOT_READY should not be treated as an error status returned from SetData 
for Ip6ConfigDataTypeManualAddress since there is an asynchronous operation for 
DAD process.

Cc: Ye Ting <ting...@intel.com>
Cc: Fu Siyuan <siyuan...@intel.com>
Cc: Hegde Nagaraj P <nagaraj-p.he...@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
---
 NetworkPkg/Ip6Dxe/Ip6Driver.c | 72 +--
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c 
index ba70290..16617c1 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
@@ -576,11 +576,11 @@ Ip6DriverBindingStart (
Ip6Cfg,
Ip6ConfigDataTypeManualAddress,
DataItem->DataSize,
DataItem->Data.Ptr
);
-if (EFI_ERROR(Status)) {
+if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
   goto ON_ERROR;
 }
   }
 
   //
@@ -597,50 +597,48 @@ Ip6DriverBindingStart (
 if (EFI_ERROR(Status)) {
   goto ON_ERROR;
 }
   }
 
-  if (!EFI_ERROR (Status)) {
-//
-// ready to go: start the receiving and timer
-//
-Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
-}
+  //
+  // ready to go: start the receiving and timer  //  Status = 
+ Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
 
-//
-// The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds.
-//
-Status = gBS->SetTimer (
-IpSb->FasterTimer,
-TimerPeriodic,
-TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
-);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
-}
+  //
+  // The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds.
+  //
+  Status = gBS->SetTimer (
+  IpSb->FasterTimer,
+  TimerPeriodic,
+  TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
+  );
+  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
 
-//
-// The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds.
-//
-Status = gBS->SetTimer (
-IpSb->Timer,
-TimerPeriodic,
-TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
-);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
-}
+  //
+  // The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds.
+  //
+  Status = gBS->SetTimer (
+  IpSb->Timer,
+  TimerPeriodic,
+  TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
+  );
+  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
 
-//
-// Initialize the IP6 ID
-//
-mIp6Id = NET_RANDOM (NetRandomInitSeed ());
+  //
+  // Initialize the IP6 ID
+  //
+  mIp6Id = NET_RANDOM (NetRandomInitSeed ());
 
-return EFI_SUCCESS;
-  }
+  return EFI_SUCCESS;
 
 ON_ERROR:
   Ip6CleanService (IpSb);
   FreePool (IpSb);
   return Status;
--
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] NetworkPkg: Fix issue in Ip6Dxe SetData

2016-04-12 Thread Subramanian, Sriram (EG Servers Platform SW)
Thanks Jiaxin for the quick fix.

Code looks fine. Reviewed-by: Sriram Subramanian <srira...@hpe.com>

We'll also test it and let you know.

Thanks,
Sriram.

-Original Message-
From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Jiaxin Wu
Sent: Wednesday, April 13, 2016 8:39 AM
To: edk2-devel@lists.01.org
Cc: Ye Ting <ting...@intel.com>; Fu Siyuan <siyuan...@intel.com>
Subject: [edk2] [Patch] NetworkPkg: Fix issue in Ip6Dxe SetData

EFI_NOT_READY should not be treated as an error status
returned from SetData for Ip6ConfigDataTypeManualAddress
since there is an asynchronous operation for DAD process.

Cc: Ye Ting <ting...@intel.com>
Cc: Fu Siyuan <siyuan...@intel.com>
Cc: Hegde Nagaraj P <nagaraj-p.he...@hpe.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin...@intel.com>
---
 NetworkPkg/Ip6Dxe/Ip6Driver.c | 72 +--
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c
index ba70290..16617c1 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
@@ -576,11 +576,11 @@ Ip6DriverBindingStart (
Ip6Cfg,
Ip6ConfigDataTypeManualAddress,
DataItem->DataSize,
DataItem->Data.Ptr
);
-if (EFI_ERROR(Status)) {
+if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
   goto ON_ERROR;
 }
   }
 
   //
@@ -597,50 +597,48 @@ Ip6DriverBindingStart (
 if (EFI_ERROR(Status)) {
   goto ON_ERROR;
 }
   }
 
-  if (!EFI_ERROR (Status)) {
-//
-// ready to go: start the receiving and timer
-//
-Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
-}
+  //
+  // ready to go: start the receiving and timer
+  //
+  Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
+  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
 
-//
-// The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds.
-//
-Status = gBS->SetTimer (
-IpSb->FasterTimer,
-TimerPeriodic,
-TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
-);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
-}
+  //
+  // The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds.
+  //
+  Status = gBS->SetTimer (
+  IpSb->FasterTimer,
+  TimerPeriodic,
+  TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
+  );
+  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
 
-//
-// The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds.
-//
-Status = gBS->SetTimer (
-IpSb->Timer,
-TimerPeriodic,
-TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
-);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
-}
+  //
+  // The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds.
+  //
+  Status = gBS->SetTimer (
+  IpSb->Timer,
+  TimerPeriodic,
+  TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
+  );
+  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
 
-//
-// Initialize the IP6 ID
-//
-mIp6Id = NET_RANDOM (NetRandomInitSeed ());
+  //
+  // Initialize the IP6 ID
+  //
+  mIp6Id = NET_RANDOM (NetRandomInitSeed ());
 
-return EFI_SUCCESS;
-  }
+  return EFI_SUCCESS;
 
 ON_ERROR:
   Ip6CleanService (IpSb);
   FreePool (IpSb);
   return Status;
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [Patch] NetworkPkg: Fix issue in Ip6Dxe SetData

2016-04-12 Thread Jiaxin Wu
EFI_NOT_READY should not be treated as an error status
returned from SetData for Ip6ConfigDataTypeManualAddress
since there is an asynchronous operation for DAD process.

Cc: Ye Ting 
Cc: Fu Siyuan 
Cc: Hegde Nagaraj P 
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu 
---
 NetworkPkg/Ip6Dxe/Ip6Driver.c | 72 +--
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/NetworkPkg/Ip6Dxe/Ip6Driver.c b/NetworkPkg/Ip6Dxe/Ip6Driver.c
index ba70290..16617c1 100644
--- a/NetworkPkg/Ip6Dxe/Ip6Driver.c
+++ b/NetworkPkg/Ip6Dxe/Ip6Driver.c
@@ -576,11 +576,11 @@ Ip6DriverBindingStart (
Ip6Cfg,
Ip6ConfigDataTypeManualAddress,
DataItem->DataSize,
DataItem->Data.Ptr
);
-if (EFI_ERROR(Status)) {
+if (EFI_ERROR(Status) && Status != EFI_NOT_READY) {
   goto ON_ERROR;
 }
   }
 
   //
@@ -597,50 +597,48 @@ Ip6DriverBindingStart (
 if (EFI_ERROR(Status)) {
   goto ON_ERROR;
 }
   }
 
-  if (!EFI_ERROR (Status)) {
-//
-// ready to go: start the receiving and timer
-//
-Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
-}
+  //
+  // ready to go: start the receiving and timer
+  //
+  Status = Ip6ReceiveFrame (Ip6AcceptFrame, IpSb);
+  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
 
-//
-// The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds.
-//
-Status = gBS->SetTimer (
-IpSb->FasterTimer,
-TimerPeriodic,
-TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
-);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
-}
+  //
+  // The timer expires every 100 (IP6_TIMER_INTERVAL_IN_MS) milliseconds.
+  //
+  Status = gBS->SetTimer (
+  IpSb->FasterTimer,
+  TimerPeriodic,
+  TICKS_PER_MS * IP6_TIMER_INTERVAL_IN_MS
+  );
+  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
 
-//
-// The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds.
-//
-Status = gBS->SetTimer (
-IpSb->Timer,
-TimerPeriodic,
-TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
-);
-if (EFI_ERROR (Status)) {
-  goto ON_ERROR;
-}
+  //
+  // The timer expires every 1000 (IP6_ONE_SECOND_IN_MS) milliseconds.
+  //
+  Status = gBS->SetTimer (
+  IpSb->Timer,
+  TimerPeriodic,
+  TICKS_PER_MS * IP6_ONE_SECOND_IN_MS
+  );
+  if (EFI_ERROR (Status)) {
+goto ON_ERROR;
+  }
 
-//
-// Initialize the IP6 ID
-//
-mIp6Id = NET_RANDOM (NetRandomInitSeed ());
+  //
+  // Initialize the IP6 ID
+  //
+  mIp6Id = NET_RANDOM (NetRandomInitSeed ());
 
-return EFI_SUCCESS;
-  }
+  return EFI_SUCCESS;
 
 ON_ERROR:
   Ip6CleanService (IpSb);
   FreePool (IpSb);
   return Status;
-- 
1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel