Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_lro.c
Show First 20 Lines • Show All 592 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
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; | ||||
uint64_t now, tov; | uint64_t now, tov; | ||||
struct bintime bt; | struct bintime bt; | ||||
NET_EPOCH_ASSERT(); | |||||
freebsd_darkain.com: Not sure what is going on, but this broke the if_oce driver. Commenting out this one line, and… | |||||
if (LIST_EMPTY(&lc->lro_active)) | if (LIST_EMPTY(&lc->lro_active)) | ||||
return; | return; | ||||
/* get timeout time and current time in ns */ | /* get timeout time and current time in ns */ | ||||
binuptime(&bt); | binuptime(&bt); | ||||
now = bintime2ns(&bt); | now = bintime2ns(&bt); | ||||
tov = ((timeout->tv_sec * 1000000000) + (timeout->tv_usec * 1000)); | tov = ((timeout->tv_sec * 1000000000) + (timeout->tv_usec * 1000)); | ||||
LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { | LIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) { | ||||
▲ Show 20 Lines • Show All 563 Lines • ▼ Show 20 Lines | tcp_lro_get_last_if_ackcmp(struct lro_ctrl *lc, struct lro_entry *le, | ||||
return (m); | return (m); | ||||
} | } | ||||
static struct inpcb * | static struct inpcb * | ||||
tcp_lro_lookup(struct ifnet *ifp, struct lro_parser *pa) | tcp_lro_lookup(struct ifnet *ifp, struct lro_parser *pa) | ||||
{ | { | ||||
struct inpcb *inp; | struct inpcb *inp; | ||||
NET_EPOCH_ASSERT(); | |||||
switch (pa->data.lro_type) { | switch (pa->data.lro_type) { | ||||
#ifdef INET6 | #ifdef INET6 | ||||
case LRO_TYPE_IPV6_TCP: | case LRO_TYPE_IPV6_TCP: | ||||
inp = in6_pcblookup(&V_tcbinfo, | inp = in6_pcblookup(&V_tcbinfo, | ||||
&pa->data.s_addr.v6, | &pa->data.s_addr.v6, | ||||
pa->data.s_port, | pa->data.s_port, | ||||
&pa->data.d_addr.v6, | &pa->data.d_addr.v6, | ||||
pa->data.d_port, | pa->data.d_port, | ||||
▲ Show 20 Lines • Show All 173 Lines • ▼ Show 20 Lines | |||||
#endif | #endif | ||||
void | void | ||||
tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le) | tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le) | ||||
{ | { | ||||
/* Only optimise if there are multiple packets waiting. */ | /* Only optimise if there are multiple packets waiting. */ | ||||
#ifdef TCPHPTS | #ifdef TCPHPTS | ||||
int error; | int error; | ||||
#endif | |||||
NET_EPOCH_ASSERT(); | |||||
#ifdef TCPHPTS | |||||
CURVNET_SET(lc->ifp->if_vnet); | CURVNET_SET(lc->ifp->if_vnet); | ||||
error = tcp_lro_flush_tcphpts(lc, le); | error = tcp_lro_flush_tcphpts(lc, le); | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
if (error != 0) { | if (error != 0) { | ||||
#endif | #endif | ||||
tcp_lro_condense(lc, le); | tcp_lro_condense(lc, le); | ||||
tcp_flush_out_entry(lc, le); | tcp_flush_out_entry(lc, le); | ||||
#ifdef TCPHPTS | #ifdef TCPHPTS | ||||
▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
tcp_lro_flush_all(struct lro_ctrl *lc) | tcp_lro_flush_all(struct lro_ctrl *lc) | ||||
{ | { | ||||
uint64_t seq; | uint64_t seq; | ||||
uint64_t nseq; | uint64_t nseq; | ||||
unsigned x; | unsigned x; | ||||
NET_EPOCH_ASSERT(); | |||||
/* check if no mbufs to flush */ | /* check if no mbufs to flush */ | ||||
if (lc->lro_mbuf_count == 0) | if (lc->lro_mbuf_count == 0) | ||||
goto done; | goto done; | ||||
if (lc->lro_cpu_is_set == 0) { | if (lc->lro_cpu_is_set == 0) { | ||||
if (lc->lro_last_cpu == curcpu) { | if (lc->lro_last_cpu == curcpu) { | ||||
lc->lro_cnt_of_same_cpu++; | lc->lro_cnt_of_same_cpu++; | ||||
/* Have we reached the threshold to declare a cpu? */ | /* Have we reached the threshold to declare a cpu? */ | ||||
if (lc->lro_cnt_of_same_cpu > tcp_lro_cpu_set_thresh) | if (lc->lro_cnt_of_same_cpu > tcp_lro_cpu_set_thresh) | ||||
▲ Show 20 Lines • Show All 424 Lines • ▼ Show 20 Lines | tcp_lro_rx(struct lro_ctrl *lc, struct mbuf *m, uint32_t csum) | ||||
CURVNET_RESTORE(); | CURVNET_RESTORE(); | ||||
return (error); | return (error); | ||||
} | } | ||||
void | void | ||||
tcp_lro_queue_mbuf(struct lro_ctrl *lc, struct mbuf *mb) | tcp_lro_queue_mbuf(struct lro_ctrl *lc, struct mbuf *mb) | ||||
{ | { | ||||
NET_EPOCH_ASSERT(); | |||||
/* sanity checks */ | /* sanity checks */ | ||||
if (__predict_false(lc->ifp == NULL || lc->lro_mbuf_data == NULL || | if (__predict_false(lc->ifp == NULL || lc->lro_mbuf_data == NULL || | ||||
lc->lro_mbuf_max == 0)) { | lc->lro_mbuf_max == 0)) { | ||||
/* packet drop */ | /* packet drop */ | ||||
m_freem(mb); | m_freem(mb); | ||||
return; | return; | ||||
} | } | ||||
Show All 22 Lines |
Not sure what is going on, but this broke the if_oce driver. Commenting out this one line, and then driver comes up and works as expected.
Is there something that is now expected to be set somewhere that the OCE NIC driver isn't properly setting?