Commit ed00c450 authored by Brandon Schlinker's avatar Brandon Schlinker Committed by Facebook Github Bot

Add WriteFlags::TIMESTAMP_TX

Summary:
`WriteFlags::EOR` currently marks the end of a record (e.g., an HTTP response) and is used to request ACK timestamping.

`WriteFlags::TIMESTAMP_TX` will be used to request timestamping when the entire write buffer has been transmitted by the NIC. If hardware timestamps are unavailable, then the timestamp will be taken when the the entire buffer has been handed to the NIC by the kernel. TX timestamps can be compared to send() timestamps to determine how long the write buffer was waiting in the kernel to be sent to the NIC. In the case of a large CWND + LOWAT, this could be a significant amount of time. In addition, TX timestamps help with throughput calculations as they enable the precise transmit time to be determined.

We may want to rename `WriteFlags::EOR` or add a separate flag for ACK timestamping. For now, I've clarified the purpose of this field.

Reviewed By: yfeldblum

Differential Revision: D15081941

fbshipit-source-id: 239833cd5a0413e7468840960118a038ffdac068
parent d85ae919
...@@ -52,9 +52,10 @@ enum class WriteFlags : uint32_t { ...@@ -52,9 +52,10 @@ enum class WriteFlags : uint32_t {
*/ */
CORK = 0x01, CORK = 0x01,
/* /*
* for a socket that has ACK latency enabled, it will cause the kernel * Used to request timestamping when entire buffer ACKed by remote endpoint.
* to fire a TCP ESTATS event when the last byte of the given write call *
* will be acknowledged. * How timestamping is performed is implementation specific and may rely on
* software or hardware timestamps
*/ */
EOR = 0x02, EOR = 0x02,
/* /*
...@@ -65,6 +66,13 @@ enum class WriteFlags : uint32_t { ...@@ -65,6 +66,13 @@ enum class WriteFlags : uint32_t {
* use msg zerocopy if allowed * use msg zerocopy if allowed
*/ */
WRITE_MSG_ZEROCOPY = 0x08, WRITE_MSG_ZEROCOPY = 0x08,
/*
* Used to request timestamping when entire buffer transmitted by the NIC.
*
* How timestamping is performed is implementation specific and may rely on
* software or hardware timestamps
*/
TIMESTAMP_TX = 0x10,
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment