Bill Fischofer wrote: 
> If the pktout configuration says "don't checksum" and the per-packet bits
> say "do checksum", then it's up to the implementation to insert the requested
> checksum or else fail the odp_pktout_send() request.

The API spec says the following, implying that it is perfectly fine to request
checksumming through the override and expect it to also happen at packet output
even when the pktio level configuration is "don't checksum". If it were not,
then value 1 for the l3 parameter would not be very useful.

/**
 * Layer 3 checksum insertion override
 *
 * Override checksum insertion configuration per packet. This per packet setting
 * overrides a higher level configuration for checksum insertion into a L3
 * header during packet output processing.
 *
 * @param pkt     Packet handle
 * @param l3      0: do not insert L3 checksum
 *                1: insert L3 checksum
 */
void odp_packet_l3_chksum_insert(odp_packet_t pkt, int l3);

Whether the data returned through the capability query is relevant for the
above is not clear in the API and obviously different people make different
interpretations or assumptions now.

> it shouldn't matter whether HW is involved. Note that the 
> odp_pktout_config_opt_t
> makes no reference to how checksums are performed.

Yes, now it is an internal ODP implementation issue whether HW is involved
in the calculation or not.

> One could argue that these capability bits say whether checksums are 
> HW-assisted
> since any implementation should be able to insert SW checksums as needed.
> Perhaps that's the clarification that's needed? In this case the
> odp_pktin_config_opt_t and odp_pktout_config_opt_t returned by
> odp_pktio_capability() should be clarified as referring to HW support
> for checksum validation/insertion.

I think that is also a possible way to resolve the unclarity. Maybe Petri
wants to comment which way he would prefer when he comes back.

        Janne


Reply via email to