Lines Matching defs:le

73 	struct lro_entry *le;
85 le = (struct lro_entry *)malloc(sizeof(*le), M_DEVBUF,
87 if (le == NULL) {
93 SLIST_INSERT_HEAD(&lc->lro_free, le, next);
102 struct lro_entry *le;
105 le = SLIST_FIRST(&lc->lro_free);
107 free(le, M_DEVBUF);
135 tcp_lro_rx_csum_fixup(struct lro_entry *le, void *l3hdr, struct tcphdr *th,
144 switch (le->eh_type) {
151 if (le->append_cnt == 0)
168 if (le->append_cnt == 0)
199 struct lro_entry *le, *le_tmp;
207 SLIST_FOREACH_SAFE(le, &lc->lro_active, next, le_tmp) {
208 if (timevalcmp(&tv, &le->mtime, >=)) {
209 SLIST_REMOVE(&lc->lro_active, le, lro_entry, next);
210 tcp_lro_flush(lc, le);
216 tcp_lro_flush(struct lro_ctrl *lc, struct lro_entry *le)
219 if (le->append_cnt > 0) {
223 p_len = htons(le->p_len);
224 switch (le->eh_type) {
230 ip6 = le->le_ip6;
233 le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID |
235 le->p_len += ETHER_HDR_LEN + sizeof(*ip6);
248 ip4 = le->le_ip4;
264 le->m_head->m_pkthdr.csum_flags = CSUM_DATA_VALID |
266 le->p_len += ETHER_HDR_LEN;
273 le->m_head->m_pkthdr.csum_data = 0xffff;
274 le->m_head->m_pkthdr.len = le->p_len;
277 th->th_ack = le->ack_seq;
278 th->th_win = le->window;
280 if (le->timestamp != 0) {
284 ts_ptr[1] = htonl(le->tsval);
285 ts_ptr[2] = le->tsecr;
289 le->ulp_csum += p_len;
290 le->ulp_csum += tcp_lro_csum_th(th);
291 while (le->ulp_csum > 0xffff)
292 le->ulp_csum = (le->ulp_csum >> 16) +
293 (le->ulp_csum & 0xffff);
294 th->th_sum = (le->ulp_csum & 0xffff);
301 (*lc->ifp->if_input)(lc->ifp, le->m_head);
302 lc->lro_queued += le->append_cnt + 1;
304 bzero(le, sizeof(*le));
305 SLIST_INSERT_HEAD(&lc->lro_free, le, next);
371 struct lro_entry *le;
478 SLIST_FOREACH(le, &lc->lro_active, next) {
479 if (le->eh_type != eh_type)
481 if (le->source_port != th->th_sport ||
482 le->dest_port != th->th_dport)
487 if (bcmp(&le->source_ip6, &ip6->ip6_src,
489 bcmp(&le->dest_ip6, &ip6->ip6_dst,
496 if (le->source_ip4 != ip4->ip_src.s_addr ||
497 le->dest_ip4 != ip4->ip_dst.s_addr)
504 if (le->p_len > (65535 - tcp_data_len)) {
505 SLIST_REMOVE(&lc->lro_active, le, lro_entry, next);
506 tcp_lro_flush(lc, le);
511 if (__predict_false(seq != le->next_seq ||
512 (tcp_data_len == 0 && le->ack_seq == th->th_ack))) {
514 SLIST_REMOVE(&lc->lro_active, le, lro_entry, next);
515 tcp_lro_flush(lc, le);
523 if (__predict_false(le->tsval > tsval ||
526 le->tsval = tsval;
527 le->tsecr = *(ts_ptr + 2);
530 le->next_seq += tcp_data_len;
531 le->ack_seq = th->th_ack;
532 le->window = th->th_win;
533 le->append_cnt++;
536 le->ulp_csum += tcp_lro_rx_csum_fixup(le, l3hdr, th,
545 le->p_len += tcp_data_len;
555 le->m_tail->m_next = m;
556 le->m_tail = m_last(m);
562 if (le->p_len > (65535 - lc->ifp->if_mtu)) {
563 SLIST_REMOVE(&lc->lro_active, le, lro_entry, next);
564 tcp_lro_flush(lc, le);
566 getmicrotime(&le->mtime);
576 le = SLIST_FIRST(&lc->lro_free);
578 SLIST_INSERT_HEAD(&lc->lro_active, le, next);
579 getmicrotime(&le->mtime);
585 le->le_ip6 = ip6;
586 le->source_ip6 = ip6->ip6_src;
587 le->dest_ip6 = ip6->ip6_dst;
588 le->eh_type = eh_type;
589 le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN - sizeof(*ip6);
594 le->le_ip4 = ip4;
595 le->source_ip4 = ip4->ip_src.s_addr;
596 le->dest_ip4 = ip4->ip_dst.s_addr;
597 le->eh_type = eh_type;
598 le->p_len = m->m_pkthdr.len - ETHER_HDR_LEN;
602 le->source_port = th->th_sport;
603 le->dest_port = th->th_dport;
605 le->next_seq = seq + tcp_data_len;
606 le->ack_seq = th->th_ack;
607 le->window = th->th_win;
609 le->timestamp = 1;
610 le->tsval = ntohl(*(ts_ptr + 1));
611 le->tsecr = *(ts_ptr + 2);
622 KASSERT(le->ulp_csum == 0, ("%s: le=%p le->ulp_csum=0x%04x\n",
623 __func__, le, le->ulp_csum));
625 le->ulp_csum = tcp_lro_rx_csum_fixup(le, l3hdr, th, tcp_data_len,
630 le->m_head = m;
631 le->m_tail = m_last(m);