[dpdk-dev] [PATCH] [RFC] ethdev: support flow aging

Stephen Hemminger stephen at networkplumber.org
Mon Mar 16 17:13:27 CET 2020


On Thu, 6 Jun 2019 12:15:50 +0000
Jerin Jacob Kollanukkaran <jerinj at marvell.com> wrote:

> > -----Original Message-----
> > From: Matan Azrad <matan at mellanox.com>
> > Sent: Thursday, June 6, 2019 4:22 PM
> > To: Jerin Jacob Kollanukkaran <jerinj at marvell.com>; Adrien Mazarguil
> > <adrien.mazarguil at 6wind.com>; dev at dpdk.org
> > Subject: [EXT] RE: [PATCH] [RFC] ethdev: support flow aging
> > 
> > Hi Jerin  
> 
> Hi Matan,
> 
> > 
> > From: Jerin Jacob  
> > > > -----Original Message-----
> > > > From: dev <dev-bounces at dpdk.org> On Behalf Of Matan Azrad
> > > > Sent: Sunday, May 26, 2019 3:48 PM
> > > > To: Adrien Mazarguil <adrien.mazarguil at 6wind.com>; dev at dpdk.org
> > > > Subject: [dpdk-dev] [PATCH] [RFC] ethdev: support flow aging
> > > >
> > > > One of the reasons to destroy a flow is the fact that no packet
> > > > matches the flow for "timeout" time.
> > > > For example, when TCP\UDP sessions are suddenly closed.
> > > >
> > > > Currently, there is no any dpdk mechanism for flow aging and the
> > > > applications use there own ways to detect and destroy aged-out flows.
> > > >
> > > > This RFC introduces flow aging APIs to offload the flow aging task
> > > > from the application to the port.
> > > >
> > > > Design:
> > > > - A new rte_flow action: RTE_FLOW_ACTION_TYPE_AGE to set the  
> > timeout  
> > > > and
> > > >   the application flow context for each flow.
> > > > - A new ethdev event: RTE_ETH_EVENT_FLOW_AGED for the driver to  
> > > report  
> > > >   that there are new aged-out flows.
> > > > - A new rte_flow API: rte_flow_get_aged_flows to get the aged-out  
> > flows  
> > > >   contexts from the port.
> > > >
> > > > By this design each PMD can use its best way to do the aging with
> > > > the device offloads supported by its HW.
> > > >
> > > > Signed-off-by: Matan Azrad <matan at mellanox.com>
> > > > ---
> > > >  lib/librte_ethdev/rte_ethdev.h |  1 +
> > > >  lib/librte_ethdev/rte_flow.h   | 56
> > > > ++++++++++++++++++++++++++++++++++++++++++
> > > >  2 files changed, 57 insertions(+)
> > > >
> > > > diff --git a/lib/librte_ethdev/rte_ethdev.h
> > > > b/lib/librte_ethdev/rte_ethdev.h index 1f35e1d..6fc1531 100644
> > > > --- a/lib/librte_ethdev/rte_ethdev.h
> > > > +++ b/lib/librte_ethdev/rte_ethdev.h
> > > > @@ -2771,6 +2771,7 @@ enum rte_eth_event_type {
> > > >  	RTE_ETH_EVENT_NEW,      /**< port is probed */
> > > >  	RTE_ETH_EVENT_DESTROY,  /**< port is released */
> > > >  	RTE_ETH_EVENT_IPSEC,    /**< IPsec offload related event */
> > > > +	RTE_ETH_EVENT_FLOW_AGED,/**< New aged-out flows detected in
> > > > the port  
> > > Does this event supported in HW?  
> > It depends in the PMD implementation and HW capability.
> >   
> > > Or Are planning to implement with alarm or timer.  
> > Again, depends in the PMD implementation.
> >   
> > > Just asking because, if none of the HW supports the interrupt then
> > > only rte_flow_get_aged_flows sync API be enough()  
> > Why?  
> 
> If none of the HW supports it then application/common code can periodically polls it.
> If mlx5 hw supports it then it fine to have interrupt. 
> But I think, we need to have means to express a HW/Implementation does not support its
> As there may following reasons why drivers choose to not take timer/alarm path 
> 1) Some EAL port does not support timer/alarm example: FreeBSD DPDK port
> 2) If we need to support a few killo rules then timer/alarm implementation will be heavy
> So an option to express un supported event would be fine.

This API needs to be defined in a way that it is possible to write
an application that works on multiple types of hardware. This is often hard
to do with DPDK because too often API's are added that are convenient for the
driver writer.

There must be only one way that flow aging notifications happen, and they must
only occur in a specific context. Is this in a normal DPDK thread, or in interrupt thread,
or alarm thread. Choose one and make all drivers do the same thing.


More information about the dev mailing list