[RFC,1/3] librte_ethdev: support device recovery event

Message ID 20200122101654.20824-2-kalesh-anakkur.purayil@broadcom.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series librte_ethdev: error recovery support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Kalesh A P Jan. 22, 2020, 10:16 a.m. UTC
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Adding support for recovery event in rte_eth_event framework.
FW error and FW reset conditions would be managed by PMD.
In such cases, PMD would need recovery events to notify application
about PMD has recovered from FW reset or FW error.

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 lib/librte_ethdev/rte_ethdev.h | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Thomas Monjalon March 11, 2020, 1:20 p.m. UTC | #1
22/01/2020 11:16, Kalesh A P:
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> 
> Adding support for recovery event in rte_eth_event framework.
> FW error and FW reset conditions would be managed by PMD.
> In such cases, PMD would need recovery events to notify application
> about PMD has recovered from FW reset or FW error.
> 
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
> ---
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -3015,6 +3015,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_RECOVERED, /**< port recovered from an error */

What the application is supposed to do when receiving such event?
  
Kalesh A P March 12, 2020, 3:31 a.m. UTC | #2
Hi Thomas,

On Wed, Mar 11, 2020 at 6:50 PM Thomas Monjalon <thomas@monjalon.net> wrote:

> 22/01/2020 11:16, Kalesh A P:
> > From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> >
> > Adding support for recovery event in rte_eth_event framework.
> > FW error and FW reset conditions would be managed by PMD.
> > In such cases, PMD would need recovery events to notify application
> > about PMD has recovered from FW reset or FW error.
> >
> > Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> > Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> > Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
> > ---
> > --- a/lib/librte_ethdev/rte_ethdev.h
> > +++ b/lib/librte_ethdev/rte_ethdev.h
> > @@ -3015,6 +3015,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_RECOVERED, /**< port recovered from an error */
>
> What the application is supposed to do when receiving such event?
>
[Kalesh]:  RTE_ETH_EVENT_RECOVERED event is an indication to the
application that PMD has recovered from the reset and is functional
again(i.e control path and data path is up again). On receiving this event
from PMD, application has to re-create any flow rules created prior to the
reset.
  
Thomas Monjalon March 12, 2020, 7:29 a.m. UTC | #3
12/03/2020 04:31, Kalesh Anakkur Purayil:
> On Wed, Mar 11, 2020 at 6:50 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > 22/01/2020 11:16, Kalesh A P:
> > > From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> > >
> > > Adding support for recovery event in rte_eth_event framework.
> > > FW error and FW reset conditions would be managed by PMD.
> > > In such cases, PMD would need recovery events to notify application
> > > about PMD has recovered from FW reset or FW error.
> > >
> > > Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> > > Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> > > Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
> > > ---
> > > --- a/lib/librte_ethdev/rte_ethdev.h
> > > +++ b/lib/librte_ethdev/rte_ethdev.h
> > > @@ -3015,6 +3015,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_RECOVERED, /**< port recovered from an error */
> >
> > What the application is supposed to do when receiving such event?
> >
> [Kalesh]:  RTE_ETH_EVENT_RECOVERED event is an indication to the
> application that PMD has recovered from the reset and is functional
> again(i.e control path and data path is up again). On receiving this event
> from PMD, application has to re-create any flow rules created prior to the
> reset.

How the application knows that flow rules were resetted?
Is there any other configuration resetted?
These informations must be explicit in the doxygen comments.
  

Patch

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d1a593a..0989f41 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -3015,6 +3015,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_RECOVERED, /**< port recovered from an error */
 	RTE_ETH_EVENT_MAX       /**< max value of this enum */
 };