Skip to content

net-timestamp: introduce a flag to filter out rx software and hardware report

Jason Xing linux-doc netdev 4 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v6 Latest2 patches 3 repliesApplied 2/2
  2. v52 patches 7 repliesSuperseded
  3. v44 patches 13 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v32 patches12 repliesSuperseded

Patches in v6 All 2 applied

#Subject and filesSizeRepliesApplied
1/2net-timestamp: introduce SOF_TIMESTAMPING_OPT_RX_FILTER flagDocumentation/networking/timestamping.rst include/uapi/linux/net_tstamp.h net/ethtool/common.c +2 more+35 -52 repliesApplied
2/2net-timestamp: add selftests for SOF_TIMESTAMPING_OPT_RX_FILTERtools/testing/selftests/net/rxtimestamp.c+18 -01 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchWillem de Bruijn
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v6 thread

Cover letter [PATCH net-next v6 0/2] net-timestamp: introduce a flag to filter out rx software and hardware report

From: Jason Xing <[email protected]>

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.

v6

1. add the description in doc provided by Willem
2. align the if statements (Willem)

v5

1. squash the hardware case patch into this one (Willem)
2. update corresponding commit message and doc (Willem)
3. remove the limitation in sock_set_timestamping() and restore the simplification branches. (Willem)
4. add missing type and another test in selftests

v4

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

1. introduce a new flag to avoid application breakage, suggested by Willem.
2. add it into the selftests.

v2

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: introduce SOF_TIMESTAMPING_OPT_RX_FILTER flag
net-timestamp: add selftests for SOF_TIMESTAMPING_OPT_RX_FILTER

 Documentation/networking/timestamping.rst | 17 +++++++++++++++++
 include/uapi/linux/net_tstamp.h           |  3 ++-
 net/ethtool/common.c                      |  1 +
 net/ipv4/tcp.c                            |  9 +++++++--
 net/socket.c                              | 10 ++++++++--
 tools/testing/selftests/net/rxtimestamp.c | 18 ++++++++++++++++++
 6 files changed, 53 insertions(+), 5 deletions(-)
Signature · 1 line
2.37.3