netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v4 0/4] net-timestamp: introduce a flag to filter out rx software and hardware report
@ 2024-09-05  7:17 Jason Xing
  2024-09-05  7:17 ` [PATCH net-next v4 1/4] net-timestamp: filter out report when setting SOF_TIMESTAMPING_SOFTWARE Jason Xing
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Jason Xing @ 2024-09-05  7:17 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, dsahern, willemdebruijn.kernel,
	shuah, willemb
  Cc: linux-kselftest, netdev, Jason Xing

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_FILTER. Using
it together with SOF_TIMESTAMPING_SOFTWARE can stop reporting the
rx software timestamp.

Similarly, we also filter out the hardware case where one process
enables the rx hardware generation flag, then another process only
passing SOF_TIMESTAMPING_RAW_HARDWARE gets the timestamp. So we can set
both SOF_TIMESTAMPING_RAW_HARDWARE and SOF_TIMESTAMPING_OPT_RX_FILTER
to stop reporting rx hardware timestamp after this patch applied.

v4
Link: https://lore.kernel.org/all/20240830153751.86895-1-kerneljasonxing@gmail.com/
1. revise the doc and commit message (Willem)
2. add patch [2/4] to make the doc right (Willem)
3. add patch [3/4] to cover the hardware use (Willem)
4. add testcase for hardware use.
Note: the reason why I split into 4 patches is try to make each commit
clean, atomic, easy to review.

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 (4):
  net-timestamp: filter out report when setting
    SOF_TIMESTAMPING_SOFTWARE
  net-timestamp: correct the use of SOF_TIMESTAMPING_RAW_HARDWARE
  net-timestamp: extend SOF_TIMESTAMPING_OPT_RX_FILTER for hardware use
  rxtimestamp.c: add the test for SOF_TIMESTAMPING_OPT_RX_FILTER

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

-- 
2.37.3


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2024-09-05 16:58 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-05  7:17 [PATCH net-next v4 0/4] net-timestamp: introduce a flag to filter out rx software and hardware report Jason Xing
2024-09-05  7:17 ` [PATCH net-next v4 1/4] net-timestamp: filter out report when setting SOF_TIMESTAMPING_SOFTWARE Jason Xing
2024-09-05 13:37   ` Willem de Bruijn
2024-09-05 13:45     ` Jason Xing
2024-09-05  7:17 ` [PATCH net-next v4 2/4] net-timestamp: correct the use of SOF_TIMESTAMPING_RAW_HARDWARE Jason Xing
2024-09-05 13:38   ` Willem de Bruijn
2024-09-05 14:02     ` Jason Xing
2024-09-05 14:45       ` Willem de Bruijn
2024-09-05 14:52         ` Jason Xing
2024-09-05  7:17 ` [PATCH net-next v4 3/4] net-timestamp: extend SOF_TIMESTAMPING_OPT_RX_FILTER for hardware use Jason Xing
2024-09-05 13:44   ` Willem de Bruijn
2024-09-05 13:57     ` Jason Xing
2024-09-05 14:46       ` Willem de Bruijn
2024-09-05 15:30         ` Jason Xing
2024-09-05 16:41           ` Willem de Bruijn
2024-09-05 16:57             ` Jason Xing
2024-09-05  7:17 ` [PATCH net-next v4 4/4] rxtimestamp.c: add the test for SOF_TIMESTAMPING_OPT_RX_FILTER Jason Xing
2024-09-05 10:31   ` Jason Xing

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).