[dpdk-dev] [PATCH RFC 11/11] ixgbe/mbuf: add TSO support

Olivier MATZ olivier.matz at 6wind.com
Thu May 15 17:39:48 CEST 2014


Hi Konstantin,

On 05/15/2014 05:09 PM, Ananyev, Konstantin wrote:
> By design PMD not supposed to touch (or even look) into actual packet's data.

I agree on the principle, we should avoid that as much as possible.

> That is one of the reason why we put l2/l3/l4_len fields into the mbuf itself.
> Also it seems a bit strange to calculate one pseudo-header checksum in the upper layer and then
> Recalculate it again inside testpmd/
> So I wonder is it possible to move fix_tcp_phdr_cksum() logic into the upper layer
> (testpmd pkt_burst_checksum_forward())?

The reason why I did this is to define a generic PMD API for TSO:

Today, if you want to want to offload checksum calculation on tx, the
network stack has to calculate the pseudo header checksum. Even if
it could be calculated by the hardware, it's not a problem to
calculate it by software.

Now, because of the hardware, if you do TCP segmentation offload, you
have to calculate the pseudo-header checksum without including the
ip len. It seems to me that it adds some complexity because, depending
on the hardware configuration, the stack has to behave differently.

It seemed more logical to me that the network code that generates TCP
packets has to be identical whatever the driver options. Moreover, if
tomorrow we add another PMD that needs the pseudo-header with ip_len in
all case (TSO or not), we would have to do the same kind function than
fix_tcp_phdr_cksum().

So, I tried to define the API in order to simplify the work of the
network stack developper, even if it does not map the hardware
behavior. Nevertheless, I'm open to discuss it.

Regards,
Olivier



More information about the dev mailing list