[dpdk-dev] [PATCH v2] net/failsafe: fix Rx interrupt reinstallation

Gaëtan Rivet gaetan.rivet at 6wind.com
Wed Feb 14 16:12:53 CET 2018


On Wed, Feb 14, 2018 at 04:01:29PM +0100, Gaëtan Rivet wrote:
> On Wed, Feb 14, 2018 at 04:00:13PM +0100, Gaëtan Rivet wrote:
> > On Wed, Feb 14, 2018 at 02:47:26PM +0000, Matan Azrad wrote:
> > > Fail-safe dev_start() operation can be called by both the application
> > > and the hot-plug alarm mechanism.
> > > 
> > > The installation of Rx interrupt are triggered from dev_start() in any
> > > time it is called while actually the Rx interrupt should be installed
> > > only by the application calls.
> > > 
> > > So, each plug-in event causes reinstallation which causes memory leak
> > > and spoils the fail-safe Rx interrupt mechanism.
> > > 
> > > Trigger the Rx interrupt installation only when it does not exist.
> > > 
> > > Fixes: 9e0360aebf23 ("net/failsafe: register as Rx interrupt mode")
> > > 
> > > Signed-off-by: Matan Azrad <matan at mellanox.com>
> > 
> > Acked-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
> 
> Actually no!
> 
> There is a mistake in the patch, you disabled the uninstall, instead of
> the installation.

Okay, this is weird.

> > > Fail-safe dev_start() operation can be called by both the application
> > > and the hot-plug alarm mechanism.
> > > 
> > > The installation of Rx interrupt are triggered from dev_start() in any
> > > time it is called while actually the Rx interrupt should be installed
> > > only by the application calls.
> > > 
> > > So, each plug-in event causes reinstallation which causes memory leak
> > > and spoils the fail-safe Rx interrupt mechanism.
> > > 
> > > Trigger the Rx interrupt installation only when it does not exist.
> > > 
> > > Fixes: 9e0360aebf23 ("net/failsafe: register as Rx interrupt mode")
> > > 
> > > Signed-off-by: Matan Azrad <matan at mellanox.com>
> > > ---
> > >  drivers/net/failsafe/failsafe_intr.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/net/failsafe/failsafe_intr.c b/drivers/net/failsafe/failsafe_intr.c
> > > index f6ff04d..6b7f9c1 100644
> > > --- a/drivers/net/failsafe/failsafe_intr.c
> > > +++ b/drivers/net/failsafe/failsafe_intr.c
> > > @@ -523,7 +523,7 @@ void failsafe_rx_intr_uninstall_subdevice(struct sub_device *sdev)

Here the context is incorrect, this is not within failsafe_rx_intr_uninstall_subdevice,
so the fix is correct. Confirming my ack then, this seems like a
format-patch bug or something.

> > >         const struct rte_intr_conf *const intr_conf =
> > >                         &priv->dev->data->dev_conf.intr_conf;
> > > 
> > > -       if (intr_conf->rxq == 0)
> > > +       if (intr_conf->rxq == 0 || dev->intr_handle != NULL)
> > >                 return 0;
> > >         if (fs_rx_intr_vec_install(priv) < 0)
> > >                 return -rte_errno;
> > > --
> > > 1.9.5



-- 
Gaëtan Rivet
6WIND


More information about the dev mailing list