TCP Checksum offloading

John Wood jwood at
Sun Sep 4 04:28:25 UTC 2011

After looking into the 4.10 code, it looks like there is no evidence of TCP checksum offload being implemented.  If I am wrong please point me in the right direction.

Otherwise, I would expect to need to make the following modifications.

In tcp_input.c line 323

	ti->ti_sum = in_cksum(m, len);

According to the Xilinx notes in the driver, if the checksum calc is ok the TCP checksum will be passed up as 0, otherwise, the actual is passed up allowing the higher layer to drop the packet.  So, I should be able to check the TCP checksum prior to executing line 323, if it is zero call in_cksum, otherwise act as if this call returned 0.

In tcp_output.c line 599

	ti->ti_sum = in_cksum(m, (int)(hdrlen + len));

I think it would be best to add a configuration option, that either calls this or, in the case of Xilinx, this should be set to zero for TCP offload.

Any comments?

Thanks a lot,

-----Original Message-----
From: rtems-users-bounces at [mailto:rtems-users-bounces at] On Behalf Of John Wood
Sent: Saturday, September 03, 2011 4:22 PM
Subject: TCP Checksum offloading

Greetings all,

I am currently have a DMA based port completed for the hard temac in the Xilinx virtex 4 devices.
Performance is not adequate for my needs even with DMA  I achieve excellent performance with Xilkernel 5.0 and lwip version 1.3.2 which utilizes both data caching and the TCP checksum offloading except I find stalls in streaming data, not necessarily in LWIP, could be in Xilinx's adapter/driver but I have not been able to isolate this.  

I would prefer to use rtems as it has more services and I am hoping that the network stack is more stable than lwip as well.  My port is based on rtems 4.9.2, I have not had time to bring it up to 4.9.6 or 4.10.  I have the following questions...

1.  If my driver sets the TCP checksum to zero, will the stack pay attention to this and not do the calcs?
2.  On the tx side, is there a flag to disable TCP checksum in the stack?
3.  Is there an existing BSP that support this functionality that I could reference?
4.  If TCP checksum offloading is implemented, what version of rtems is it available?
5.  If this is not implemented is anyone working on it or could someone point out where I should look to modify this?

Thanks a lot,

rtems-users mailing list
rtems-users at

More information about the users mailing list