This patch introduces SO_TXTIME. User space enables this option in order to pass a desired future transmit time in a CMSG when calling sendmsg(2). The argument to this socket option is a 8-bytes long struct provided by the uapi header net_tstamp.h defined as: struct sock_txtime { clockid_t clockid; u32 flags; }; Note that new fields were added to struct sock by filling a 2-bytes hole found in the struct. For that reason, neither the struct size or number of cachelines were altered.
Showing the changes to include/uapi/linux (1 of 11 files). Show all
Unified · Split
| @@ -141,4 +141,19 @@ struct scm_ts_pktinfo { · 140 unmodified lines | ||
| 141 | 141 | __u32 reserved[2]; |
| 142 | 142 | }; |
| 143 | 143 | |
| 144 | +/* | |
| 145 | + * SO_TXTIME gets a struct sock_txtime with flags being an integer bit | |
| 146 | + * field comprised of these values. | |
| 147 | + */ | |
| 148 | +enum txtime_flags { | |
| 149 | + SOF_TXTIME_DEADLINE_MODE = (1 << 0), | |
| 150 | + | |
| 151 | + SOF_TXTIME_FLAGS_MASK = (SOF_TXTIME_DEADLINE_MODE) | |
| 152 | +}; | |
| 153 | + | |
| 154 | +struct sock_txtime { | |
| 155 | + clockid_t clockid; /* reference clockid */ | |
| 156 | + u32 flags; /* flags defined by enum txtime_flags */ | |
| 157 | +}; | |
| 158 | + | |
| 144 | 159 | #endif /* _NET_TIMESTAMPING_H */ |