net: drop_monitor: support drop reason
authorMenglong Dong <imagedong@tencent.com>
Wed, 9 Feb 2022 06:08:38 +0000 (14:08 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 10 Feb 2022 01:25:57 +0000 (17:25 -0800)
commit5cad527d5ffa9a1c4731bb9c97d2ee93f8960d50
tree717ff6666dd2d40c0153ac9dbb97fcdfaa4cac89
parent1710b52d7c135e83ee00ed38afacc1079cbe71f5
net: drop_monitor: support drop reason

In the commit c504e5c2f964 ("net: skb: introduce kfree_skb_reason()")
drop reason is introduced to the tracepoint of kfree_skb. Therefore,
drop_monitor is able to report the drop reason to users by netlink.

The drop reasons are reported as string to users, which is exactly
the same as what we do when reporting it to ftrace.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20220209060838.55513-1-imagedong@tencent.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/uapi/linux/net_dropmon.h
net/core/drop_monitor.c