DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: "Ananyev, Konstantin" <konstantin.ananyev@intel.com>,
	Ivan Malov <ivan.malov@oktetlabs.ru>,
	Olivier Matz <olivier.matz@6wind.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] mbuf: outer offsets must be zero for non-tunnel packets
Date: Mon, 24 Jun 2019 16:33:03 +0300	[thread overview]
Message-ID: <f801cb50-badf-6776-3339-fc88ea7fc2a2@solarflare.com> (raw)
In-Reply-To: <2601191342CEEE43887BDE71AB97725801689E3F8B@IRSMSX104.ger.corp.intel.com>

On 6/24/19 3:59 PM, Ananyev, Konstantin wrote:
> Hi Andrew,
>
>> Hi Konstantin,
>>
>> On 6/21/19 2:10 PM, Ananyev, Konstantin wrote:
>> Hi Ivan,
>>
>> Make sure that outer L2 and L3 header length fields are
>> equal to zero for non-tunnel packets in order to ensure
>> consistent and predictable behaviour in network drivers.
>> Explain this expectation in comments to help developers.
>>
>> Signed-off-by: Ivan Malov <ivan.malov@oktetlabs.ru>
>> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
>> ---
>>
>>> Not sure it is a good idea:
>>> 1) it is a change in public API behavior (requirements).
>> I would say that it is a clarification. Yes, in terms of rte_validate_tx_offload()
>> behaviour is it is a change. The area looks grey and we just want to make
>> it either black or white. What is the alternative? Say that outer_l2_len and
>> outer_l3_len content is undefined if packet is not tunnelled and drivers
>> must check (ol_flags & PKT_TX_TUNNEL_MASK) != 0 before usage these fields?
> Yes, that was my thought.
> As I understand, that what is implied right now.
> Otherwise any app that setups tx_offload fieds for rte_eth_tx_burst()
> need to be changed?
>
>> bnxt, fm10k, i40e, ixgbe (depends on PKT_TX_OUTER_IP_CKSUM in fact, but
>> not PKT_TX_TUNNEL_MASK) and ice use these fields w/o tunnel checks (if
>> I read code correctly).
>>
>> enic, mlx4, mlx5, qede and sfc use them in the case of tunnel packet only.
>>
>> I.e. 5 vs 5.
>>
>>
>>> 2) why these 2 particular tx_offload fields only?
>>> If we'll follow that logic we should enforce same rule for other
>>> tx_offload fileds (tso, l4_len, l3_len, etc.)
>> Because it is about tunnel packets and outer_l2_len and outer_l3_len
>> should be either undefined or 0 for non-tunnel packets.
> I understand that, but I think rules for setting/treating tx_offload fields
> should be the same for all fields.
> We either allow any tx_offload field to be undefined when related
> bit(s) in ol_flags are not set, or we need to force people to setup
> whole 64-bit tx_offload value if any of related TX flags are set.

Yes, I agree.

>>> Personally I don't think there will be much gain from it.
>>> Might be better and easier just to fix offending drivers that make wrong assumptions.
>> We would prefer to define as the patch suggests since it allows
>> to avoid conditions.
> It does, and it might simplify things for PMDs...
> But as I said above, it would need changes in the apps that
> do use tx_offload fileds for TX, right?

Yes, it sounds bad. OK, we have discussed it and Ivan will send v2
which simply clarify comments.

It looks like there is no simple conditions when we should require
(in validate function) non-zero outer_l2/l3_len.

Thanks a lot,
Andrew.

  reply	other threads:[~2019-06-24 13:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-12 15:05 [dpdk-dev] [RFC PATCH] " Ivan Malov
2019-04-12 15:05 ` Ivan Malov
2019-06-21 10:34 ` [dpdk-dev] [PATCH] " Ivan Malov
2019-06-21 11:10   ` Ananyev, Konstantin
2019-06-21 12:35     ` Andrew Rybchenko
2019-06-24 12:59       ` Ananyev, Konstantin
2019-06-24 13:33         ` Andrew Rybchenko [this message]
2019-06-24 16:02 ` [dpdk-dev] [PATCH v2] mbuf: outer offsets are undefined " Ivan Malov
2019-06-27 13:09   ` Ananyev, Konstantin
2019-06-27 21:06 ` [dpdk-dev] [PATCH v3] " Ivan Malov
2019-07-01 13:10   ` Olivier Matz
2019-07-01 14:37     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f801cb50-badf-6776-3339-fc88ea7fc2a2@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=ivan.malov@oktetlabs.ru \
    --cc=konstantin.ananyev@intel.com \
    --cc=olivier.matz@6wind.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).