RX checksum offloading problem

Yonghyeon PYUN pyunyh at gmail.com
Tue May 13 05:21:39 UTC 2014


On Mon, May 12, 2014 at 01:22:03PM +0200, Michael Tuexen wrote:
> On 12 May 2014, at 03:36, Yonghyeon PYUN <pyunyh at gmail.com> wrote:
> 
> > On Fri, May 09, 2014 at 12:46:48PM +0200, Michael Tuexen wrote:
> >> On 09 May 2014, at 03:35, Yonghyeon PYUN <pyunyh at gmail.com> wrote:
> >> 

[...]

> > Oops, sorry. You're right.  Probably I was confused with old memory
> > when I worked on that area.  I've quickly read IP reassembly code
> > again and as you said, it should work.  However it seems there is a
> > checksumming bug here.
> > 
> > 	/*
> > 	 * In order to do checksumming faster we do 'end-around carry' here
> > 	 * (and not in for{} loop), though it implies we are not going to
> > 	 * reassemble more than 64k fragments.
> > 	 */
> > 	m->m_pkthdr.csum_data =
> > 	    (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16);
> > 
> > I guess the line above didn't account possible carry happened after
> > the computation.  Probably it could be rewritten as the following.
> > 
> > 	while (m->m_pkthdr.csum_data & 0xffff0000)
> > 		m->m_pkthdr.csum_data = (m->m_pkthdr.csum_data & 0xffff) +
> > 		    (m->m_pkthdr.csum_data >> 16);
> I think you are right here. Good catch. Will you fix it?
> 

Done in r265942.


More information about the freebsd-net mailing list