Re: [PATCH] net: tcp_drop adds `reason` and SNMP parameters for tracing v4

From: Steven Rostedt
Date: Tue Sep 07 2021 - 11:12:08 EST


On Fri, 3 Sep 2021 23:40:44 -0700
Zhongya Yan <yan2228598786@xxxxxxxxx> wrote:

> @@ -4708,7 +4710,7 @@ static void tcp_ofo_queue(struct sock *sk)
> rb_erase(&skb->rbnode, &tp->out_of_order_queue);
>
> if (unlikely(!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt))) {
> - tcp_drop(sk, skb);
> + tcp_drop(sk, skb, LINUX_MIB_TCPOFOQUEUE, "Tcp queue error");
> continue;
> }
>
> @@ -4764,7 +4766,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
> if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) {
> NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP);
> sk->sk_data_ready(sk);
> - tcp_drop(sk, skb);
> + tcp_drop(sk, skb, LINUX_MIB_TCPOFODROP, "Tcp rmem failed");
> return;
> }
>
> @@ -4827,7 +4829,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb)
> /* All the bits are present. Drop. */
> NET_INC_STATS(sock_net(sk),
> LINUX_MIB_TCPOFOMERGE);
> - tcp_drop(sk, skb);
> + tcp_drop(sk, skb, LINUX_MIB_TCPOFOMERGE, "Tcp bits are present");

Just curious. Is "Tcp" the normal way to write "TCP" in the kernel? I see
it in snmp_seq_show_tcp_udp() in net/ipv4/proc.c, but no where else
(besides doing CamelCase words). Should these be written using "TCP"
instead of "Tcp". It just looks awkward to me.

But hey, I'm not one of the networking folks, so what do I know?

-- Steve