[dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' has been queued to stable release 18.02.2

Yang, Zhiyong zhiyong.yang at intel.com
Sun May 27 16:36:16 CEST 2018


Agreed with yuanhan, The patch doesn't resolve resource leakage issue except virtio-user.
rte_eal_cleanup is defined to do this, while it is not implemented completely  for now.

> -----Original Message-----
> From: Yuanhan Liu [mailto:yliu at fridaylinux.org]
> Sent: Sunday, May 27, 2018 12:14 PM
> To: luca.boccassi at gmail.com
> Cc: Yang, Zhiyong <zhiyong.yang at intel.com>; Yao, Lei A <lei.a.yao at intel.com>;
> Iremonger, Bernard <bernard.iremonger at intel.com>; dpdk stable
> <stable at dpdk.org>
> Subject: Re: [dpdk-stable] patch 'app/testpmd: fix exit for virtio-user' has been
> queued to stable release 18.02.2
> 
> On Wed, May 23, 2018 at 01:09:54PM +0100, luca.boccassi at gmail.com wrote:
> > Hi,
> >
> > FYI, your patch has been queued to stable release 18.02.2
> >
> > Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
> > It will be pushed if I get no objections before 05/25/18. So please
> > shout if anyone has objections.
> 
> I'm late, but I'd suggest you to not include this patch, for
> 
> - it's a workaround
> 
> - it tries to "fix" an issue introduced in v18.05, for adding virtio-user
>   server mode.
> 
> 	--yliu
> >
> > Thanks.
> >
> > Luca Boccassi
> >
> > ---
> > >From 8e96cf1276094a75ad0d3fd32912c672489e9811 Mon Sep 17 00:00:00
> > >2001
> > From: Zhiyong Yang <zhiyong.yang at intel.com>
> > Date: Fri, 18 May 2018 17:59:37 +0800
> > Subject: [PATCH] app/testpmd: fix exit for virtio-user
> >
> > [ upstream commit 124909d7e1bf299c959b58c2db7c5fbd7abbb7c0 ]
> >
> > For vdev, just calling rte_eth_dev_close() isn't enough to free all
> > the resources allocated during device probe, e.g. for virtio-user,
> > virtio_user_pmd_remove(), i.e. the remove() method of a vdev driver,
> > needs to be called to unlink the socket file created during device
> > probe. So this patch calls the rte_eth_dev_detach() for vdev when
> > quitting testpmd.
> >
> > vdevs detach on testpmd exit implemented as workaround to fix a
> > virtio-user issue. The issue was virtio-user cleanup is not called and
> > existing socket file not cleaned up which will fail next run.
> >
> > Added a comment that this workaround should be converted to a proper
> > cleanup, not something specific to virtio-user, and not something
> > specific to vdev and testpmd.
> >
> > Fixes: af75078fece3 ("first public release")
> > Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
> >
> > Signed-off-by: Zhiyong Yang <zhiyong.yang at intel.com>
> > Tested-by: Lei Yao <lei.a.yao at intel.com>
> > Acked-by: Bernard Iremonger <bernard.iremonger at intel.com>
> > ---
> >  app/test-pmd/testpmd.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> >
> > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index
> > 05a68a068..98e0a9dc6 100644
> > --- a/app/test-pmd/testpmd.c
> > +++ b/app/test-pmd/testpmd.c
> > @@ -1951,6 +1951,7 @@ detach_port(portid_t port_id)  void
> >  pmd_test_exit(void)
> >  {
> > +	struct rte_device *device;
> >  	portid_t pt_id;
> >
> >  	if (test_done == 0)
> > @@ -1963,6 +1964,18 @@ pmd_test_exit(void)
> >  			fflush(stdout);
> >  			stop_port(pt_id);
> >  			close_port(pt_id);
> > +
> > +			/*
> > +			 * This is a workaround to fix a virtio-user issue that
> > +			 * requires to call clean-up routine to remove existing
> > +			 * socket.
> > +			 * This workaround valid only for testpmd, needs a fix
> > +			 * valid for all applications.
> > +			 * TODO: Implement proper resource cleanup
> > +			 */
> > +			device = rte_eth_devices[pt_id].device;
> > +			if (device && !strcmp(device->driver->name,
> "net_virtio_user"))
> > +				detach_port(pt_id);
> >  		}
> >  	}
> >  	printf("\nBye...\n");
> > --
> > 2.14.2


More information about the stable mailing list