[dpdk-dev] [PATCH v2 1/4] ethdev: add Rx offload outer UDP checksum definition

Thomas Monjalon thomas at monjalon.net
Sat Oct 6 00:44:52 CEST 2018

05/10/2018 22:04, Ferruh Yigit:
> On 10/4/2018 6:59 AM, Jerin Jacob wrote:
> > From: Andrew Rybchenko <arybchenko at solarflare.com>
> >> On 03.10.2018 21:14, Jerin Jacob wrote:
> >>> From: Andrew Rybchenko <arybchenko at solarflare.com>
> >>>> On 03.10.2018 20:12, Jerin Jacob wrote:
> >>>>> From: Jerin Jacob <jerin.jacob at caviumnetworks.com>
> >>>>>> From: Andrew Rybchenko <arybchenko at solarflare.com>
> >>>>>>> 3. PKT_RX_L4_CKSUM_MASK description says nothing if it is inner or outer.
> >>>>>>>      May be it is not directly related to changeset, but I think it would be really
> >>>>>>>      useful to clarify it.
> >>>>>> I will update the comment.
> >>>>> Hi Andrew,
> >>>>>
> >>>>> I looked at the other definitions in mbuf.h, according the documentation,
> >>>>> If nothing is mentioned it is treated as inner if the packet is
> >>>>> tunneled else it is outer most. So I would like avoid confusion by
> >>>>> adding "inner" in the exiting PKT_RX_L4_CKSUM_MASK comment.
> >>>>> Technically it is not correct to say "inner" if the packet is not
> >>>>> tunneled. So I am untouching the exiting comment.
> >>>>>
> >>>> Yes, it is incorrect to say that it is inner. How does application find
> >>>> how to treat PKT_RX_L4_CKSUM (inner or outer)?
> >>>> Should it rely on packet type provided in mbuf?
> >>> AFAIK, Finding is it a tunneled packet or not is through ptype or SW has
> >>> to parse the packet. For example, testpmd chooses later method using
> >>> "csum parse-tunnel on <port>" to detect the presence of the tunnel.
> >>
> >> SW parsing of the packet cannot help, since app should be sure
> >> that HW has classified the packet as tunneled and provided information
> >> about inner and outer checksum checks.
> > 
> > 
> > I thought the question was, How does the application find how to treat
> > PKT_RX_L4_CKSUM (inner or outer)?
> > Obviously, ptype will help here
> > Not sure why SW parsing won't help here if SW parses and find it is an
> > inner packet or it is not a tunneled packet. PKT_RX_L4_CKSUM treat as
> > inner checksum for former case and PKT_RX_L4_CKSUM treated as plain l4
> > checksum in the latter case.
> I don't know if PKT_RX_L4_CKSUM is inner or outer with current design,
> but wouldn't be easier if PKT_RX_L4_CKSUM always refer to outer and if tunneled
> use something like PKT_RX_INNER_L4_CKSUM, same for IP and TX.

The return of the come back of the "inner vs outer" discussion :-)
There were some thoughts about what is the most convenient for apps doing
decapsulation of tunnels.
I think the decision was to choose inner as the default, while outer
must be explicited.

Honestly, we should not try to change again the meaning of symbols
having no outer/inner word in their name, except if we have a
very very good reason and arguments.

And for new symbols, we must follow the community decision.

However, we should re-visit the flag PKT_RX_EIP_CKSUM_BAD.

More information about the dev mailing list