History

net: Add a new socket option for a future transmit time.

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.

Richard Cochran committed 8 years ago

Commit 80b14de1 parent c47d8c211 files · +84 −0Browse files

Showing the changes to include/uapi (2 of 11 files). Show all

Unified · Split

2 files
  1. include/uapi/asm-generic/socket.h +3 −0
  2. include/uapi/linux/net_tstamp.h +15 −0
include/uapi/asm-generic/socket.h+3−0
@@ -107,4 +107,7 @@ · 106 unmodified lines
107 107
108#define SO_ZEROCOPY 60108#define SO_ZEROCOPY 60
109 109
110#define SO_TXTIME 61
111#define SCM_TXTIME SO_TXTIME
112
110#endif /* __ASM_GENERIC_SOCKET_H */113#endif /* __ASM_GENERIC_SOCKET_H */
include/uapi/linux/net_tstamp.h+15−0
@@ -141,4 +141,19 @@ struct scm_ts_pktinfo { · 140 unmodified lines
141 __u32 reserved[2];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 */
148enum txtime_flags {
149 SOF_TXTIME_DEADLINE_MODE = (1 << 0),
150
151 SOF_TXTIME_FLAGS_MASK = (SOF_TXTIME_DEADLINE_MODE)
152};
153
154struct sock_txtime {
155 clockid_t clockid; /* reference clockid */
156 u32 flags; /* flags defined by enum txtime_flags */
157};
158
144#endif /* _NET_TIMESTAMPING_H */159#endif /* _NET_TIMESTAMPING_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t