Commit 17df5922 authored by Brandon Schlinker's avatar Brandon Schlinker Committed by Facebook GitHub Bot

Update WriteFlags::EOR and add timestamp flags

Summary:
We have traditionally used `WriteFlags::EOR` to communicate that ACK timestamping should occur. This is confusing and mostly for legacy reasons when we had a custom kernel patch that would send ACK timestamps if the EoR flag was set.

Creating proper flags for ACK and SCHED timestamps. I will integrate the logic that uses these flags into `AsyncSocket` in a subsequent diff.

Differential Revision: D22039799

fbshipit-source-id: 23f534365475bb67f91d86657919cce02439f0c8
parent 9b15aded
...@@ -44,10 +44,15 @@ enum class WriteFlags : uint32_t { ...@@ -44,10 +44,15 @@ enum class WriteFlags : uint32_t {
*/ */
CORK = 0x01, CORK = 0x01,
/* /*
* Used to request timestamping when entire buffer ACKed by remote endpoint. * Set MSG_EOR flag when writing the last byte of the buffer to the socket.
* *
* How timestamping is performed is implementation specific and may rely on * EOR tracking may need to be enabled to ensure that the MSG_EOR flag is only
* software or hardware timestamps * set when the final byte is being written.
*
* - If the MSG_EOR flag is set, it is marked in the corresponding
* tcp_skb_cb; this can be useful when debugging.
* - The kernel uses it to decide whether socket buffers can be collapsed
* together (see tcp_skb_can_collapse_to).
*/ */
EOR = 0x02, EOR = 0x02,
/* /*
...@@ -59,12 +64,23 @@ enum class WriteFlags : uint32_t { ...@@ -59,12 +64,23 @@ enum class WriteFlags : uint32_t {
*/ */
WRITE_MSG_ZEROCOPY = 0x08, WRITE_MSG_ZEROCOPY = 0x08,
/* /*
* Used to request timestamping when entire buffer transmitted by the NIC. * Request timestamp when entire buffer transmitted by the NIC.
* *
* How timestamping is performed is implementation specific and may rely on * How timestamping is performed is implementation specific and may rely on
* software or hardware timestamps * software or hardware timestamps
*/ */
TIMESTAMP_TX = 0x10, TIMESTAMP_TX = 0x10,
/*
* Request timestamp when entire buffer ACKed by remote endpoint.
*
* How timestamping is performed is implementation specific and may rely on
* software or hardware timestamps
*/
TIMESTAMP_ACK = 0x20,
/*
* Request timestamp when entire buffer has entered packet scheduler.
*/
TIMESTAMP_SCHED = 0x40,
}; };
/* /*
......
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