lro
struct lro_entry *lro;
lro = ss->lro_active;
ss->lro_active = lro->next;
myri10ge_lro_flush(ss, lro, mbl);
struct lro_entry *lro;
lro = ss->lro_free;
ss->lro_free = lro->next;
kmem_free(lro, sizeof (*lro));
struct lro_entry *lro;
lro = kmem_zalloc(sizeof (*lro), KM_SLEEP);
if (lro == NULL)
lro->next = ss->lro_free;
ss->lro_free = lro;
tcplen = lro->len - sizeof (*ip) - ETHERNET_HEADER_SIZE;
tcp_csum = lro->data_csum;
mac_hcksum_set(lro->m_head, 0, 0, 0,
mbl->cnt += lro->append_cnt;
myri10ge_mbl_append(ss, mbl, lro->m_head);
MYRI10GE_SLICE_STAT_ADD(lro_queued, lro->append_cnt + 1);
lro->m_head = NULL;
lro->timestamp = 0;
lro->append_cnt = 0;
lro->next = ss->lro_free;
ss->lro_free = lro;
struct lro_entry *lro, *curr;
for (lro = ss->lro_active; lro != NULL; lro = lro->next) {
if (lro->source_port == tcp->th_sport &&
lro->dest_port == tcp->th_dport &&
lro->source_ip == ip->ip_src.s_addr &&
lro->dest_ip == ip->ip_dst.s_addr) {
if (unlikely(seq != lro->next_seq)) {
if (ss->lro_active == lro) {
ss->lro_active = lro->next;
while (curr->next != lro)
curr->next = lro->next;
myri10ge_lro_flush(ss, lro, mbl);
if (unlikely(lro->tsval > tsval ||
lro->tsval = tsval;
lro->tsecr = *(ts_ptr + 2);
lro->next_seq += tcp_data_len;
lro->ack_seq = tcp->th_ack;
lro->window = tcp->th_win;
lro->flags |= tcp->th_flags;
lro->append_cnt++;
if (lro->len & 0x1) {
csum = csum + lro->data_csum;
lro->data_csum = csum;
lro->len += tcp_data_len;
lro->m_tail->b_cont = m_head;
lro->m_tail = m_head;
if (lro->len > (65535 - myri10ge_mtu) ||
(lro->append_cnt + 1) == myri10ge_lro_max_aggr) {
if (ss->lro_active == lro) {
ss->lro_active = lro->next;
while (curr->next != lro)
curr->next = lro->next;
myri10ge_lro_flush(ss, lro, mbl);
lro = ss->lro_free;
ss->lro_free = lro->next;
lro->next = ss->lro_active;
ss->lro_active = lro;
lro->source_port = tcp->th_sport;
lro->dest_port = tcp->th_dport;
lro->source_ip = ip->ip_src.s_addr;
lro->dest_ip = ip->ip_dst.s_addr;
lro->next_seq = seq + tcp_data_len;
lro->mss = (uint16_t)tcp_data_len;
lro->ack_seq = tcp->th_ack;
lro->window = tcp->th_win;
lro->flags = tcp->th_flags;
lro->data_csum = csum;
lro->ip = ip;
lro->timestamp = 1;
lro->tsval = ntohl(*(ts_ptr + 1));
lro->tsecr = *(ts_ptr + 2);
lro->len = tot_len;
lro->m_head = m_head;
lro->m_tail = m_head;
myri10ge_lro_flush(struct myri10ge_slice_state *ss, struct lro_entry *lro,
if (lro->append_cnt) {
ip = lro->ip;
ip->ip_len = htons(lro->len - ETHERNET_HEADER_SIZE);
tcp->th_ack = lro->ack_seq;
tcp->th_win = lro->window;
tcp->th_flags = lro->flags;
if (lro->timestamp) {
ts_ptr[1] = htonl(lro->tsval);
ts_ptr[2] = lro->tsecr;
struct lro_entry *lro, struct myri10ge_mblk_list *mbl);
__hal_tcp_lro_capable(iplro_t *ip, tcplro_t *tcp, lro_t *lro, int *ts_off);
__hal_get_lro_session(u8 *eth_hdr, iplro_t *ip, tcplro_t *tcp, lro_t **lro,
__hal_lro_under_optimal_thresh(iplro_t *ip, tcplro_t *tcp, lro_t *lro,
__hal_collapse_ip_hdr(iplro_t *ip, tcplro_t *tcp, lro_t *lro,
__hal_collapse_tcp_hdr(iplro_t *ip, tcplro_t *tcp, lro_t *lro,
__hal_append_lro(iplro_t *ip, tcplro_t **tcp, u32 *seg_len, lro_t *lro,
lro_t **lro, xge_hal_dtr_info_t *ext_info,
__hal_open_lro_session (u8 *buffer, iplro_t *ip, tcplro_t *tcp, lro_t **lro,
*lro = ring_lro->lro_recent = lro_new;
lro_t **lro,
*lro = lro_match = NULL;
*lro = lro_match;
__hal_open_lro_session (eth_hdr, ip, tcp, lro, hldev, ring_lro, free_slot,
lro_t *lro,
if (!lro) return XGE_HAL_FAIL;
if ((lro->total_length + __hal_tcp_seg_len(ip, tcp) ) >
if (lro->sg_num == hldev->config.lro_sg_size) {
lro_t *lro,
lro->total_length += __hal_tcp_seg_len(ip, tcp);
lro_t *lro,
lro->tcp_next_seq_num += __hal_tcp_seg_len(ip, tcp);
lro_t *lro,
(void) __hal_collapse_ip_hdr(ip, *tcp, lro, hldev);
(void) __hal_collapse_tcp_hdr(ip, *tcp, lro, hldev);
lro->sg_num++;
lro_t *lro;
lro = *p_lro;
(tcplro_t *)*tcp, lro, hldev)) {
lro, hldev);
if (lro->sg_num >= hldev->config.lro_sg_size) {
lro->ip_hdr->tot_len = xge_os_htons((*p_lro)->total_length);
lro->ip_hdr->check = xge_os_htons(0);
lro->ip_hdr->check = XGE_LL_IP_FAST_CSUM(((u8 *)(lro->ip_hdr)),
(lro->ip_hdr->version_ihl & 0x0F));
lro->tcp_hdr->ack_seq = lro->tcp_ack_num;
xge_hal_lro_close_session (lro_t *lro)
lro->in_use = 0;
lro_t *lro = &ring_lro->lro_pool[i];
if (!lro->in_use)
lro->ip_hdr->tot_len = xge_os_htons(lro->total_length);
lro->ip_hdr->check = xge_os_htons(0);
lro->ip_hdr->check = XGE_LL_IP_FAST_CSUM(((u8 *)(lro->ip_hdr)),
(lro->ip_hdr->version_ihl & 0x0F));
return lro;
__hal_lro_check_for_session_match(lro_t *lro, tcplro_t *tcp, iplro_t *ip)
if ((lro->ip_hdr->saddr != ip->saddr))
if ((lro->ip_hdr->daddr != ip->daddr))
if ((lro->tcp_hdr->source != tcp->source))
if ((lro->tcp_hdr->dest != tcp->dest))
__hal_tcp_lro_capable(iplro_t *ip, tcplro_t *tcp, lro_t *lro, int *ts_off)
if (lro == NULL)
if (lro == NULL)
if (lro == NULL)
if (lro->ts_off == -1) {
xge_os_memcpy(((char *)lro->tcp_hdr + lro->ts_off + 2),
__hal_open_lro_session (u8 *buffer, iplro_t *ip, tcplro_t *tcp, lro_t **lro,
netif_extra_info_t lro;
lro = *extra;
DTRACE_PROBE1(lro, netif_extra_info_t *, &lro);