|
@@ -45,6 +45,22 @@
|
|
|
|
|
|
#include <trace/events/tcp.h>
|
|
|
|
|
|
+/* Refresh clocks of a TCP socket,
|
|
|
+ * ensuring monotically increasing values.
|
|
|
+ */
|
|
|
+void tcp_mstamp_refresh(struct tcp_sock *tp)
|
|
|
+{
|
|
|
+ u64 val = tcp_clock_ns();
|
|
|
+
|
|
|
+ /* departure time for next data packet */
|
|
|
+ if (val > tp->tcp_wstamp_ns)
|
|
|
+ tp->tcp_wstamp_ns = val;
|
|
|
+
|
|
|
+ val = div_u64(val, NSEC_PER_USEC);
|
|
|
+ if (val > tp->tcp_mstamp)
|
|
|
+ tp->tcp_mstamp = val;
|
|
|
+}
|
|
|
+
|
|
|
static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle,
|
|
|
int push_one, gfp_t gfp);
|
|
|
|