Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_lro.c
Context not available. | |||||
tcp_lro_flush_inactive(struct lro_ctrl *lc, const struct timeval *timeout) | tcp_lro_flush_inactive(struct lro_ctrl *lc, const struct timeval *timeout) | ||||
{ | { | ||||
struct lro_entry *le, *le_tmp; | struct lro_entry *le, *le_tmp; | ||||
sbintime_t sbt; | uint64_t now, tov; | ||||
struct bintime bt; | |||||
if (LIST_EMPTY(&lc->lro_active)) | if (LIST_EMPTY(&lc->lro_active)) | ||||
return; | return; | ||||
/* get timeout time */ | /* get timeout time and current time in ns */ | ||||
sbt = getsbinuptime() - tvtosbt(*timeout); | binuptime(&bt); | ||||
now = bintime2ns(&bt); | |||||
tov = ((timeout->tv_sec * 1000000000) + (timeout->tv_usec * 1000)); | |||||
hselasky: Should we change all time computations to use bintime and its helper functions?
Instead of… | |||||
Not Done Inline ActionsComparing a bintime() with a sbinuptime() is that safe? Can you convert this piece to use all bintime's? hselasky: Comparing a bintime() with a sbinuptime() is that safe? Can you convert this piece to use all… | |||||
LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { | 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_active_remove(le); | ||||
tcp_lro_flush(lc, le); | tcp_lro_flush(lc, le); | ||||
} | } | ||||
Context not available. | |||||
{ | { | ||||
if (tp->t_logstate != TCP_LOG_STATE_OFF) { | if (tp->t_logstate != TCP_LOG_STATE_OFF) { | ||||
union tcp_log_stackspecific log; | union tcp_log_stackspecific log; | ||||
struct timeval tv; | struct timeval tv, btv; | ||||
uint32_t cts; | uint32_t cts; | ||||
cts = tcp_get_usecs(&tv); | cts = tcp_get_usecs(&tv); | ||||
Context not available. | |||||
log.u_bbr.cwnd_gain = le->window; | log.u_bbr.cwnd_gain = le->window; | ||||
log.u_bbr.cur_del_rate = (uintptr_t)m; | log.u_bbr.cur_del_rate = (uintptr_t)m; | ||||
log.u_bbr.bw_inuse = (uintptr_t)le->m_head; | 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.flex7 = le->compressed; | ||||
log.u_bbr.pacing_gain = le->uncompressed; | log.u_bbr.pacing_gain = le->uncompressed; | ||||
if (in_epoch(net_epoch_preempt)) | if (in_epoch(net_epoch_preempt)) | ||||
Context not available. | |||||
CURVNET_SET(lc->ifp->if_vnet); | CURVNET_SET(lc->ifp->if_vnet); | ||||
/* get current time */ | /* get current time */ | ||||
lc->lro_last_queue_time = getsbinuptime(); | binuptime(&lc->lro_last_queue_time); | ||||
/* sort all mbufs according to stream */ | /* sort all mbufs according to stream */ | ||||
tcp_lro_sort(lc->lro_mbuf_data, lc->lro_mbuf_count); | tcp_lro_sort(lc->lro_mbuf_data, lc->lro_mbuf_count); | ||||
Context not available. | |||||
#endif | #endif | ||||
/* If no hardware or arrival stamp on the packet add timestamp */ | /* If no hardware or arrival stamp on the packet add timestamp */ | ||||
if ((m->m_flags & (M_TSTMP_LRO | M_TSTMP)) == 0) { | 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; | m->m_flags |= M_TSTMP_LRO; | ||||
} | } | ||||
Context not available. | |||||
int error; | int error; | ||||
/* get current time */ | /* get current time */ | ||||
lc->lro_last_queue_time = getsbinuptime(); | binuptime(&lc->lro_last_queue_time); | ||||
CURVNET_SET(lc->ifp->if_vnet); | CURVNET_SET(lc->ifp->if_vnet); | ||||
error = tcp_lro_rx_common(lc, m, csum, true); | error = tcp_lro_rx_common(lc, m, csum, true); | ||||
Context not available. |
Should we change all time computations to use bintime and its helper functions?
Instead of mixing with sbintime?