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

From: Cong Wang
Date: Sat Sep 04 2021 - 15:04:26 EST


On Fri, Sep 3, 2021 at 11:43 PM Zhongya Yan <yan2228598786@xxxxxxxxx> wrote:
>
> I used the suggestion from `Brendan Gregg`. In addition to the
> `reason` parameter there is also the `field` parameter pointing
> to `SNMP` to distinguish the `tcp_drop` cause. I know what I
> submitted is not accurate, so I am submitting the current
> patch to get comments and criticism from everyone so that I
> can submit better code and solutions.And of course to make me
> more familiar and understand the `linux` kernel network code.

Any reason why only limit this to TCP? I am pretty sure we are
interested in packet drops across the entire stack.

You can take a look at net/core/drop_monitor.c, it actually has
a big advantage over your solution, which is sending entire
dropped packets to user-space for inspection.

If you can have a solution for all packet drops, not just TCP,
it would make your patch much more useful. Therefore, I'd
suggest you to consider extending the drop monitor.

Thanks.