aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet/tcp_lro.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netinet/tcp_lro.c')
-rw-r--r--sys/netinet/tcp_lro.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/sys/netinet/tcp_lro.c b/sys/netinet/tcp_lro.c
index 09fc024c3d73..ea84ca191eca 100644
--- a/sys/netinet/tcp_lro.c
+++ b/sys/netinet/tcp_lro.c
@@ -562,16 +562,18 @@ void
tcp_lro_flush_inactive(struct lro_ctrl *lc, const struct timeval *timeout)
{
struct lro_entry *le, *le_tmp;
- sbintime_t sbt;
+ uint64_t now, tov;
+ struct bintime bt;
if (LIST_EMPTY(&lc->lro_active))
return;
- /* get timeout time */
- sbt = getsbinuptime() - tvtosbt(*timeout);
-
+ /* get timeout time and current time in ns */
+ binuptime(&bt);
+ now = bintime2ns(&bt);
+ tov = ((timeout->tv_sec * 1000000000) + (timeout->tv_usec * 1000));
LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) {
- if (sbt >= le->alloc_time) {
+ if (now >= (bintime2ns(&le->alloc_time) + tov)) {
tcp_lro_active_remove(le);
tcp_lro_flush(lc, le);
}
@@ -610,7 +612,7 @@ tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc,
{
if (tp->t_logstate != TCP_LOG_STATE_OFF) {
union tcp_log_stackspecific log;
- struct timeval tv;
+ struct timeval tv, btv;
uint32_t cts;
cts = tcp_get_usecs(&tv);
@@ -637,7 +639,8 @@ tcp_lro_log(struct tcpcb *tp, const struct lro_ctrl *lc,
log.u_bbr.cwnd_gain = le->window;
log.u_bbr.cur_del_rate = (uintptr_t)m;
log.u_bbr.bw_inuse = (uintptr_t)le->m_head;
- log.u_bbr.flex6 = sbttous(lc->lro_last_queue_time);
+ bintime2timeval(&lc->lro_last_queue_time, &btv);
+ log.u_bbr.flex6 = tcp_tv_to_usectick(&btv);
log.u_bbr.flex7 = le->compressed;
log.u_bbr.pacing_gain = le->uncompressed;
if (in_epoch(net_epoch_preempt))
@@ -1446,7 +1449,7 @@ tcp_lro_flush_all(struct lro_ctrl *lc)
CURVNET_SET(lc->ifp->if_vnet);
/* get current time */
- lc->lro_last_queue_time = getsbinuptime();
+ binuptime(&lc->lro_last_queue_time);
/* sort all mbufs according to stream */
tcp_lro_sort(lc->lro_mbuf_data, lc->lro_mbuf_count);
@@ -1739,7 +1742,7 @@ tcp_lro_rx_common(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum, bool use_h
#endif
/* If no hardware or arrival stamp on the packet add timestamp */
if ((m->m_flags & (M_TSTMP_LRO | M_TSTMP)) == 0) {
- m->m_pkthdr.rcv_tstmp = sbttons(lc->lro_last_queue_time);
+ m->m_pkthdr.rcv_tstmp = bintime2ns(&lc->lro_last_queue_time);
m->m_flags |= M_TSTMP_LRO;
}
@@ -1834,7 +1837,7 @@ tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum)
int error;
/* get current time */
- lc->lro_last_queue_time = getsbinuptime();
+ binuptime(&lc->lro_last_queue_time);
CURVNET_SET(lc->ifp->if_vnet);
error = tcp_lro_rx_common(lc, m, csum, true);