mbox series

[net-next,v3,0/2] net-timestamp: introduce a flag to filter out rx software report

Message ID 20240830153751.86895-1-kerneljasonxing@gmail.com (mailing list archive)
Headers show
Series net-timestamp: introduce a flag to filter out rx software report | expand

Message

Jason Xing Aug. 30, 2024, 3:37 p.m. UTC
From: Jason Xing <kernelxing@tencent.com>

When one socket is set SOF_TIMESTAMPING_RX_SOFTWARE which means the
whole system turns on the netstamp_needed_key button, other sockets
that only have SOF_TIMESTAMPING_SOFTWARE will be affected and then
print the rx timestamp information even without setting
SOF_TIMESTAMPING_RX_SOFTWARE generation flag.

How to solve it without breaking users?
We introduce a new flag named SOF_TIMESTAMPING_OPT_RX_SOFTWARE_FILTER.
Using it together with SOF_TIMESTAMPING_SOFTWARE can stop reporting
the rx timestamp.

v3
Link: https://lore.kernel.org/all/20240828160145.68805-1-kerneljasonxing@gmail.com/
1. introduce a new flag to avoid application breakage, suggested by
Willem.
2. add it into the selftests.

v2
Link: https://lore.kernel.org/all/20240825152440.93054-1-kerneljasonxing@gmail.com/
Discussed with Willem
1. update the documentation accordingly
2. add more comments in each patch
3. remove the previous test statements in __sock_recv_timestamp()


Jason Xing (2):
  net-timestamp: filter out report when setting
    SOF_TIMESTAMPING_SOFTWARE
  rxtimestamp.c: add the test for
    SOF_TIMESTAMPING_OPT_RX_SOFTWARE_FILTER

 Documentation/networking/timestamping.rst | 12 ++++++++++++
 include/uapi/linux/net_tstamp.h           |  3 ++-
 net/core/sock.c                           |  4 ++++
 net/ethtool/common.c                      |  1 +
 net/ipv4/tcp.c                            |  7 +++++--
 net/socket.c                              |  5 ++++-
 tools/testing/selftests/net/rxtimestamp.c |  5 +++++
 7 files changed, 33 insertions(+), 4 deletions(-)