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/linux (1 of 11 files). Show all

Unified · Split

include/uapi/linux/net_tstamp.h+15−0
@@ -141,4 +141,19 @@ struct scm_ts_pktinfo { · 140 unmodified lines
141141 __u32 reserved[2];
142142 };
143143
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+
144159 #endif /* _NET_TIMESTAMPING_H */