Summary: | [em] tftpd (and likely other udp traffic) fails over em(4) unless rxcsum/txcsum disabled [regression] | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Mike Andrews <mandrews> | ||||
Component: | kern | Assignee: | freebsd-net (Nobody) <net> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | sbruno | ||||
Priority: | Normal | Keywords: | IntelNetworking | ||||
Version: | 8.2-PRERELEASE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Mike Andrews
2010-12-05 21:30:08 UTC
Responsible Changed From-To: freebsd-bugs->freebsd-net Over to maintainer(s). Some folowup for kern/152853 with a patch. It seems that the current version of if_em.c (both CURRENT and STABLE8) with txcsum/rxcsum cannot send any UDP packet shorter then TCP header size. The reason is suspicious m_pullup(m_head, poff + sizeof(struct tcphdr)) in common packet em_xmit handling. I've moved this m_pullupi() call to required branches further down and this fixed the issue (UDP ack from tftpd daemon now ok). The code however needs some audit, repeated m_pullups are strange. Sincerely, Petr Lampa *** if_em.c.old 2011-01-18 15:52:21.000000000 +0100 --- if_em.c 2011-01-18 15:58:11.000000000 +0100 *************** *** 1820,1831 **** } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); - m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); - if (m_head == NULL) { - *m_headp = NULL; - return (ENOBUFS); - } if (do_tso) { tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: --- 1820,1831 ---- } ip = (struct ip *)(mtod(m_head, char *) + ip_off); poff = ip_off + (ip->ip_hl << 2); if (do_tso) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); /* * TSO workaround: *************** *** 1849,1854 **** --- 1849,1859 ---- tp->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr, htons(IPPROTO_TCP)); } else if (m_head->m_pkthdr.csum_flags & CSUM_TCP) { + m_head = m_pullup(m_head, poff + sizeof(struct tcphdr)); + if (m_head == NULL) { + *m_headp = NULL; + return (ENOBUFS); + } tp = (struct tcphdr *)(mtod(m_head, char *) + poff); m_head = m_pullup(m_head, poff + (tp->th_off << 2)); if (m_head == NULL) { -- Computer Centre E-mail: lampa@fit.vutbr.cz Faculty of Information Technology Web: http://www.fit.vutbr.cz/ Brno University of Technology Fax: +420 54114-1270 Bozetechova 2, 612 66 Brno, Czech Republic Phone: +420 54114-1225 Hi! 7.4-PRERELEASE is affected too. In short, tftp is broken in recent em(4) driver in all branches due to this bug. 8.1-RELEASE is not affected, 7.3 is fine too. Eugene Grosbein This appears to be applied to if_em.c ... if this is not the case, please correctly reopen this ticket. |