On 7/28/21 2:18 PM, Dmitry Kozlyuk wrote:
Hi Andrew,

From: Andrew Rybchenko <andrew.rybche...@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.

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.
However, just stop/start could preserve both indirect actions and flow
rues since it could be more convenient from application point of view.
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?

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.

Reply via email to