From: Dmitry Kozlyuk <dkozlyuk@nvidia.com>
To: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: David Marchand <david.marchand@redhat.com>, Ori Kam <orika@nvidia.com>
Subject: Re: [dpdk-dev] [PATCH 0/4] net/mlx5: keep indirect actions across port restart
Date: Wed, 28 Jul 2021 14:08:20 +0000 [thread overview]
Message-ID: <CH0PR12MB5091648A7C11E318CE99B12BB9EA9@CH0PR12MB5091.namprd12.prod.outlook.com> (raw)
In-Reply-To: <15ebcccf-d317-8ade-22f2-1a1acd24ea96@oktetlabs.ru>
> -----Original Message-----
> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
> Sent: 28 июля 2021 г. 15:27
> To: Dmitry Kozlyuk <dkozlyuk@nvidia.com>; dev@dpdk.org
> Cc: David Marchand <david.marchand@redhat.com>
> Subject: Re: [dpdk-dev] [PATCH 0/4] net/mlx5: keep indirect actions across port
> restart
>
> External email: Use caution opening links or attachments
>
>
> On 7/28/21 2:18 PM, Dmitry Kozlyuk wrote:
> > Hi Andrew,
> >
> >> From: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru> On 7/27/21
> >> 10:31 AM, Dmitry Kozlyuk wrote:
> >>> It was unspecified what happens to indirect actions when a port is
> >>> stopped, possibly reconfigured, and started again. MLX5 PMD, the
> >>> first one to use indirect actions, intended to keep them across such
> >>> a sequence, but the implementation was buggy. Patches 1-3 fix the
> >>> PMD behavior, patch 4 adds common specification with rationale.
> >>
> >> I'm sorry, but it looks very inconsistent. If flow rules are not
> >> preserved across restart, indirect actions should not be preserved as
> >> well. We need very strong reasons to introduce the inconsistency.
> >
> > Indirect actions really don't need to behave like flow rules. They are just
> objects owned by the port and they can exist while it exists. Consider a counter:
> stopping and starting the port doesn't logically affect its state. MLX5 PMD
> destroys flow rules on port stop for internal reasons and documents this
> behavior, but ethdev API doesn't require it either.
>
> It all sounds bad. All these gray areas just make it hard for DPDK applications to
> switch from one HW to another.
> Any rules must not be motivated because of some PMD internal reasons.
> We should not adjust ethdev rules to fit some PMD behaviour.
> ethdev rules should be motivated by common sense and convenience from
> applications point of view.
That is what this patchset is trying to do.
Current specification is unclear, application doesn't know
if it should destroy and recreate indirect actions or not.
MLX5 PMD is only mentioned above because it's the only one implementing
indirect action API, but it's not an attempt to tailor API to it, quite the opposite.
> For example, it is strange to preserve indirect RSS action with queues specified
> across device reconfiguration when queues count may change.
> I'd say that reconfiguration must drop all indirect actions.
I don't like it because 1) it is implicit, 2) it may be unnecessary even for RSS, and it's only one example of an indirect action.
> However, just stop/start could preserve both indirect actions and flow rues since
> it could be more convenient from application point of view.
For many cases I agree, but not for all.
What if an application creates numerous flows from its data path?
They are transient by nature, but PMD will have to save them all
at the cost of RAM and CPU but without benefit to anyone.
OTOH, application always controls indirect actions it creates,
because it is going to reuse or query them.
Therefore, it is both logical and convenient to preserve them.
> If application really wants to remove all flow rules, it can call rte_flow_flush().
> The strong reason to flush indirect actions and flow rules across restart is
> possible actions or rules restore failure on start.
> However, may be it is sufficient to document that start should really fail, if it
> can't restore everything and application should retry after rte_flow_flush()
> taking it into account.
>
> >> If we finally accept it, I think it would be very useful to care
> >> about PMDs which cannot preserve it in HW across restart from the
> >> very beginning and save it in ethdev layer and restore on start
> >> automatically (i.e. do not force all such PMDs to care about the restore
> internally and basically duplicate the code).
> >
> > Or keeping indirect actions can be an advertised PMD capability.
> > Given Ori's comments to patch 4, I think the common spec needs more work.
> > For this patchset that fixes MLX5 we can have the behavior documented for
> PMD and not require it from all the drivers.
>
> Are you going to drop 4th patch?
Yes.
> In general documenting PMD behaviour specifics in its documentation is a wrong
> direction since it does not help DPDK applications to be portable across different
> HW.
I agree. But currently there is a clear resource leak in MLX5 PMD, that can be solved either by destroying indirect actions on port stop or by keeping them (this is what PMD maintainers prefer). The leak should be fixed and what happens to indirect actions must be clearly documented. Ideally the fix should be aligned with common ethdev API, but if you and Ori think its design is wrong, then at least behavior can be described in PMD docs and later fixed or promoted to API.
next prev parent reply other threads:[~2021-07-28 14:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 7:31 Dmitry Kozlyuk
2021-07-27 7:31 ` [dpdk-dev] [PATCH 1/4] net/mlx5: discover max flow priority using DevX Dmitry Kozlyuk
2021-07-27 7:31 ` [dpdk-dev] [PATCH 2/4] net/mlx5: create drop queue " Dmitry Kozlyuk
2021-07-27 7:31 ` [dpdk-dev] [PATCH 3/4] net/mlx5: preserve indirect actions across port restart Dmitry Kozlyuk
2021-07-27 7:31 ` [dpdk-dev] [PATCH 4/4] ethdev: document indirect flow action life cycle Dmitry Kozlyuk
2021-07-28 9:50 ` Ori Kam
2021-07-28 8:05 ` [dpdk-dev] [PATCH 0/4] net/mlx5: keep indirect actions across port restart Andrew Rybchenko
2021-07-28 11:18 ` Dmitry Kozlyuk
2021-07-28 12:07 ` Ori Kam
2021-07-28 12:26 ` Andrew Rybchenko
2021-07-28 14:08 ` Dmitry Kozlyuk [this message]
2021-07-28 17:07 ` Ori Kam
2021-07-29 14:00 ` [dpdk-dev] [PATCH v2 " Dmitry Kozlyuk
2021-07-29 14:00 ` [dpdk-dev] [PATCH v2 1/3] net/mlx5: discover max flow priority using DevX Dmitry Kozlyuk
2021-07-29 14:00 ` [dpdk-dev] [PATCH v2 2/3] net/mlx5: create drop queue " Dmitry Kozlyuk
2021-07-29 14:00 ` [dpdk-dev] [PATCH v2 3/3] net/mlx5: preserve indirect actions across port restart Dmitry Kozlyuk
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=CH0PR12MB5091648A7C11E318CE99B12BB9EA9@CH0PR12MB5091.namprd12.prod.outlook.com \
--to=dkozlyuk@nvidia.com \
--cc=andrew.rybchenko@oktetlabs.ru \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=orika@nvidia.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).