patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: "John W. Linville" <linville@tuxdriver.com>,
	Declan Doherty <declan.doherty@intel.com>,
	Chas Williams <chas3@att.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	Shreyansh Jain <shreyansh.jain@nxp.com>,
	Gaetan Rivet <gaetan.rivet@6wind.com>,
	Tetsuya Mukawa <mtetsuyah@gmail.com>,
	Santosh Shukla <santosh.shukla@caviumnetworks.com>,
	Jerin Jacob <jerin.jacob@caviumnetworks.com>,
	Keith Wiles <keith.wiles@intel.com>,
	Maxime Coquelin <maxime.coquelin@redhat.com>,
	Tiwei Bie <tiwei.bie@intel.com>,
	Zhihong Wang <zhihong.wang@intel.com>,
	Andrew Rybchenko <arybchenko@solarflare.com>,
	dev@dpdk.org, stable@dpdk.org
Subject: Re: [dpdk-stable] [dpdk-dev] [PATCH v2] drivers/net: fix segfault in secondary process
Date: Fri, 20 Jul 2018 14:36:44 +0100	[thread overview]
Message-ID: <b7dbe001-d411-17bd-8fc3-33e902c45c6d@intel.com> (raw)
In-Reply-To: <58927344.bVGVdsIIPO@xps>

On 7/20/2018 1:23 PM, Thomas Monjalon wrote:
> 20/07/2018 14:44, Ferruh Yigit:
>> --- a/drivers/net/tap/rte_eth_tap.c
>> +++ b/drivers/net/tap/rte_eth_tap.c
>>  	if (rte_eal_process_type() == RTE_PROC_SECONDARY &&
>>  	    strlen(params) == 0) {
>> -		eth_dev = rte_eth_dev_attach_secondary(name);
>> +		eth_dev = rte_eth_vdev_secondary_probe(dev, name, &ops);
>>  		if (!eth_dev) {
>>  			TAP_LOG(ERR, "Failed to probe %s", name);
>>  			return -1;
>>  		}
>> -		/* TODO: request info from primary to set up Rx and Tx */
>> -		eth_dev->dev_ops = &ops;
>> -		rte_eth_dev_probing_finish(eth_dev);
>>  		return 0;
>>  	}
>>  
>> --- a/lib/librte_ethdev/rte_ethdev_vdev.h
>> +++ b/lib/librte_ethdev/rte_ethdev_vdev.h
>> +static inline struct rte_eth_dev *
>> +rte_eth_vdev_secondary_probe(struct rte_vdev_device *vdev,
>> +		const char *name, const struct eth_dev_ops *ops)
>> +{
>> +	struct rte_eth_dev *eth_dev;
>> +
>> +	eth_dev = rte_eth_dev_attach_secondary(name);
>> +	if (!eth_dev)
>> +		return NULL;
>> +
>> +	/* TODO: request info from primary to set up Rx and Tx */
>> +	eth_dev->dev_ops = ops;
>> +	eth_dev->device = &vdev->device;
>> +	rte_eth_dev_probing_finish(eth_dev);
>> +	return eth_dev;
>> +}
> 
> As you can see in the following patch,
> 
> 	net/tap: add queues when attaching from secondary process
> 	https://patches.dpdk.org/patch/43229/
> 
> The synchronization with primary process can be specific to the PMD.
> It will use some private data and can need IPC call to translate some
> file descriptors.
> Moreover, we will need to think about a more complex sync in order
> to update queues when a process re-configure queues number,
> and also attach in primary a device created in secondary.
> We need also to handle hotplug as Qi already proposed.
> 
> My suggestion: just fix the PMDs without creating an helper.
> We could design a helper later when we will have thought to the global
> issue we want to solve.

This was to help PMDs as Stephen suggested, helper function can be introduced
later, I will send initial version with updated PMDs in v2.

  reply	other threads:[~2018-07-20 13:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-19 16:45 [dpdk-stable] [PATCH] " Ferruh Yigit
2018-07-19 16:32 ` [dpdk-stable] [dpdk-dev] " Stephen Hemminger
2018-07-20 10:13   ` Ferruh Yigit
2018-07-19 22:19 ` Zhang, Qi Z
2018-07-20 12:44 ` [dpdk-stable] [PATCH v2] " Ferruh Yigit
2018-07-20 12:23   ` Thomas Monjalon
2018-07-20 13:36     ` Ferruh Yigit [this message]
2018-07-20 14:54   ` [dpdk-stable] [PATCH v3] " Ferruh Yigit
2018-07-26 12:58     ` [dpdk-stable] [dpdk-dev] " Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b7dbe001-d411-17bd-8fc3-33e902c45c6d@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=arybchenko@solarflare.com \
    --cc=chas3@att.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=gaetan.rivet@6wind.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=jerin.jacob@caviumnetworks.com \
    --cc=keith.wiles@intel.com \
    --cc=linville@tuxdriver.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=mtetsuyah@gmail.com \
    --cc=santosh.shukla@caviumnetworks.com \
    --cc=shreyansh.jain@nxp.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    --cc=tiwei.bie@intel.com \
    --cc=zhihong.wang@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).