netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] TCP: make seq # error messages more readable
@ 2018-07-13  0:48 Randy Dunlap
  2018-07-13 13:38 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2018-07-13  0:48 UTC (permalink / raw)
  To: netdev@vger.kernel.org, David Miller, Eric Dumazet
  Cc: 積丹尼 Dan Jacobson

From: Randy Dunlap <rdunlap@infradead.org>

Attempt to make cryptic TCP seq number error messages clearer by
(1) adding the function name, (2) identifying the errors as "seq # bug",
and (3) grouping the field identifiers and values by separating them
with commas.

E.g., the following message is changed from:

recvmsg bug 2: copied 73BCB6CD seq 70F17CBE rcvnxt 73BCB9AA fl 0
WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:1881 tcp_recvmsg+0x649/0xb90

to:

tcp_recvmsg: TCP recvmsg seq # bug 2: copied 73BCB6CD, seq 70F17CBE, rcvnxt 73BCB9AA, fl 0
WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:2011 tcp_recvmsg+0x694/0xba0

Suggested-by: 積丹尼 Dan Jacobson <jidanni@jidanni.org>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
---
 net/ipv4/tcp.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

--- linux-next-20180712.orig/net/ipv4/tcp.c
+++ linux-next-20180712/net/ipv4/tcp.c
@@ -1994,9 +1994,9 @@ int tcp_recvmsg(struct sock *sk, struct
 			 * shouldn't happen.
 			 */
 			if (WARN(before(*seq, TCP_SKB_CB(skb)->seq),
-				 "recvmsg bug: copied %X seq %X rcvnxt %X fl %X\n",
-				 *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt,
-				 flags))
+				 "%s: TCP recvmsg seq # bug: copied %X, seq %X, rcvnxt %X, fl %X\n",
+				 __func__, *seq,
+				 TCP_SKB_CB(skb)->seq, tp->rcv_nxt, flags))
 				break;
 
 			offset = *seq - TCP_SKB_CB(skb)->seq;
@@ -2009,8 +2009,9 @@ int tcp_recvmsg(struct sock *sk, struct
 			if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN)
 				goto found_fin_ok;
 			WARN(!(flags & MSG_PEEK),
-			     "recvmsg bug 2: copied %X seq %X rcvnxt %X fl %X\n",
-			     *seq, TCP_SKB_CB(skb)->seq, tp->rcv_nxt, flags);
+			     "%s: TCP recvmsg seq # bug 2: copied %X, seq %X, rcvnxt %X, fl %X\n",
+			     __func__, *seq,
+			     TCP_SKB_CB(skb)->seq, tp->rcv_nxt, flags);
 		}
 
 		/* Well, if we have backlog, try to process it now yet. */

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

* Re: [PATCH net-next] TCP: make seq # error messages more readable
  2018-07-13  0:48 [PATCH net-next] TCP: make seq # error messages more readable Randy Dunlap
@ 2018-07-13 13:38 ` Eric Dumazet
  2018-07-13 16:48   ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2018-07-13 13:38 UTC (permalink / raw)
  To: Randy Dunlap, netdev@vger.kernel.org, David Miller, Eric Dumazet
  Cc: 積丹尼 Dan Jacobson



On 07/12/2018 05:48 PM, Randy Dunlap wrote:
> From: Randy Dunlap <rdunlap@infradead.org>
> 
> Attempt to make cryptic TCP seq number error messages clearer by
> (1) adding the function name, (2) identifying the errors as "seq # bug",
> and (3) grouping the field identifiers and values by separating them
> with commas.
> 
> E.g., the following message is changed from:
> 
> recvmsg bug 2: copied 73BCB6CD seq 70F17CBE rcvnxt 73BCB9AA fl 0
> WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:1881 tcp_recvmsg+0x649/0xb90
> 
> to:
> 
> tcp_recvmsg: TCP recvmsg seq # bug 2: copied 73BCB6CD, seq 70F17CBE, rcvnxt 73BCB9AA, fl 0
> WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:2011 tcp_recvmsg+0x694/0xba0
> 

Hi Randy

It is not clear what this patch improves.
Do we really to mention tcp twice ?

Thanks.

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

* Re: [PATCH net-next] TCP: make seq # error messages more readable
  2018-07-13 13:38 ` Eric Dumazet
@ 2018-07-13 16:48   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2018-07-13 16:48 UTC (permalink / raw)
  To: Eric Dumazet, netdev@vger.kernel.org, David Miller, Eric Dumazet
  Cc: 積丹尼 Dan Jacobson

On 07/13/2018 06:38 AM, Eric Dumazet wrote:
> 
> 
> On 07/12/2018 05:48 PM, Randy Dunlap wrote:
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Attempt to make cryptic TCP seq number error messages clearer by
>> (1) adding the function name, (2) identifying the errors as "seq # bug",
>> and (3) grouping the field identifiers and values by separating them
>> with commas.
>>
>> E.g., the following message is changed from:
>>
>> recvmsg bug 2: copied 73BCB6CD seq 70F17CBE rcvnxt 73BCB9AA fl 0
>> WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:1881 tcp_recvmsg+0x649/0xb90
>>
>> to:
>>
>> tcp_recvmsg: TCP recvmsg seq # bug 2: copied 73BCB6CD, seq 70F17CBE, rcvnxt 73BCB9AA, fl 0
>> WARNING: CPU: 2 PID: 1501 at /linux/net/ipv4/tcp.c:2011 tcp_recvmsg+0x694/0xba0
>>
> 
> Hi Randy
> 
> It is not clear what this patch improves.
> Do we really to mention tcp twice ?

I will gladly drop the __func__: string.  Doing so would change this:

recvmsg bug 2: copied 73BCB6CD seq 70F17CBE rcvnxt 73BCB9AA fl 0

to:

TCP recvmsg seq # bug 2: copied 73BCB6CD, seq 70F17CBE, rcvnxt 73BCB9AA, fl 0


The (new) message identifies that it is TCP and that it is a sequence # bug.
Both of those are helpful in my view, whereas the original message isn't
helpful at all.


> 
> Thanks.


-- 
~Randy

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

end of thread, other threads:[~2018-07-13 17:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-13  0:48 [PATCH net-next] TCP: make seq # error messages more readable Randy Dunlap
2018-07-13 13:38 ` Eric Dumazet
2018-07-13 16:48   ` Randy Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).