]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg:TcpDriver need to use EFI_D_NET for DEBUG maessage.
authorZhang Lubo <lubo.zhang@intel.com>
Fri, 23 Sep 2016 04:01:28 +0000 (12:01 +0800)
committerJiaxin Wu <jiaxin.wu@intel.com>
Sun, 9 Oct 2016 06:29:40 +0000 (14:29 +0800)
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.zhang@intel.com>
Cc: Hegde Nagaraj P <nagaraj-p.hegde@hpe.com>
Cc: Subramanian Sriram <sriram-s@hpe.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Reviewed-by: Sriram Subramanian <sriram-s@hpe.com>
MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c
MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c
MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c

index 2e31643821305d5961319f8864aa921645e5824e..3025790a206cdcd19b55650f1c2fd8258d993e24 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Implementation of the Socket.\r
 \r
-Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -33,7 +33,7 @@ SockTcpDataToRcv (
      OUT BOOLEAN        *IsUrg,\r
   IN     UINT32         BufLen\r
   );\r
-  \r
+\r
 /**\r
   Process the send token.\r
 \r
@@ -49,7 +49,7 @@ SockProcessSndToken (
   Supporting function for both SockImpl and SockInterface.\r
 \r
   @param Event             The Event this notify function registered to, ignored.\r
-  \r
+\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -322,7 +322,7 @@ SockProcessTcpSndData (
 \r
   @param  Sock                  Pointer to the socket.\r
   @param  PendingTokenList      Pointer to the token list to be flushed.\r
-  \r
+\r
 **/\r
 VOID\r
 SockFlushPendingToken (\r
@@ -352,7 +352,7 @@ SockFlushPendingToken (
 \r
 \r
 /**\r
-  Wake up the connection token while the connection is successfully established, \r
+  Wake up the connection token while the connection is successfully established,\r
   then try to process any pending send token.\r
 \r
   @param  Sock                  Pointer to the socket.\r
@@ -413,7 +413,7 @@ SockWakeListenToken (
     RemoveEntryList (&Sock->ConnectionList);\r
 \r
     Parent->ConnCnt--;\r
-    DEBUG ((EFI_D_INFO, "SockWakeListenToken: accept a socket, now conncnt is %d", Parent->ConnCnt));\r
+    DEBUG ((EFI_D_NET, "SockWakeListenToken: accept a socket, now conncnt is %d", Parent->ConnCnt));\r
 \r
     Sock->Parent = NULL;\r
   }\r
@@ -664,7 +664,7 @@ SockCreate (
     Parent->ConnCnt++;\r
 \r
     DEBUG (\r
-      (EFI_D_INFO,\r
+      (EFI_D_NET,\r
       "SockCreate: Create a new socket and add to parent, now conncnt is %d\n",\r
       Parent->ConnCnt)\r
       );\r
@@ -753,7 +753,7 @@ SockDestroy (
     (Sock->Parent->ConnCnt)--;\r
 \r
     DEBUG (\r
-      (EFI_D_INFO,\r
+      (EFI_D_NET,\r
       "SockDestroy: Delete a unaccepted socket from parent"\r
       "now conncnt is %d\n",\r
       Sock->Parent->ConnCnt)\r
@@ -933,10 +933,10 @@ SockClone (
 \r
 \r
 /**\r
-  Called by the low layer protocol to indicate the socket a connection is \r
-  established. \r
-  \r
-  This function just changes the socket's state to SO_CONNECTED \r
+  Called by the low layer protocol to indicate the socket a connection is\r
+  established.\r
+\r
+  This function just changes the socket's state to SO_CONNECTED\r
   and signals the token used for connection establishment.\r
 \r
   @param  Sock                  Pointer to the socket associated with the\r
@@ -964,13 +964,13 @@ SockConnEstablished (
 \r
 /**\r
   Called by the low layer protocol to indicate the connection is closed.\r
-  \r
-  This function flushes the socket, sets the state to SO_CLOSED and signals \r
+\r
+  This function flushes the socket, sets the state to SO_CLOSED and signals\r
   the close token.\r
 \r
   @param  Sock                  Pointer to the socket associated with the closed\r
                                 connection.\r
-                                \r
+\r
 **/\r
 VOID\r
 SockConnClosed (\r
@@ -994,8 +994,8 @@ SockConnClosed (
 \r
 /**\r
   Called by low layer protocol to indicate that some data is sent or processed.\r
-   \r
-  This function trims the sent data in the socket send buffer, signals the data \r
+\r
+  This function trims the sent data in the socket send buffer, signals the data\r
   token if proper.\r
 \r
   @param  Sock                  Pointer to the socket.\r
@@ -1084,8 +1084,8 @@ SockGetDataToSend (
 \r
 /**\r
   Called by the low layer protocol to deliver received data to socket layer.\r
-  \r
-  This function will append the data to the socket receive buffer, set ther \r
+\r
+  This function will append the data to the socket receive buffer, set ther\r
   urgent data length and then check if any receive token can be signaled.\r
 \r
   @param  Sock                  Pointer to the socket.\r
@@ -1190,10 +1190,10 @@ SockRcvdErr (
 \r
 \r
 /**\r
-  Called by the low layer protocol to indicate that there will be no more data \r
+  Called by the low layer protocol to indicate that there will be no more data\r
   from the communication peer.\r
-  \r
-  This function set the socket's state to SO_NO_MORE_DATA and signal all queued \r
+\r
+  This function set the socket's state to SO_NO_MORE_DATA and signal all queued\r
   IO tokens with the error status EFI_CONNECTION_FIN.\r
 \r
   @param  Sock                  Pointer to the socket.\r
@@ -1257,7 +1257,7 @@ SockBufFirst (
   @param  SockEntry             Pointer to the buffer block prior to the required\r
                                 one.\r
 \r
-  @return Pointer to the buffer block next to SockEntry. NULL if SockEntry is \r
+  @return Pointer to the buffer block next to SockEntry. NULL if SockEntry is\r
           the tail or head entry.\r
 \r
 **/\r
index c14fcd7a8dc4cddbf871182ef6ab915d39b58439..a8bdef6802b425bef556e5a1c82895796cb5c5f4 100644 (file)
@@ -453,7 +453,7 @@ SockAccept (
       Socket->Parent->ConnCnt--;\r
 \r
       DEBUG (\r
-        (EFI_D_INFO,\r
+        (EFI_D_NET,\r
         "SockAccept: Accept a socket, now conncount is %d",\r
         Socket->Parent->ConnCnt)\r
         );\r
index b7f329be7a64d7ff8cd157141693dcab65b86724..1000538f87446f1ac08482d4500e4b3b7d16112d 100644 (file)
@@ -75,7 +75,7 @@ TcpFastRecover (
     TcpRetransmit (Tcb, Tcb->SndUna);\r
     Tcb->CWnd = Tcb->Ssthresh + 3 * Tcb->SndMss;\r
 \r
-    DEBUG ((EFI_D_INFO, "TcpFastRecover: enter fast retransmission"\r
+    DEBUG ((EFI_D_NET, "TcpFastRecover: enter fast retransmission"\r
       " for TCB %p, recover point is %d\n", Tcb, Tcb->Recover));\r
     return;\r
   }\r
@@ -94,7 +94,7 @@ TcpFastRecover (
     // by TcpToSendData\r
     //\r
     Tcb->CWnd += Tcb->SndMss;\r
-    DEBUG ((EFI_D_INFO, "TcpFastRecover: received another"\r
+    DEBUG ((EFI_D_NET, "TcpFastRecover: received another"\r
       " duplicated ACK (%d) for TCB %p\n", Seg->Ack, Tcb));\r
 \r
   } else {\r
@@ -114,7 +114,7 @@ TcpFastRecover (
       Tcb->CWnd         = MIN (Tcb->Ssthresh, FlightSize + Tcb->SndMss);\r
 \r
       Tcb->CongestState = TCP_CONGEST_OPEN;\r
-      DEBUG ((EFI_D_INFO, "TcpFastRecover: received a full ACK(%d)"\r
+      DEBUG ((EFI_D_NET, "TcpFastRecover: received a full ACK(%d)"\r
         " for TCB %p, exit fast recovery\n", Seg->Ack, Tcb));\r
 \r
     } else {\r
@@ -139,7 +139,7 @@ TcpFastRecover (
 \r
       Tcb->CWnd -= Acked;\r
 \r
-      DEBUG ((EFI_D_INFO, "TcpFastRecover: received a partial"\r
+      DEBUG ((EFI_D_NET, "TcpFastRecover: received a partial"\r
         " ACK(%d) for TCB %p\n", Seg->Ack, Tcb));\r
 \r
     }\r
@@ -174,7 +174,7 @@ TcpFastLossRecover (
       Tcb->LossTimes    = 0;\r
       Tcb->CongestState = TCP_CONGEST_OPEN;\r
 \r
-      DEBUG ((EFI_D_INFO, "TcpFastLossRecover: received a "\r
+      DEBUG ((EFI_D_NET, "TcpFastLossRecover: received a "\r
         "full ACK(%d) for TCB %p\n", Seg->Ack, Tcb));\r
 \r
     } else {\r
@@ -184,7 +184,7 @@ TcpFastLossRecover (
       // fast retransmit the first unacknowledge field.\r
       //\r
       TcpRetransmit (Tcb, Seg->Ack);\r
-      DEBUG ((EFI_D_INFO, "TcpFastLossRecover: received a "\r
+      DEBUG ((EFI_D_NET, "TcpFastLossRecover: received a "\r
         "partial ACK(%d) for TCB %p\n", Seg->Ack, Tcb));\r
     }\r
   }\r
@@ -243,7 +243,7 @@ TcpComputeRtt (
 \r
   }\r
 \r
-  DEBUG ((EFI_D_INFO, "TcpComputeRtt: new RTT for TCB %p"\r
+  DEBUG ((EFI_D_NET, "TcpComputeRtt: new RTT for TCB %p"\r
     " computed SRTT: %d RTTVAR: %d RTO: %d\n",\r
     Tcb, Tcb->SRtt, Tcb->RttVar, Tcb->Rto));\r
 \r
@@ -429,7 +429,7 @@ TcpDeliverData (
         return -1;\r
       }\r
 \r
-      DEBUG ((EFI_D_INFO, "TcpDeliverData: processing FIN "\r
+      DEBUG ((EFI_D_NET, "TcpDeliverData: processing FIN "\r
         "from peer of TCB %p\n", Tcb));\r
 \r
       switch (Tcb->State) {\r
@@ -713,7 +713,7 @@ TcpInput (
   ASSERT (Head != NULL);\r
 \r
   if (Nbuf->TotalSize < sizeof (TCP_HEAD)) {\r
-    DEBUG ((EFI_D_INFO, "TcpInput: received a malformed packet\n"));\r
+    DEBUG ((EFI_D_NET, "TcpInput: received a malformed packet\n"));\r
     goto DISCARD;\r
   }\r
   \r
@@ -722,7 +722,7 @@ TcpInput (
   if ((Head->HeadLen < 5) || (Len < 0) ||\r
       (TcpChecksum (Nbuf, NetPseudoHeadChecksum (Src, Dst, 6, 0)) != 0)) {\r
 \r
-    DEBUG ((EFI_D_INFO, "TcpInput: received a malformed packet\n"));\r
+    DEBUG ((EFI_D_NET, "TcpInput: received a malformed packet\n"));\r
     goto DISCARD;\r
   }\r
 \r
@@ -743,7 +743,7 @@ TcpInput (
           );\r
 \r
   if ((Tcb == NULL) || (Tcb->State == TCP_CLOSED)) {\r
-    DEBUG ((EFI_D_INFO, "TcpInput: send reset because no TCB found\n"));\r
+    DEBUG ((EFI_D_NET, "TcpInput: send reset because no TCB found\n"));\r
 \r
     Tcb = NULL;\r
     goto SEND_RESET;\r
@@ -810,7 +810,7 @@ TcpInput (
         goto DISCARD;\r
       }\r
 \r
-      DEBUG ((EFI_D_INFO, "TcpInput: create a child for TCB %p"\r
+      DEBUG ((EFI_D_NET, "TcpInput: create a child for TCB %p"\r
         " in listening\n", Tcb));\r
 \r
       //\r
@@ -902,7 +902,7 @@ TcpInput (
 \r
         TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_ACK_NOW);\r
 \r
-        DEBUG ((EFI_D_INFO, "TcpInput: connection established"\r
+        DEBUG ((EFI_D_NET, "TcpInput: connection established"\r
           " for TCB %p in SYN_SENT\n", Tcb));\r
 \r
         goto StepSix;\r
@@ -1037,7 +1037,7 @@ TcpInput (
       TcpClearTimer (Tcb, TCP_TIMER_CONNECT);\r
       TcpDeliverData (Tcb);\r
 \r
-      DEBUG ((EFI_D_INFO, "TcpInput: connection established "\r
+      DEBUG ((EFI_D_NET, "TcpInput: connection established "\r
         " for TCB %p in SYN_RCVD\n", Tcb));\r
 \r
       //\r
@@ -1209,7 +1209,7 @@ NO_UPDATE:
   if (TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_FIN_SENT) &&\r
       (Tcb->SndUna == Tcb->SndNxt)) {\r
 \r
-    DEBUG ((EFI_D_INFO, "TcpInput: local FIN is ACKed by"\r
+    DEBUG ((EFI_D_NET, "TcpInput: local FIN is ACKed by"\r
       " peer for connected TCB %p\n", Tcb));\r
 \r
     TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_FIN_ACKED);\r
@@ -1299,7 +1299,7 @@ StepSix:
       !TCP_FIN_RCVD (Tcb->State)) \r
   {\r
 \r
-    DEBUG ((EFI_D_INFO, "TcpInput: received urgent data "\r
+    DEBUG ((EFI_D_NET, "TcpInput: received urgent data "\r
       "from peer for connected TCB %p\n", Tcb));\r
 \r
     Urg = Seg->Seq + Seg->Urg;\r
index 95f47f91bc40b41c2474480e858ae91ca2a3ee81..1a7c41aa0b564a2e2e770e6ff2f8cca2844f2dc9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Misc support routines for tcp.\r
 \r
-Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -504,7 +504,7 @@ TcpSetState (
   ASSERT (State < (sizeof (mTcpStateName) / sizeof (CHAR16 *)));\r
 \r
   DEBUG (\r
-    (EFI_D_INFO,\r
+    (EFI_D_NET,\r
     "Tcb (%p) state %s --> %s\n",\r
     Tcb,\r
     mTcpStateName[Tcb->State],\r
@@ -815,13 +815,13 @@ TcpOnAppConsume (
 \r
       if (TcpOld < Tcb->RcvMss) {\r
 \r
-        DEBUG ((EFI_D_INFO, "TcpOnAppConsume: send a window"\r
+        DEBUG ((EFI_D_NET, "TcpOnAppConsume: send a window"\r
           " update for a window closed Tcb %p\n", Tcb));\r
 \r
         TcpSendAck (Tcb);\r
       } else if (Tcb->DelayedAck == 0) {\r
 \r
-        DEBUG ((EFI_D_INFO, "TcpOnAppConsume: scheduled a delayed"\r
+        DEBUG ((EFI_D_NET, "TcpOnAppConsume: scheduled a delayed"\r
           " ACK to update window for Tcb %p\n", Tcb));\r
 \r
         Tcb->DelayedAck = 1;\r
index 1287636ef654170371d3fdd12b85dd3eeb95fea8..b984ac069ee2fed8bf15d929b2fbe5f0add98396 100644 (file)
@@ -805,7 +805,7 @@ SEND_AGAIN:
         TCP_SEQ_LT (End + 1, Tcb->SndWnd + Tcb->SndWl2)) {\r
 \r
       DEBUG (\r
-               (EFI_D_INFO\r
+               (EFI_D_NET\r
                "TcpToSendData: send FIN "\r
         "to peer for TCB %p in state %s\n", \r
         Tcb, \r
@@ -883,7 +883,7 @@ SEND_AGAIN:
   if ((Tcb->CongestState == TCP_CONGEST_OPEN) &&\r
       !TCP_FLG_ON (Tcb->CtrlFlag, TCP_CTRL_RTT_ON)) {\r
 \r
-    DEBUG ((EFI_D_INFO, "TcpToSendData: set RTT measure "\r
+    DEBUG ((EFI_D_NET, "TcpToSendData: set RTT measure "\r
       "sequence %d for TCB %p\n", Seq, Tcb));\r
 \r
     TCP_SET_FLG (Tcb->CtrlFlag, TCP_CTRL_RTT_ON);\r
@@ -1011,7 +1011,7 @@ TcpToSendAck (
     return;\r
   }\r
 \r
-  DEBUG ((EFI_D_INFO, "TcpToSendAck: scheduled a delayed"\r
+  DEBUG ((EFI_D_NET, "TcpToSendAck: scheduled a delayed"\r
     " ACK for TCB %p\n", Tcb));\r
 \r
   //\r