Hi Bogdan,

I am discussing the ODP API, not a particular implementation.

> if HW csum is [...] not configured by application [...]
> then packet will not be modified

Having checksum disabled in config does not mean the checksum will not
be inserted in the packet (in api-next). In means that only if the
override is not set. If override is set to "insert", then the config
setting does not matter (I think this is clear in the API). Whether
the capability matters is more debatable, but see the point blelow.

> if HW csum is NOT calculated (not supported by HW [...]
> then packet will not be modified

The API says "Use odp_pktio_capability() to see which options are
supported by the implementation.". So if the checksum config option
is not supported, it quite obviously should not be set by the
application. But that wording does not make it clear whether requesting
checksum offload through override is still allowed. The API should
be made more clear about it.

The possible alternatives of how the behavior of the override("insert")
could be defined in the API in case the checksum capa is zero include
undefined behavior (i.e. application must never call override("insert")
in that case), not modifying the packet (but calling override("insert")
would be ok, and actually doing the insert (which, IMHO, is implied
by the current text in the API spec even if not intended that way).

> 3. Override set: insert checksum => depends on “HW Supported”

That is just one possible way to define the behavior. Now it is left
ambiguous in the API.

        Janne


> -----Original Message-----
> From: Bogdan Pricope [mailto:bogdan.pric...@linaro.org]
> Sent: Friday, May 19, 2017 11:07 AM
> To: Peltonen, Janne (Nokia - FI/Espoo) <janne.pelto...@nokia.com>
> Cc: Bala Manoharan <bala.manoha...@linaro.org>; Petri Savolainen
> <petri.savolai...@linaro.org>; lng-odp-forward <lng-odp@lists.linaro.org>
> Subject: Re: [lng-odp] [API-NEXT PATCH] api: packet: add per packet checksum 
> control
> 
> Hi Janne,
> 
> There is no undefined behavior: if HW csum is NOT calculated (not
> supported by HW OR not configured by application OR override “NOT
> insert”) then packet will not be modified (packet will be sent with
> the value set by the application).
> 
> “HW Supported” = what dpdk reports as HW capabilities (odp_pktio_capability())
> “Configured” = what is configured by application with
> odp_pktio_config(). This is a subset of what is “HW Supported”.
> 
> 
> Behavior:
> 
> 1. Override not set (default) => depends on „Configured”
> 
> 2. Override set: do not insert checksum => HW csum NOT calculated
> 
> 3. Override set: insert checksum => depends on “HW Supported”
> 
> BR,
> Bogdan

Reply via email to