-
- Downloads
sock: enable timestamping using control messages
Currently, SOL_TIMESTAMPING can only be enabled using setsockopt. This is very costly when users want to sample writes to gather tx timestamps. Add support for enabling SO_TIMESTAMPING via control messages by using tsflags added in `struct sockcm_cookie` (added in the previous patches in this series) to set the tx_flags of the last skb created in a sendmsg. With this patch, the timestamp recording bits in tx_flags of the skbuff is overridden if SO_TIMESTAMPING is passed in a cmsg. Please note that this is only effective for overriding the recording timestamps flags. Users should enable timestamp reporting (e.g., SOF_TIMESTAMPING_SOFTWARE | SOF_TIMESTAMPING_OPT_ID) using socket options and then should ask for SOF_TIMESTAMPING_TX_* using control messages per sendmsg to sample timestamps for each write. Signed-off-by:Soheil Hassas Yeganeh <soheil@google.com> Acked-by:
Willem de Bruijn <willemb@google.com> Signed-off-by:
David S. Miller <davem@davemloft.net>
Showing
- drivers/net/tun.c 2 additions, 1 deletiondrivers/net/tun.c
- include/net/ipv6.h 4 additions, 2 deletionsinclude/net/ipv6.h
- include/net/sock.h 6 additions, 4 deletionsinclude/net/sock.h
- net/can/raw.c 1 addition, 1 deletionnet/can/raw.c
- net/ipv4/ping.c 3 additions, 2 deletionsnet/ipv4/ping.c
- net/ipv4/raw.c 6 additions, 5 deletionsnet/ipv4/raw.c
- net/ipv4/tcp.c 15 additions, 5 deletionsnet/ipv4/tcp.c
- net/ipv4/udp.c 4 additions, 3 deletionsnet/ipv4/udp.c
- net/ipv6/icmp.c 4 additions, 2 deletionsnet/ipv6/icmp.c
- net/ipv6/ip6_output.c 9 additions, 6 deletionsnet/ipv6/ip6_output.c
- net/ipv6/ping.c 2 additions, 1 deletionnet/ipv6/ping.c
- net/ipv6/raw.c 2 additions, 3 deletionsnet/ipv6/raw.c
- net/ipv6/udp.c 4 additions, 3 deletionsnet/ipv6/udp.c
- net/l2tp/l2tp_ip6.c 1 addition, 1 deletionnet/l2tp/l2tp_ip6.c
- net/packet/af_packet.c 25 additions, 5 deletionsnet/packet/af_packet.c
- net/socket.c 5 additions, 5 deletionsnet/socket.c
Loading
Please register or sign in to comment