Fix endianness bug introduced in r205091.

After controller updates control word in a RX LE, driver converts
it to host byte order. The checksum value in the control word is
stored in big endian form by controller. r205091 didn't account for
the host byte order conversion such that the checksum value was
incorrectly interpreted on big endian architectures which in turn
made all TCP/UDP frames dropped. Make RX checksum offload work
on any architectures by swapping the checksum value.

Reported by:	Sreekanth M. ( kanthms <> netlogicmicro dot com )
Tested by:	Sreekanth M. ( kanthms <> netlogicmicro dot com )
This commit is contained in:
Pyun YongHyeon 2010-12-31 22:18:41 +00:00
parent 962be6dfb3
commit 3c5571b374
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216860

View File

@ -3070,7 +3070,7 @@ msk_rxcsum(struct msk_if_softc *sc_if, uint32_t control, struct mbuf *m)
default:
return;
}
csum = ntohs(sc_if->msk_csum & 0xFFFF);
csum = bswap16(sc_if->msk_csum & 0xFFFF);
/* Checksum fixup for IP options. */
len = hlen - sizeof(struct ip);
if (len > 0) {