MCPcopy Create free account
hub / github.com/F-Stack/f-stack / tcp_lro_flush_all

Function tcp_lro_flush_all

freebsd/netinet/tcp_lro.c:1080–1126  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1078}
1079
1080void
1081tcp_lro_flush_all(struct lro_ctrl *lc)
1082{
1083 uint64_t seq;
1084 uint64_t nseq;
1085 unsigned x;
1086
1087 /* check if no mbufs to flush */
1088 if (lc->lro_mbuf_count == 0)
1089 goto done;
1090
1091 /* sort all mbufs according to stream */
1092 tcp_lro_sort(lc->lro_mbuf_data, lc->lro_mbuf_count);
1093
1094 /* input data into LRO engine, stream by stream */
1095 seq = 0;
1096 for (x = 0; x != lc->lro_mbuf_count; x++) {
1097 struct mbuf *mb;
1098
1099 /* get mbuf */
1100 mb = lc->lro_mbuf_data[x].mb;
1101
1102 /* get sequence number, masking away the packet index */
1103 nseq = lc->lro_mbuf_data[x].seq & (-1ULL << 24);
1104
1105 /* check for new stream */
1106 if (seq != nseq) {
1107 seq = nseq;
1108
1109 /* flush active streams */
1110 tcp_lro_rx_done(lc);
1111 }
1112
1113 /* add packet to LRO engine */
1114 if (tcp_lro_rx2(lc, mb, 0, 0) != 0) {
1115 /* input packet to network layer */
1116 (*lc->ifp->if_input)(lc->ifp, mb);
1117 lc->lro_queued++;
1118 lc->lro_flushed++;
1119 }
1120 }
1121done:
1122 /* flush active streams */
1123 tcp_lro_rx_done(lc);
1124
1125 lc->lro_mbuf_count = 0;
1126}
1127
1128static void
1129lro_set_mtime(struct timeval *tv, struct timespec *ts)

Callers 2

tcp_lro_queue_mbufFunction · 0.85
iflib_rxeofFunction · 0.85

Calls 3

tcp_lro_sortFunction · 0.85
tcp_lro_rx_doneFunction · 0.85
tcp_lro_rx2Function · 0.85

Tested by

no test coverage detected