netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <aahringo@redhat.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org
Subject: [PATCHv2 net-next 0/2] net: sock: add tracers for inet socket errors
Date: Sun, 27 Jun 2021 18:48:20 -0400	[thread overview]
Message-ID: <20210627224822.4689-1-aahringo@redhat.com> (raw)

Hi,

this patch series introduce tracers for sk_error_report socket callback
calls. The use-case is that a user space application can monitor them
and making an own heuristic about bad peer connections even over a
socket lifetime. To make a specific example it could be use in the Linux
cluster world to fence a "bad" behaving node. For now it's okay to only
trace inet sockets. Other socket families can introduce their own tracers
easily.

Example output with trace-cmd:

<idle>-0     [003]   201.799437: inet_sk_error_report: family=AF_INET protocol=IPPROTO_TCP sport=21064 dport=38941 saddr=192.168.122.57 daddr=192.168.122.251 saddrv6=::ffff:192.168.122.57 daddrv6=::ffff:192.168.122.251 error=104

- Alex

changes since v2:

- change "sk.sk_error_report(&ipc->sk);" to "sk_error_report(&ipc->sk);"
  in net/qrtr/qrtr.c

Alexander Aring (2):
  net: sock: introduce sk_error_report
  net: sock: add trace for socket errors

 .../chelsio/inline_crypto/chtls/chtls_cm.c    |  2 +-
 drivers/vhost/vsock.c                         |  2 +-
 include/linux/skmsg.h                         |  2 +-
 include/net/sock.h                            |  2 +
 include/net/tls.h                             |  2 +-
 include/trace/events/sock.h                   | 60 +++++++++++++++++++
 net/caif/caif_socket.c                        |  2 +-
 net/can/bcm.c                                 |  4 +-
 net/can/isotp.c                               | 20 +++----
 net/can/j1939/socket.c                        |  4 +-
 net/can/raw.c                                 |  6 +-
 net/core/skbuff.c                             |  6 +-
 net/core/sock.c                               | 16 +++++
 net/dccp/ipv4.c                               |  4 +-
 net/dccp/ipv6.c                               |  4 +-
 net/dccp/proto.c                              |  2 +-
 net/dccp/timer.c                              |  2 +-
 net/ipv4/ping.c                               |  2 +-
 net/ipv4/raw.c                                |  4 +-
 net/ipv4/tcp.c                                |  4 +-
 net/ipv4/tcp_input.c                          |  2 +-
 net/ipv4/tcp_ipv4.c                           |  4 +-
 net/ipv4/tcp_timer.c                          |  2 +-
 net/ipv4/udp.c                                |  4 +-
 net/ipv6/raw.c                                |  2 +-
 net/ipv6/tcp_ipv6.c                           |  4 +-
 net/ipv6/udp.c                                |  2 +-
 net/kcm/kcmsock.c                             |  2 +-
 net/mptcp/subflow.c                           |  2 +-
 net/netlink/af_netlink.c                      |  8 +--
 net/nfc/rawsock.c                             |  2 +-
 net/packet/af_packet.c                        |  4 +-
 net/qrtr/qrtr.c                               |  2 +-
 net/sctp/input.c                              |  2 +-
 net/sctp/ipv6.c                               |  2 +-
 net/smc/af_smc.c                              |  2 +-
 net/strparser/strparser.c                     |  2 +-
 net/unix/af_unix.c                            |  2 +-
 net/vmw_vsock/af_vsock.c                      |  2 +-
 net/vmw_vsock/virtio_transport.c              |  2 +-
 net/vmw_vsock/virtio_transport_common.c       |  2 +-
 net/vmw_vsock/vmci_transport.c                |  4 +-
 net/xdp/xsk.c                                 |  2 +-
 43 files changed, 145 insertions(+), 67 deletions(-)

-- 
2.26.3


             reply	other threads:[~2021-06-27 22:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-27 22:48 Alexander Aring [this message]
2021-06-27 22:48 ` [PATCHv2 net-next 1/2] net: sock: introduce sk_error_report Alexander Aring
2021-06-27 22:48 ` [PATCHv2 net-next 2/2] net: sock: add trace for socket errors Alexander Aring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210627224822.4689-1-aahringo@redhat.com \
    --to=aahringo@redhat.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).