Tcp driver need to use EFI_D_NET to log DEBUG message,
So it becomes easy to separate/filter out debug messages
from network stack versus generic EFI_D_INFO debugs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zh...@intel.com>
Cc: Hegde Nagaraj P <nagaraj-p.he...@hpe.com>
Cc: Subramanian Sriram <srira...@hpe.com>
Cc: Fu Siyuan <siyuan...@intel.com>
Cc: Ye Ting <ting...@intel.com>
---
 MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c  | 46 +++++++++++-----------
 .../Universal/Network/Tcp4Dxe/SockInterface.c      |  2 +-
 MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c | 32 +++++++--------
 MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c  |  8 ++--
 .../Universal/Network/Tcp4Dxe/Tcp4Output.c         |  6 +--
 5 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c 
b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
index 2e31643..3025790 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
@@ -1,9 +1,9 @@
 /** @file
   Implementation of the Socket.
 
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2016, 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
 http://opensource.org/licenses/bsd-license.php<BR>
 
@@ -31,11 +31,11 @@ UINT32
 SockTcpDataToRcv (
   IN     SOCK_BUFFER    *SockBuffer,
      OUT BOOLEAN        *IsUrg,
   IN     UINT32         BufLen
   );
-  
+
 /**
   Process the send token.
 
   @param  Sock                  Pointer to the socket.
 
@@ -47,11 +47,11 @@ SockProcessSndToken (
 
 /**
   Supporting function for both SockImpl and SockInterface.
 
   @param Event             The Event this notify function registered to, 
ignored.
-  
+
 **/
 VOID
 EFIAPI
 SockFreeFoo (
   IN EFI_EVENT Event
@@ -320,11 +320,11 @@ SockProcessTcpSndData (
 /**
   Flush the tokens in the specific token list.
 
   @param  Sock                  Pointer to the socket.
   @param  PendingTokenList      Pointer to the token list to be flushed.
-  
+
 **/
 VOID
 SockFlushPendingToken (
   IN SOCKET         *Sock,
   IN LIST_ENTRY     *PendingTokenList
@@ -350,11 +350,11 @@ SockFlushPendingToken (
   }
 }
 
 
 /**
-  Wake up the connection token while the connection is successfully 
established, 
+  Wake up the connection token while the connection is successfully 
established,
   then try to process any pending send token.
 
   @param  Sock                  Pointer to the socket.
 
 **/
@@ -411,11 +411,11 @@ SockWakeListenToken (
     FreePool (SockToken);
 
     RemoveEntryList (&Sock->ConnectionList);
 
     Parent->ConnCnt--;
-    DEBUG ((EFI_D_INFO, "SockWakeListenToken: accept a socket, now conncnt is 
%d", Parent->ConnCnt));
+    DEBUG ((EFI_D_NET, "SockWakeListenToken: accept a socket, now conncnt is 
%d", Parent->ConnCnt));
 
     Sock->Parent = NULL;
   }
 }
 
@@ -662,11 +662,11 @@ SockCreate (
     // if the Parent->ConnCnt < Parent->BackLog
     //
     Parent->ConnCnt++;
 
     DEBUG (
-      (EFI_D_INFO,
+      (EFI_D_NET,
       "SockCreate: Create a new socket and add to parent, now conncnt is %d\n",
       Parent->ConnCnt)
       );
 
     InsertTailList (&Parent->ConnectionList, &Sock->ConnectionList);
@@ -751,11 +751,11 @@ SockDestroy (
 
     RemoveEntryList (&(Sock->ConnectionList));
     (Sock->Parent->ConnCnt)--;
 
     DEBUG (
-      (EFI_D_INFO,
+      (EFI_D_NET,
       "SockDestroy: Delete a unaccepted socket from parent"
       "now conncnt is %d\n",
       Sock->Parent->ConnCnt)
       );
 
@@ -931,14 +931,14 @@ SockClone (
   return ClonedSock;
 }
 
 
 /**
-  Called by the low layer protocol to indicate the socket a connection is 
-  established. 
-  
-  This function just changes the socket's state to SO_CONNECTED 
+  Called by the low layer protocol to indicate the socket a connection is
+  established.
+
+  This function just changes the socket's state to SO_CONNECTED
   and signals the token used for connection establishment.
 
   @param  Sock                  Pointer to the socket associated with the
                                 established connection.
 **/
@@ -962,17 +962,17 @@ SockConnEstablished (
 }
 
 
 /**
   Called by the low layer protocol to indicate the connection is closed.
-  
-  This function flushes the socket, sets the state to SO_CLOSED and signals 
+
+  This function flushes the socket, sets the state to SO_CLOSED and signals
   the close token.
 
   @param  Sock                  Pointer to the socket associated with the 
closed
                                 connection.
-                                
+
 **/
 VOID
 SockConnClosed (
   IN OUT SOCKET *Sock
   )
@@ -992,12 +992,12 @@ SockConnClosed (
 }
 
 
 /**
   Called by low layer protocol to indicate that some data is sent or processed.
-   
-  This function trims the sent data in the socket send buffer, signals the 
data 
+
+  This function trims the sent data in the socket send buffer, signals the data
   token if proper.
 
   @param  Sock                  Pointer to the socket.
   @param  Count                 The length of the data processed or sent, in 
bytes.
 
@@ -1082,12 +1082,12 @@ SockGetDataToSend (
 }
 
 
 /**
   Called by the low layer protocol to deliver received data to socket layer.
-  
-  This function will append the data to the socket receive buffer, set ther 
+
+  This function will append the data to the socket receive buffer, set ther
   urgent data length and then check if any receive token can be signaled.
 
   @param  Sock                  Pointer to the socket.
   @param  NetBuffer             Pointer to the buffer that contains the 
received
                                 data.
@@ -1188,14 +1188,14 @@ SockRcvdErr (
   }
 }
 
 
 /**
-  Called by the low layer protocol to indicate that there will be no more data 
+  Called by the low layer protocol to indicate that there will be no more data
   from the communication peer.
-  
-  This function set the socket's state to SO_NO_MORE_DATA and signal all 
queued 
+
+  This function set the socket's state to SO_NO_MORE_DATA and signal all queued
   IO tokens with the error status EFI_CONNECTION_FIN.
 
   @param  Sock                  Pointer to the socket.
 
 **/
@@ -1255,11 +1255,11 @@ SockBufFirst (
 
   @param  Sockbuf               Pointer to the socket buffer.
   @param  SockEntry             Pointer to the buffer block prior to the 
required
                                 one.
 
-  @return Pointer to the buffer block next to SockEntry. NULL if SockEntry is 
+  @return Pointer to the buffer block next to SockEntry. NULL if SockEntry is
           the tail or head entry.
 
 **/
 NET_BUF *
 SockBufNext (
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c 
b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
index c14fcd7..a8bdef6 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
@@ -451,11 +451,11 @@ SockAccept (
       ASSERT (Socket->Parent != NULL);
 
       Socket->Parent->ConnCnt--;
 
       DEBUG (
-        (EFI_D_INFO,
+        (EFI_D_NET,
         "SockAccept: Accept a socket, now conncount is %d",
         Socket->Parent->ConnCnt)
         );
       Socket->Parent = NULL;
 
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c 
b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
index b7f329b..1000538 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
@@ -73,11 +73,11 @@ TcpFastRecover (
     // Step 2: Entering fast retransmission
     //
     TcpRetransmit (Tcb, Tcb->SndUna);
     Tcb->CWnd = Tcb->Ssthresh + 3 * Tcb->SndMss;
 
-    DEBUG ((EFI_D_INFO, "TcpFastRecover: enter fast retransmission"
+    DEBUG ((EFI_D_NET, "TcpFastRecover: enter fast retransmission"
       " for TCB %p, recover point is %d\n", Tcb, Tcb->Recover));
     return;
   }
 
   //
@@ -92,11 +92,11 @@ TcpFastRecover (
 
     // Step 4 is skipped here only to be executed later
     // by TcpToSendData
     //
     Tcb->CWnd += Tcb->SndMss;
-    DEBUG ((EFI_D_INFO, "TcpFastRecover: received another"
+    DEBUG ((EFI_D_NET, "TcpFastRecover: received another"
       " duplicated ACK (%d) for TCB %p\n", Seg->Ack, Tcb));
 
   } else {
 
     //
@@ -112,11 +112,11 @@ TcpFastRecover (
       FlightSize        = TCP_SUB_SEQ (Tcb->SndNxt, Tcb->SndUna);
 
       Tcb->CWnd         = MIN (Tcb->Ssthresh, FlightSize + Tcb->SndMss);
 
       Tcb->CongestState = TCP_CONGEST_OPEN;
-      DEBUG ((EFI_D_INFO, "TcpFastRecover: received a full ACK(%d)"
+      DEBUG ((EFI_D_NET, "TcpFastRecover: received a full ACK(%d)"
         " for TCB %p, exit fast recovery\n", Seg->Ack, Tcb));
 
     } else {
 
       //
@@ -137,11 +137,11 @@ TcpFastRecover (
 
       }
 
       Tcb->CWnd -= Acked;
 
-      DEBUG ((EFI_D_INFO, "TcpFastRecover: received a partial"
+      DEBUG ((EFI_D_NET, "TcpFastRecover: received a partial"
         " ACK(%d) for TCB %p\n", Seg->Ack, Tcb));
 
     }
   }
 }
@@ -172,21 +172,21 @@ TcpFastLossRecover (
       // Full ACK: exit the loss recovery.
       //
       Tcb->LossTimes    = 0;
       Tcb->CongestState = TCP_CONGEST_OPEN;
 
-      DEBUG ((EFI_D_INFO, "TcpFastLossRecover: received a "
+      DEBUG ((EFI_D_NET, "TcpFastLossRecover: received a "
         "full ACK(%d) for TCB %p\n", Seg->Ack, Tcb));
 
     } else {
 
       //
       // Partial ACK:
       // fast retransmit the first unacknowledge field.
       //
       TcpRetransmit (Tcb, Seg->Ack);
-      DEBUG ((EFI_D_INFO, "TcpFastLossRecover: received a "
+      DEBUG ((EFI_D_NET, "TcpFastLossRecover: received a "
         "partial ACK(%d) for TCB %p\n", Seg->Ack, Tcb));
     }
   }
 }
 
@@ -241,11 +241,11 @@ TcpComputeRtt (
   } else if (Tcb->Rto > TCP_RTO_MAX) {
     Tcb->Rto = TCP_RTO_MAX;
 
   }
 
-  DEBUG ((EFI_D_INFO, "TcpComputeRtt: new RTT for TCB %p"
+  DEBUG ((EFI_D_NET, "TcpComputeRtt: new RTT for TCB %p"
     " computed SRTT: %d RTTVAR: %d RTO: %d\n",
     Tcb, Tcb->SRtt, Tcb->RttVar, Tcb->Rto));
 
 }
 
@@ -427,11 +427,11 @@ TcpDeliverData (
 
         NetbufFree (Nbuf);
         return -1;
       }
 
-      DEBUG ((EFI_D_INFO, "TcpDeliverData: processing FIN "
+      DEBUG ((EFI_D_NET, "TcpDeliverData: processing FIN "
         "from peer of TCB %p\n", Tcb));
 
       switch (Tcb->State) {
       case TCP_SYN_RCVD:
       case TCP_ESTABLISHED:
@@ -711,20 +711,20 @@ TcpInput (
 
   Head    = (TCP_HEAD *) NetbufGetByte (Nbuf, 0, NULL);
   ASSERT (Head != NULL);
 
   if (Nbuf->TotalSize < sizeof (TCP_HEAD)) {
-    DEBUG ((EFI_D_INFO, "TcpInput: received a malformed packet\n"));
+    DEBUG ((EFI_D_NET, "TcpInput: received a malformed packet\n"));
     goto DISCARD;
   }
   
   Len     = Nbuf->TotalSize - (Head->HeadLen << 2);
 
   if ((Head->HeadLen < 5) || (Len < 0) ||
       (TcpChecksum (Nbuf, NetPseudoHeadChecksum (Src, Dst, 6, 0)) != 0)) {
 
-    DEBUG ((EFI_D_INFO, "TcpInput: received a malformed packet\n"));
+    DEBUG ((EFI_D_NET, "TcpInput: received a malformed packet\n"));
     goto DISCARD;
   }
 
   if (TCP_FLG_ON (Head->Flag, TCP_FLG_SYN)) {
     Len++;
@@ -741,11 +741,11 @@ TcpInput (
           Src,
           (BOOLEAN) TCP_FLG_ON (Head->Flag, TCP_FLG_SYN)
           );
 
   if ((Tcb == NULL) || (Tcb->State == TCP_CLOSED)) {
-    DEBUG ((EFI_D_INFO, "TcpInput: send reset because no TCB found\n"));
+    DEBUG ((EFI_D_NET, "TcpInput: send reset because no TCB found\n"));
 
     Tcb = NULL;
     goto SEND_RESET;
   }
 
@@ -808,11 +808,11 @@ TcpInput (
           " failed to clone a child for TCB %p\n", Tcb));
 
         goto DISCARD;
       }
 
-      DEBUG ((EFI_D_INFO, "TcpInput: create a child for TCB %p"
+      DEBUG ((EFI_D_NET, "TcpInput: create a child for TCB %p"
         " in listening\n", Tcb));
 
       //
       // init the TCB structure
       //
@@ -900,11 +900,11 @@ TcpInput (
 
         TcpTrimInWnd (Tcb, Nbuf);
 
         TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW);
 
-        DEBUG ((EFI_D_INFO, "TcpInput: connection established"
+        DEBUG ((EFI_D_NET, "TcpInput: connection established"
           " for TCB %p in SYN_SENT\n", Tcb));
 
         goto StepSix;
       } else {
         //
@@ -1035,11 +1035,11 @@ TcpInput (
       TcpSetState (Tcb, TCP_ESTABLISHED);
 
       TcpClearTimer (Tcb, TCP_TIMER_CONNECT);
       TcpDeliverData (Tcb);
 
-      DEBUG ((EFI_D_INFO, "TcpInput: connection established "
+      DEBUG ((EFI_D_NET, "TcpInput: connection established "
         " for TCB %p in SYN_RCVD\n", Tcb));
 
       //
       // Continue the process as ESTABLISHED state
       //
@@ -1207,11 +1207,11 @@ TcpInput (
 NO_UPDATE:
 
   if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT) &&
       (Tcb->SndUna == Tcb->SndNxt)) {
 
-    DEBUG ((EFI_D_INFO, "TcpInput: local FIN is ACKed by"
+    DEBUG ((EFI_D_NET, "TcpInput: local FIN is ACKed by"
       " peer for connected TCB %p\n", Tcb));
 
     TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_FIN_ACKED);
   }
 
@@ -1297,11 +1297,11 @@ StepSix:
 
   if (TCP_FLG_ON (Seg->Flag, TCP_FLG_URG) &&
       !TCP_FIN_RCVD (Tcb->State)) 
   {
 
-    DEBUG ((EFI_D_INFO, "TcpInput: received urgent data "
+    DEBUG ((EFI_D_NET, "TcpInput: received urgent data "
       "from peer for connected TCB %p\n", Tcb));
 
     Urg = Seg->Seq + Seg->Urg;
 
     if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RCVD_URG) &&
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c 
b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
index 95f47f9..1a7c41a 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
@@ -1,9 +1,9 @@
 /** @file
   Misc support routines for tcp.
 
-Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2005 - 2016, 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
 http://opensource.org/licenses/bsd-license.php<BR>
 
@@ -502,11 +502,11 @@ TcpSetState (
 {
   ASSERT (Tcb->State < (sizeof (mTcpStateName) / sizeof (CHAR16 *)));
   ASSERT (State < (sizeof (mTcpStateName) / sizeof (CHAR16 *)));
 
   DEBUG (
-    (EFI_D_INFO,
+    (EFI_D_NET,
     "Tcb (%p) state %s --> %s\n",
     Tcb,
     mTcpStateName[Tcb->State],
     mTcpStateName[State])
     );
@@ -813,17 +813,17 @@ TcpOnAppConsume (
     TcpOld = TcpRcvWinOld (Tcb);
     if (TcpRcvWinNow (Tcb) > TcpOld) {
 
       if (TcpOld < Tcb->RcvMss) {
 
-        DEBUG ((EFI_D_INFO, "TcpOnAppConsume: send a window"
+        DEBUG ((EFI_D_NET, "TcpOnAppConsume: send a window"
           " update for a window closed Tcb %p\n", Tcb));
 
         TcpSendAck (Tcb);
       } else if (Tcb->DelayedAck == 0) {
 
-        DEBUG ((EFI_D_INFO, "TcpOnAppConsume: scheduled a delayed"
+        DEBUG ((EFI_D_NET, "TcpOnAppConsume: scheduled a delayed"
           " ACK to update window for Tcb %p\n", Tcb));
 
         Tcb->DelayedAck = 1;
       }
     }
diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c 
b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
index 1287636..b984ac0 100644
--- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
+++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c
@@ -803,11 +803,11 @@ SEND_AGAIN:
     if ((TcpGetMaxSndNxt (Tcb) == Tcb->SndNxt) &&
         (GET_SND_DATASIZE (Tcb->Sk) == 0) &&
         TCP_SEQ_LT (End + 1, Tcb->SndWnd + Tcb->SndWl2)) {
 
       DEBUG (
-               (EFI_D_INFO, 
+               (EFI_D_NET, 
                "TcpToSendData: send FIN "
         "to peer for TCB %p in state %s\n", 
         Tcb, 
         mTcpStateName[Tcb->State])
       );
@@ -881,11 +881,11 @@ SEND_AGAIN:
   // Karn's algorithm reqires not to update RTT when in loss.
   //
   if ((Tcb->CongestState == TCP_CONGEST_OPEN) &&
       !TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RTT_ON)) {
 
-    DEBUG ((EFI_D_INFO, "TcpToSendData: set RTT measure "
+    DEBUG ((EFI_D_NET, "TcpToSendData: set RTT measure "
       "sequence %d for TCB %p\n", Seq, Tcb));
 
     TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_RTT_ON);
     Tcb->RttSeq     = Seq;
     Tcb->RttMeasure = 0;
@@ -1009,11 +1009,11 @@ TcpToSendAck (
       (TcpNow > TcpRcvWinOld (Tcb))) {
     TcpSendAck (Tcb);
     return;
   }
 
-  DEBUG ((EFI_D_INFO, "TcpToSendAck: scheduled a delayed"
+  DEBUG ((EFI_D_NET, "TcpToSendAck: scheduled a delayed"
     " ACK for TCB %p\n", Tcb));
 
   //
   // schedule a delayed ACK
   //
-- 
1.9.5.msysgit.1

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

Reply via email to