[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Hardware Assisted Checksum

From: Kieran Mansley
Subject: Re: [lwip-users] Hardware Assisted Checksum
Date: Wed, 23 Nov 2005 17:29:47 +0000

On Wed, 2005-11-23 at 17:56 +0100, EVS Hardware Dpt wrote:
> Hello,
> I was wondering if anyone already tried to implement a hardware
> assisted checksum routine.
> In our project, data flows through a FPGA wich can easily compute a
> checksum while transferring. So as soon as the data are in our cpu
> ram, we can also have associated checksum. Conceptually, it should be
> easy to compute a TCP checksum by adding TCP (header + pseudo header
> )related data to already computed raw data.
> The problem is how to pass to lower layer (in the case of data going
> out cpu to lan medium) the computed value ? Something like
> tcp_write(pcb, buf, size, copy_mode, RAW_DATA_CHECKSUM) would be
> perfect.
> Do you have any thoughs on this question ?

You can only compute the checksum after you know what size fragment of
data you will be sending in each individual packet.  You can't predict
this in advance or control it, so getting the FPGA to compute it would
not be very useful.  E.g. if you call tcp_write() with a buffer of size
X, the packets on the network could be any fraction of X in length that
the stack finds convenient, and each would need a different checksum.
If you can pass the data through the FPGA after the stack has fragmented
it into packets, and get it to insert the checksum in the appropriate
place in the header, that might be useful, but it would then need to
buffer each packet rather perform it on the stream (as the checksum goes
at the beginning not the end) and so it will introduce some latency.
You basically then have a trade off between CPU use and latency, and
which is best will depend heavily on your hardware.

Hope that helps,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]