| 1078 | } |
| 1079 | |
| 1080 | void |
| 1081 | tcp_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 | } |
| 1121 | done: |
| 1122 | /* flush active streams */ |
| 1123 | tcp_lro_rx_done(lc); |
| 1124 | |
| 1125 | lc->lro_mbuf_count = 0; |
| 1126 | } |
| 1127 | |
| 1128 | static void |
| 1129 | lro_set_mtime(struct timeval *tv, struct timespec *ts) |
no test coverage detected