From dea6914dac8ca883be4cee21b139b263b73769ec Mon Sep 17 00:00:00 2001 From: Zhang Lubo Date: Fri, 23 Sep 2016 12:01:28 +0800 Subject: [PATCH] MdeModulePkg:TcpDriver need to use EFI_D_NET for DEBUG maessage. 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 Cc: Hegde Nagaraj P Cc: Subramanian Sriram Cc: Fu Siyuan Cc: Ye Ting Reviewed-by: Sriram Subramanian --- .../Universal/Network/Tcp4Dxe/SockImpl.c | 46 +++++++++---------- .../Universal/Network/Tcp4Dxe/SockInterface.c | 2 +- .../Universal/Network/Tcp4Dxe/Tcp4Input.c | 32 ++++++------- .../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 2e31643821..3025790a20 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockImpl.c @@ -1,7 +1,7 @@ /** @file Implementation of the Socket. -Copyright (c) 2005 - 2012, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
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 @@ -33,7 +33,7 @@ SockTcpDataToRcv ( OUT BOOLEAN *IsUrg, IN UINT32 BufLen ); - + /** Process the send token. @@ -49,7 +49,7 @@ SockProcessSndToken ( Supporting function for both SockImpl and SockInterface. @param Event The Event this notify function registered to, ignored. - + **/ VOID EFIAPI @@ -322,7 +322,7 @@ SockProcessTcpSndData ( @param Sock Pointer to the socket. @param PendingTokenList Pointer to the token list to be flushed. - + **/ VOID SockFlushPendingToken ( @@ -352,7 +352,7 @@ 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. @@ -413,7 +413,7 @@ SockWakeListenToken ( 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; } @@ -664,7 +664,7 @@ SockCreate ( 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) ); @@ -753,7 +753,7 @@ SockDestroy ( (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) @@ -933,10 +933,10 @@ SockClone ( /** - 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 @@ -964,13 +964,13 @@ 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 ( @@ -994,8 +994,8 @@ 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. @@ -1084,8 +1084,8 @@ 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. @@ -1190,10 +1190,10 @@ 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. @@ -1257,7 +1257,7 @@ SockBufFirst ( @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. **/ diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c index c14fcd7a8d..a8bdef6802 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/SockInterface.c @@ -453,7 +453,7 @@ SockAccept ( Socket->Parent->ConnCnt--; DEBUG ( - (EFI_D_INFO, + (EFI_D_NET, "SockAccept: Accept a socket, now conncount is %d", Socket->Parent->ConnCnt) ); diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c index b7f329be7a..1000538f87 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Input.c @@ -75,7 +75,7 @@ TcpFastRecover ( 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; } @@ -94,7 +94,7 @@ TcpFastRecover ( // 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 { @@ -114,7 +114,7 @@ TcpFastRecover ( 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 { @@ -139,7 +139,7 @@ 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)); } @@ -174,7 +174,7 @@ TcpFastLossRecover ( 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 { @@ -184,7 +184,7 @@ TcpFastLossRecover ( // 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)); } } @@ -243,7 +243,7 @@ TcpComputeRtt ( } - 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)); @@ -429,7 +429,7 @@ TcpDeliverData ( 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) { @@ -713,7 +713,7 @@ TcpInput ( 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; } @@ -722,7 +722,7 @@ TcpInput ( 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; } @@ -743,7 +743,7 @@ TcpInput ( ); 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; @@ -810,7 +810,7 @@ TcpInput ( 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)); // @@ -902,7 +902,7 @@ TcpInput ( 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; @@ -1037,7 +1037,7 @@ TcpInput ( 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)); // @@ -1209,7 +1209,7 @@ 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); @@ -1299,7 +1299,7 @@ StepSix: !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; diff --git a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c index 95f47f91bc..1a7c41aa0b 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Misc.c @@ -1,7 +1,7 @@ /** @file Misc support routines for tcp. -Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
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 @@ -504,7 +504,7 @@ TcpSetState ( ASSERT (State < (sizeof (mTcpStateName) / sizeof (CHAR16 *))); DEBUG ( - (EFI_D_INFO, + (EFI_D_NET, "Tcb (%p) state %s --> %s\n", Tcb, mTcpStateName[Tcb->State], @@ -815,13 +815,13 @@ TcpOnAppConsume ( 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 1287636ef6..b984ac069e 100644 --- a/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c +++ b/MdeModulePkg/Universal/Network/Tcp4Dxe/Tcp4Output.c @@ -805,7 +805,7 @@ SEND_AGAIN: 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, @@ -883,7 +883,7 @@ SEND_AGAIN: 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); @@ -1011,7 +1011,7 @@ TcpToSendAck ( return; } - DEBUG ((EFI_D_INFO, "TcpToSendAck: scheduled a delayed" + DEBUG ((EFI_D_NET, "TcpToSendAck: scheduled a delayed" " ACK for TCB %p\n", Tcb)); // -- 2.39.2