summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/net_tstamp.h
diff options
context:
space:
mode:
authorRichard Cochran2018-07-04 00:42:48 +0200
committerDavid S. Miller2018-07-04 15:30:27 +0200
commit80b14dee2bea128928537d61c333f24cb8cbb62f (patch)
tree94fda7f405d0ae225e35a2089111d3ad80006752 /include/uapi/linux/net_tstamp.h
parentnet: Clear skb->tstamp only on the forwarding path (diff)
downloadkernel-qcow2-linux-80b14dee2bea128928537d61c333f24cb8cbb62f.tar.gz
kernel-qcow2-linux-80b14dee2bea128928537d61c333f24cb8cbb62f.tar.xz
kernel-qcow2-linux-80b14dee2bea128928537d61c333f24cb8cbb62f.zip
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. Signed-off-by: Richard Cochran <rcochran@linutronix.de> Signed-off-by: Jesus Sanchez-Palencia <jesus.sanchez-palencia@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/uapi/linux/net_tstamp.h')
-rw-r--r--include/uapi/linux/net_tstamp.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/uapi/linux/net_tstamp.h b/include/uapi/linux/net_tstamp.h
index 4fe104b2411f..c9a77c353b98 100644
--- a/include/uapi/linux/net_tstamp.h
+++ b/include/uapi/linux/net_tstamp.h
@@ -141,4 +141,19 @@ struct scm_ts_pktinfo {
__u32 reserved[2];
};
+/*
+ * SO_TXTIME gets a struct sock_txtime with flags being an integer bit
+ * field comprised of these values.
+ */
+enum txtime_flags {
+ SOF_TXTIME_DEADLINE_MODE = (1 << 0),
+
+ SOF_TXTIME_FLAGS_MASK = (SOF_TXTIME_DEADLINE_MODE)
+};
+
+struct sock_txtime {
+ clockid_t clockid; /* reference clockid */
+ u32 flags; /* flags defined by enum txtime_flags */
+};
+
#endif /* _NET_TIMESTAMPING_H */