[dpdk-dev] [PATCH v3 3/4] ethdev: remove release function for secondary process

Thomas Monjalon thomas at monjalon.net
Wed Oct 17 11:27:47 CEST 2018


17/10/2018 09:25, Andrew Rybchenko:
> On 10/17/18 4:54 AM, Thomas Monjalon wrote:
> > After previous changes, the function rte_eth_dev_release_port()
> > can be used for primary or secondary process as well.
> > The only difference with rte_eth_dev_release_port_secondary()
> > is the shared lock used in rte_eth_dev_release_port().
> >
> > The function rte_eth_dev_release_port_secondary() was recently
> > added in 18.11 cycle.
> >
> > Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> 
> I really like it. Few notes below.
> 
> > diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
> > index b77283ae7..c9bf15d75 100644
> > --- a/drivers/net/null/rte_eth_null.c
> > +++ b/drivers/net/null/rte_eth_null.c
> > @@ -679,9 +679,6 @@ rte_pmd_null_remove(struct rte_vdev_device *dev)
> >   	if (eth_dev == NULL)
> >   		return -1;
> >   
> > -	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> > -		return rte_eth_dev_release_port_secondary(eth_dev);
> > -
> >   	/* mac_addrs must not be freed alone because part of dev_private */
> >   	eth_dev->data->mac_addrs = NULL;
> 
> I think it should be done in primary process only.
> 
> >   	rte_eth_dev_release_port(eth_dev);
> > diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
> > index 1790a8064..bfb5d710d 100644
> > --- a/drivers/net/pcap/rte_eth_pcap.c
> > +++ b/drivers/net/pcap/rte_eth_pcap.c
> > @@ -1228,9 +1228,6 @@ pmd_pcap_remove(struct rte_vdev_device *dev)
> >   	if (eth_dev == NULL)
> >   		return -1;
> >   
> > -	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> > -		return rte_eth_dev_release_port_secondary(eth_dev);
> > -
> >   	internals = eth_dev->data->dev_private;
> >   	if (internals != NULL && internals->phy_mac == 0)
> >   		/* not dynamically allocated, must not be freed */
> 
> Like above I think that assignment (which follows) should be done
> in the primary process only.

I am not sure it has a real impact, because all processes are removing
the device which should be already stopped.
But OK, I will avoid changing shared data in secondary process.




More information about the dev mailing list