Skip to content

Commit a0021d2

Browse files
fishilicotgross35
authored andcommitted
Add recent socket timestamping flags for Linux and Android
Linux defines 3 more flags for socket option SO_TIMESTAMPING: - SOF_TIMESTAMPING_BIND_PHC introduced in Linux 5.14 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d463126e23f112629edb01594141ca437a92a108 - SOF_TIMESTAMPING_OPT_ID_TCP introduced in Linux 6.2 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=b534dc46c8ae0165b1b2509be24dbea4fa9c4011 - SOF_TIMESTAMPING_OPT_RX_FILTER introduced in Linux 6.12 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=be8e9eb3750639aa5cffb3f764ca080caed41bd0 These flags are defined in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/net_tstamp.h?h=v6.13 Android C library (bionic) picked this flags up: https://android.googlesource.com/platform//bionic/+/9cdc362a2f7463670a766400defcd332a9edfe19/libc/kernel/uapi/linux/net_tstamp.h Update Linux and Android files accordingly. (backport <#4273>) (cherry picked from commit d1d92db)
1 parent 7a7fe46 commit a0021d2

File tree

5 files changed

+21
-0
lines changed

5 files changed

+21
-0
lines changed

libc-test/build.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,9 @@ fn test_android(target: &str) {
20832083
| "PF_BLOCK_TS"
20842084
| "PF_SUSPEND_TASK" => true,
20852085

2086+
// FIXME(android): Requires >= 6.12 kernel headers.
2087+
"SOF_TIMESTAMPING_OPT_RX_FILTER" => true,
2088+
20862089
_ => false,
20872090
}
20882091
});
@@ -4338,6 +4341,12 @@ fn test_linux(target: &str) {
43384341
// FIXME: Requires >= 6.11 kernel headers.
43394342
"MAP_DROPPABLE" => true,
43404343

4344+
// FIXME(linux): Requires >= 6.2 kernel headers.
4345+
"SOF_TIMESTAMPING_OPT_ID_TCP" => true,
4346+
4347+
// FIXME(linux): Requires >= 6.12 kernel headers.
4348+
"SOF_TIMESTAMPING_OPT_RX_FILTER" => true,
4349+
43414350
_ => false,
43424351
}
43434352
});

libc-test/semver/android.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,9 +2385,12 @@ SOCK_RAW
23852385
SOCK_RDM
23862386
SOCK_SEQPACKET
23872387
SOCK_STREAM
2388+
SOF_TIMESTAMPING_BIND_PHC
23882389
SOF_TIMESTAMPING_OPT_CMSG
23892390
SOF_TIMESTAMPING_OPT_ID
2391+
SOF_TIMESTAMPING_OPT_ID_TCP
23902392
SOF_TIMESTAMPING_OPT_PKTINFO
2393+
SOF_TIMESTAMPING_OPT_RX_FILTER
23912394
SOF_TIMESTAMPING_OPT_STATS
23922395
SOF_TIMESTAMPING_OPT_TSONLY
23932396
SOF_TIMESTAMPING_OPT_TX_SWHW

libc-test/semver/linux.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2898,9 +2898,12 @@ SOCK_NONBLOCK
28982898
SOCK_PACKET
28992899
SOCK_RAW
29002900
SOCK_RDM
2901+
SOF_TIMESTAMPING_BIND_PHC
29012902
SOF_TIMESTAMPING_OPT_CMSG
29022903
SOF_TIMESTAMPING_OPT_ID
2904+
SOF_TIMESTAMPING_OPT_ID_TCP
29032905
SOF_TIMESTAMPING_OPT_PKTINFO
2906+
SOF_TIMESTAMPING_OPT_RX_FILTER
29042907
SOF_TIMESTAMPING_OPT_STATS
29052908
SOF_TIMESTAMPING_OPT_TSONLY
29062909
SOF_TIMESTAMPING_OPT_TX_SWHW

src/unix/linux_like/android/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2942,6 +2942,9 @@ pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11;
29422942
pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12;
29432943
pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13;
29442944
pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14;
2945+
pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15;
2946+
pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16;
2947+
pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17;
29452948

29462949
#[deprecated(
29472950
since = "0.2.55",

src/unix/linux_like/linux/mod.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4544,6 +4544,9 @@ pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11;
45444544
pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12;
45454545
pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13;
45464546
pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14;
4547+
pub const SOF_TIMESTAMPING_BIND_PHC: c_uint = 1 << 15;
4548+
pub const SOF_TIMESTAMPING_OPT_ID_TCP: c_uint = 1 << 16;
4549+
pub const SOF_TIMESTAMPING_OPT_RX_FILTER: c_uint = 1 << 17;
45474550
pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0;
45484551
pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1;
45494552

0 commit comments

Comments
 (0)