[dpdk-dev] [PATCH v2] doc: flow rule removal on port stop

Thomas Monjalon thomas at monjalon.net
Thu Nov 26 00:33:58 CET 2020


24/11/2020 15:41, Ajit Khaparde:
> On Wed, Nov 18, 2020 at 8:15 AM Gregory Etelson <getelson at nvidia.com> wrote:
> >
> > There is a discrepancy between RTE ETHDEV API and flow rules guide
> > regarding flow rules maintenance after port stop.  RTE ETHDEV API in
> > librte_ethdev.h declares that flow rules will not be stored in PMD
> > after port stop:
> >  >>>>> Quite start
> >  Please note that some configuration is not stored between calls to
> >  rte_eth_dev_stop()/rte_eth_dev_start(). The following configuration
> >  will be retained:
> >
> >  - MTU
> >  - flow control settings
> >  - receive mode configuration (promiscuous mode, all-multicast mode,
> >    hardware checksum mode, RSS/VMDQ settings etc.)
> >  - VLAN filtering configuration
> >  - default MAC address
> >  - MAC addresses supplied to MAC address array
> >  - flow director filtering mode (but not filtering rules)
> >  - NIC queue statistics mappings
> >  <<<< Quote end
> >
> > PMD cannot always correctly restore flow rules after port stop / port
> > start because application may alter port configuration after port stop
> > without PMD knowledge about undergoing changes.  Consider the
> > following scenario:
> > application configures 2 queues 0 and 1 and creates a flow rule with
> > 'queue index 1' action. After that application stops the port and
> > removes queue 1.
> > Although PMD can implement flow rule shadow copy to be used for
> > restore after port start, attempt to restore flow rule from shadow
> > will fail in example above and PMD could not notify application about
> > that failure.  As the result, flow rules map in HW will differ from
> > what application expects.  In addition, flow rules shadow copy used
> > for port start restore consumes considerable amount of system memory,
> > especially in systems with millions of flow rules.
> >
> > Signed-off-by: Gregory Etelson <getelson at nvidia.com>
> > Acked-by: Ori Kam <orika at nvidia.com>
> Acked-by: Ajit Khaparde <ajit.khaparde at broadcom.com>
> 
> > ---
> > -- PMDs, not applications, are responsible for maintaining flow rules
> > -  configuration when stopping and restarting a port or performing other
> > -  actions which may affect them. They can only be destroyed explicitly by
> > -  applications.
> > +- Applications, not PMDs, are responsible for maintaining flow rules
> > +  configuration when closing, stopping or restarting a port or performing other
> > +  actions which may affect them.
> > +  Applications must assume that after port close, stop or restart all flows
> > +  related to that port are not valid, hardware rules are destroyed and relevant
> > +  PMD resources are released.

In short summary, this rte_flow doc change has 3 reasons:
	- consistency with ethdev API doc
	- avoid unsolvable automatic flow update after re-configuration
	- reduce memory consumption for flow rules

Andrew was asking, in previous version, how to manage reset for error recovery.
As it has been discussed in other threads, an error recovery should be notified
to the application.
We already have RTE_ETH_EVENT_INTR_RESET for VF in case of PF reset,
and a more general recovery notification mechanism is being discussed:
	https://patches.dpdk.org/patch/80094/
Then it will be possible to notify the application that the flow rules
must be restored (among other recovery measures).

For the case of port stop/close, doc update applied, thanks.




More information about the dev mailing list