public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] MdeModulePkg/SNP: remove redundant DEBUG print in SNP Transmit.c
@ 2017-11-15  3:14 Fu Siyuan
  2017-11-15  5:55 ` Wu, Jiaxin
  2017-11-15  7:15 ` Ye, Ting
  0 siblings, 2 replies; 3+ messages in thread
From: Fu Siyuan @ 2017-11-15  3:14 UTC (permalink / raw)
  To: edk2-devel; +Cc: Wu Jiaxin, Ye Ting

This patch is to remove some redundant DEBUG output in SNP transmit function.
In case of return EFI_NOT_READY in PxeTransmit, the SNP driver is indicate
the caller that the transmit queue is full, it's a very common situation druing
transmit, not a critical error. So the patch move the DEBUG lever to EFI_D_NET.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
---
 MdeModulePkg/Universal/Network/SnpDxe/Transmit.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
index 73461bc..2c7083e 100644
--- a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
+++ b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
@@ -1,7 +1,7 @@
 /** @file
     Implementation of transmitting a packet.
  
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials are licensed 
 and made available under the terms and conditions of the BSD License which 
 accompanies this distribution. The full text of the license may be found at 
@@ -186,7 +186,6 @@ PxeTransmit (
   (*Snp->IssueUndi32Command) ((UINT64) (UINTN) &Snp->Cdb);
 
   DEBUG ((EFI_D_NET, "\nexit Snp->undi.transmit()  "));
-  DEBUG ((EFI_D_NET, "\nSnp->Cdb.StatCode == %r", Snp->Cdb.StatCode));
 
   //
   // we will unmap the buffers in get_status call, not here
@@ -199,19 +198,24 @@ PxeTransmit (
   case PXE_STATCODE_QUEUE_FULL:
   case PXE_STATCODE_BUSY:
     Status = EFI_NOT_READY;
+    DEBUG (
+      (EFI_D_NET,
+      "\nSnp->undi.transmit()  %xh:%xh\n",
+      Snp->Cdb.StatFlags,
+      Snp->Cdb.StatCode)
+      );
     break;
 
   default:
+    DEBUG (
+      (EFI_D_ERROR,
+      "\nSnp->undi.transmit()  %xh:%xh\n",
+      Snp->Cdb.StatFlags,
+      Snp->Cdb.StatCode)
+      );
     Status = EFI_DEVICE_ERROR;
   }
 
-  DEBUG (
-    (EFI_D_ERROR,
-    "\nSnp->undi.transmit()  %xh:%xh\n",
-    Snp->Cdb.StatFlags,
-    Snp->Cdb.StatCode)
-    );
-
   return Status;
 }
 
-- 
1.9.5.msysgit.1



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

* Re: [Patch] MdeModulePkg/SNP: remove redundant DEBUG print in SNP Transmit.c
  2017-11-15  3:14 [Patch] MdeModulePkg/SNP: remove redundant DEBUG print in SNP Transmit.c Fu Siyuan
@ 2017-11-15  5:55 ` Wu, Jiaxin
  2017-11-15  7:15 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Wu, Jiaxin @ 2017-11-15  5:55 UTC (permalink / raw)
  To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Ye, Ting

Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>


> -----Original Message-----
> From: Fu, Siyuan
> Sent: Wednesday, November 15, 2017 11:15 AM
> To: edk2-devel@lists.01.org
> Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Ye, Ting <ting.ye@intel.com>
> Subject: [Patch] MdeModulePkg/SNP: remove redundant DEBUG print in
> SNP Transmit.c
> 
> This patch is to remove some redundant DEBUG output in SNP transmit
> function.
> In case of return EFI_NOT_READY in PxeTransmit, the SNP driver is indicate
> the caller that the transmit queue is full, it's a very common situation druing
> transmit, not a critical error. So the patch move the DEBUG lever to
> EFI_D_NET.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Cc: Ye Ting <ting.ye@intel.com>
> ---
>  MdeModulePkg/Universal/Network/SnpDxe/Transmit.c | 22
> +++++++++++++---------
>  1 file changed, 13 insertions(+), 9 deletions(-)
> 
> diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
> b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
> index 73461bc..2c7083e 100644
> --- a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
> +++ b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
> @@ -1,7 +1,7 @@
>  /** @file
>      Implementation of transmitting a packet.
> 
> -Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
>  This program and the accompanying materials are licensed
>  and made available under the terms and conditions of the BSD License which
>  accompanies this distribution. The full text of the license may be found at
> @@ -186,7 +186,6 @@ PxeTransmit (
>    (*Snp->IssueUndi32Command) ((UINT64) (UINTN) &Snp->Cdb);
> 
>    DEBUG ((EFI_D_NET, "\nexit Snp->undi.transmit()  "));
> -  DEBUG ((EFI_D_NET, "\nSnp->Cdb.StatCode == %r", Snp->Cdb.StatCode));
> 
>    //
>    // we will unmap the buffers in get_status call, not here
> @@ -199,19 +198,24 @@ PxeTransmit (
>    case PXE_STATCODE_QUEUE_FULL:
>    case PXE_STATCODE_BUSY:
>      Status = EFI_NOT_READY;
> +    DEBUG (
> +      (EFI_D_NET,
> +      "\nSnp->undi.transmit()  %xh:%xh\n",
> +      Snp->Cdb.StatFlags,
> +      Snp->Cdb.StatCode)
> +      );
>      break;
> 
>    default:
> +    DEBUG (
> +      (EFI_D_ERROR,
> +      "\nSnp->undi.transmit()  %xh:%xh\n",
> +      Snp->Cdb.StatFlags,
> +      Snp->Cdb.StatCode)
> +      );
>      Status = EFI_DEVICE_ERROR;
>    }
> 
> -  DEBUG (
> -    (EFI_D_ERROR,
> -    "\nSnp->undi.transmit()  %xh:%xh\n",
> -    Snp->Cdb.StatFlags,
> -    Snp->Cdb.StatCode)
> -    );
> -
>    return Status;
>  }
> 
> --
> 1.9.5.msysgit.1



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

* Re: [Patch] MdeModulePkg/SNP: remove redundant DEBUG print in SNP Transmit.c
  2017-11-15  3:14 [Patch] MdeModulePkg/SNP: remove redundant DEBUG print in SNP Transmit.c Fu Siyuan
  2017-11-15  5:55 ` Wu, Jiaxin
@ 2017-11-15  7:15 ` Ye, Ting
  1 sibling, 0 replies; 3+ messages in thread
From: Ye, Ting @ 2017-11-15  7:15 UTC (permalink / raw)
  To: Fu, Siyuan, edk2-devel@lists.01.org; +Cc: Wu, Jiaxin

Reviewed-by: Ye Ting <ting.ye@intel.com> 

-----Original Message-----
From: Fu, Siyuan 
Sent: Wednesday, November 15, 2017 11:15 AM
To: edk2-devel@lists.01.org
Cc: Wu, Jiaxin <jiaxin.wu@intel.com>; Ye, Ting <ting.ye@intel.com>
Subject: [Patch] MdeModulePkg/SNP: remove redundant DEBUG print in SNP Transmit.c

This patch is to remove some redundant DEBUG output in SNP transmit function.
In case of return EFI_NOT_READY in PxeTransmit, the SNP driver is indicate the caller that the transmit queue is full, it's a very common situation druing transmit, not a critical error. So the patch move the DEBUG lever to EFI_D_NET.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
---
 MdeModulePkg/Universal/Network/SnpDxe/Transmit.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
index 73461bc..2c7083e 100644
--- a/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
+++ b/MdeModulePkg/Universal/Network/SnpDxe/Transmit.c
@@ -1,7 +1,7 @@
 /** @file
     Implementation of transmitting a packet.
  
-Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>
 This program and the accompanying materials are licensed  and made available under the terms and conditions of the BSD License which  accompanies this distribution. The full text of the license may be found at @@ -186,7 +186,6 @@ PxeTransmit (
   (*Snp->IssueUndi32Command) ((UINT64) (UINTN) &Snp->Cdb);
 
   DEBUG ((EFI_D_NET, "\nexit Snp->undi.transmit()  "));
-  DEBUG ((EFI_D_NET, "\nSnp->Cdb.StatCode == %r", Snp->Cdb.StatCode));
 
   //
   // we will unmap the buffers in get_status call, not here @@ -199,19 +198,24 @@ PxeTransmit (
   case PXE_STATCODE_QUEUE_FULL:
   case PXE_STATCODE_BUSY:
     Status = EFI_NOT_READY;
+    DEBUG (
+      (EFI_D_NET,
+      "\nSnp->undi.transmit()  %xh:%xh\n",
+      Snp->Cdb.StatFlags,
+      Snp->Cdb.StatCode)
+      );
     break;
 
   default:
+    DEBUG (
+      (EFI_D_ERROR,
+      "\nSnp->undi.transmit()  %xh:%xh\n",
+      Snp->Cdb.StatFlags,
+      Snp->Cdb.StatCode)
+      );
     Status = EFI_DEVICE_ERROR;
   }
 
-  DEBUG (
-    (EFI_D_ERROR,
-    "\nSnp->undi.transmit()  %xh:%xh\n",
-    Snp->Cdb.StatFlags,
-    Snp->Cdb.StatCode)
-    );
-
   return Status;
 }
 
--
1.9.5.msysgit.1



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

end of thread, other threads:[~2017-11-15  7:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-15  3:14 [Patch] MdeModulePkg/SNP: remove redundant DEBUG print in SNP Transmit.c Fu Siyuan
2017-11-15  5:55 ` Wu, Jiaxin
2017-11-15  7:15 ` Ye, Ting

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