mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-30 12:04:07 +00:00
The TCP checksum offload handling in the 8111B/8168B and 8101E PCIe can
apparently be confused by short TCP segments that have been manually padded to the minimum ethernet frame size. The driver does short frame padding in software as a workaround for a bug in the 8169 PCI devices that causes short IP fragments to be corrupted due to an apparent conflict between the hardware autopadding and hardware IP checksumming. To fix this, we avoid software padding for short TCP segments, since the hardware seems to autopad and checksum these correctly (even the older 8169 NICs get these right). Short UDP packets appear to be handled correctly in all cases. This should work around the IP header checksum bug in the 8169 while not tripping the TCP checksum bug in the 8111B/8168B and 8101E.
This commit is contained in:
parent
63cb891e8b
commit
e2bcb489ef
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166223
@ -2071,8 +2071,13 @@ re_encap(sc, m_head, idx)
|
||||
* the mbuf chain has too many fragments so the coalescing code
|
||||
* below can assemble the packet into a single buffer that's
|
||||
* padded out to the mininum frame size.
|
||||
*
|
||||
* Note: this appears unnecessary for TCP, and doing it for TCP
|
||||
* with PCIe adapters seems to result in bad checksums.
|
||||
*/
|
||||
if (arg.rl_flags && (*m_head)->m_pkthdr.len < RL_MIN_FRAMELEN)
|
||||
|
||||
if (arg.rl_flags && !(arg.rl_flags & RL_TDESC_CMD_TCPCSUM) &&
|
||||
(*m_head)->m_pkthdr.len < RL_MIN_FRAMELEN)
|
||||
error = EFBIG;
|
||||
else
|
||||
error = bus_dmamap_load_mbuf(sc->rl_ldata.rl_mtag, map,
|
||||
|
Loading…
Reference in New Issue
Block a user