Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/ixl/ixl_txrx.c
Show First 20 Lines • Show All 1,394 Lines • ▼ Show 20 Lines | #if defined(INET6) || defined(INET) | ||||
** - no LRO resources, or | ** - no LRO resources, or | ||||
** - lro enqueue fails | ** - lro enqueue fails | ||||
*/ | */ | ||||
if (rxr->lro.lro_cnt != 0) | if (rxr->lro.lro_cnt != 0) | ||||
if (tcp_lro_rx(&rxr->lro, m, 0) == 0) | if (tcp_lro_rx(&rxr->lro, m, 0) == 0) | ||||
return; | return; | ||||
} | } | ||||
#endif | #endif | ||||
IXL_RX_UNLOCK(rxr); | |||||
(*ifp->if_input)(ifp, m); | (*ifp->if_input)(ifp, m); | ||||
IXL_RX_LOCK(rxr); | |||||
} | } | ||||
static inline void | static inline void | ||||
ixl_rx_discard(struct rx_ring *rxr, int i) | ixl_rx_discard(struct rx_ring *rxr, int i) | ||||
{ | { | ||||
struct ixl_rx_buf *rbuf; | struct ixl_rx_buf *rbuf; | ||||
▲ Show 20 Lines • Show All 311 Lines • ▼ Show 20 Lines | next_desc: | ||||
/* Advance our pointers to the next descriptor. */ | /* Advance our pointers to the next descriptor. */ | ||||
if (++i == que->num_desc) | if (++i == que->num_desc) | ||||
i = 0; | i = 0; | ||||
/* Now send to the stack or do LRO */ | /* Now send to the stack or do LRO */ | ||||
if (sendmp != NULL) { | if (sendmp != NULL) { | ||||
rxr->next_check = i; | rxr->next_check = i; | ||||
IXL_RX_UNLOCK(rxr); | |||||
ixl_rx_input(rxr, ifp, sendmp, ptype); | ixl_rx_input(rxr, ifp, sendmp, ptype); | ||||
IXL_RX_LOCK(rxr); | |||||
i = rxr->next_check; | i = rxr->next_check; | ||||
} | } | ||||
/* Every 8 descriptors we go to refresh mbufs */ | /* Every 8 descriptors we go to refresh mbufs */ | ||||
if (processed == 8) { | if (processed == 8) { | ||||
ixl_refresh_mbufs(que, i); | ixl_refresh_mbufs(que, i); | ||||
processed = 0; | processed = 0; | ||||
} | } | ||||
} | } | ||||
/* Refresh any remaining buf structs */ | /* Refresh any remaining buf structs */ | ||||
if (ixl_rx_unrefreshed(que)) | if (ixl_rx_unrefreshed(que)) | ||||
ixl_refresh_mbufs(que, i); | ixl_refresh_mbufs(que, i); | ||||
rxr->next_check = i; | rxr->next_check = i; | ||||
IXL_RX_UNLOCK(rxr); | |||||
#if defined(INET6) || defined(INET) | #if defined(INET6) || defined(INET) | ||||
/* | /* | ||||
* Flush any outstanding LRO work | * Flush any outstanding LRO work | ||||
*/ | */ | ||||
#if __FreeBSD_version >= 1100105 | #if __FreeBSD_version >= 1100105 | ||||
tcp_lro_flush_all(lro); | tcp_lro_flush_all(lro); | ||||
#else | #else | ||||
struct lro_entry *queued; | struct lro_entry *queued; | ||||
while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { | while ((queued = SLIST_FIRST(&lro->lro_active)) != NULL) { | ||||
SLIST_REMOVE_HEAD(&lro->lro_active, next); | SLIST_REMOVE_HEAD(&lro->lro_active, next); | ||||
tcp_lro_flush(lro, queued); | tcp_lro_flush(lro, queued); | ||||
} | } | ||||
#endif | #endif | ||||
#endif /* defined(INET6) || defined(INET) */ | #endif /* defined(INET6) || defined(INET) */ | ||||
IXL_RX_UNLOCK(rxr); | |||||
return (FALSE); | return (FALSE); | ||||
} | } | ||||
/********************************************************************* | /********************************************************************* | ||||
* | * | ||||
* Verify that the hardware indicated that the checksum is valid. | * Verify that the hardware indicated that the checksum is valid. | ||||
* Inform the stack about the status of checksum so that stack | * Inform the stack about the status of checksum so that stack | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |