DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@amd.com>
To: Ed Czeck <ed.czeck@atomicrules.com>, dev@dpdk.org
Cc: stephen@networkplumber.org,
	John Miller <john.miller@atomicrules.com>,
	Shepard Siegel <shepard.siegel@atomicrules.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>
Subject: Re: [PATCH v2 1/3] net/ark: support secondary process
Date: Mon, 20 Feb 2023 14:17:30 +0000	[thread overview]
Message-ID: <b3aa1da6-f42e-b620-9e14-f7e9bf5335f0@amd.com> (raw)
In-Reply-To: <20230217215923.2561685-1-ed.czeck@atomicrules.com>

On 2/17/2023 9:59 PM, Ed Czeck wrote:
> From: John Miller <john.miller@atomicrules.com>
> 
> disable device configuration for secondary processes
> 
> Signed-off-by: John Miller <john.miller@atomicrules.com>
> ---
> v2:
> * Use standard logging
> ---
>  drivers/net/ark/ark_ethdev.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ark/ark_ethdev.c b/drivers/net/ark/ark_ethdev.c
> index b2995427c8..d237e80cf4 100644
> --- a/drivers/net/ark/ark_ethdev.c
> +++ b/drivers/net/ark/ark_ethdev.c
> @@ -147,6 +147,9 @@ eth_ark_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
>  	struct rte_eth_dev *eth_dev;
>  	int ret;
>  
> +	if (rte_eal_process_type() == RTE_PROC_SECONDARY)
> +		ARK_PMD_LOG(DEBUG, "ARK probed by secondary process\n");
> +
>  	eth_dev = rte_eth_dev_pci_allocate(pci_dev, sizeof(struct ark_adapter));
>  
>  	if (eth_dev == NULL)
> @@ -385,9 +388,11 @@ eth_ark_dev_init(struct rte_eth_dev *dev)
>  		    0xcafef00d, ark->sysctrl.t32[4], __func__);
>  
>  	/* We are a single function multi-port device. */
> -	ret = ark_config_device(dev);
> -	if (ret)
> -		return -1;
> +	if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
> +		ret = ark_config_device(dev);
> +		if (ret)
> +			return -1;
> +	}


Hi Ed,

As far as I can see both primary and secondary process continues to run
after this point, and below there are a few places that updates
'eth_dev->data'.

'eth_dev->data' is shared between primary and secondaries, so each
secondary will be overwriting the shared data.
Better usage is shared data only updated by primary process and
secondary processes use available values.
But 'eth_dev' is process specific and all primary and shared processes
must set fields of this struct.

You may need to re-order calls in function to make secondary quit after
'eth_dev' fields updated and before 'eth_dev->data' updated, to make
sure secondaries don't update shared data.

>  
>  	dev->dev_ops = &ark_eth_dev_ops;
>  	dev->rx_queue_count = eth_ark_dev_rx_queue_count;


  parent reply	other threads:[~2023-02-20 14:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-17 16:00 [PATCH " Ed Czeck
2023-02-17 16:00 ` [PATCH 2/3] net/ark: support for single function with multiple port Ed Czeck
2023-02-17 16:00 ` [PATCH 3/3] net/ark: resize data field to match fpga access Ed Czeck
2023-02-17 16:00 ` [PATCH] " Ed Czeck
2023-02-17 16:57   ` Ferruh Yigit
2023-02-17 21:59 ` [PATCH v2 1/3] net/ark: support secondary process Ed Czeck
2023-02-17 21:59   ` [PATCH v2 2/3] net/ark: support for single function with multiple port Ed Czeck
2023-02-20 14:54     ` Ferruh Yigit
2023-02-20 22:09       ` Ed Czeck
2023-02-20 23:21         ` Ferruh Yigit
2023-02-17 21:59   ` [PATCH v2 3/3] net/ark: resize data field to match fpga access Ed Czeck
2023-02-20 14:17   ` Ferruh Yigit [this message]
2023-02-20 22:04     ` [PATCH v2 1/3] net/ark: support secondary process Ed Czeck
2023-02-20 23:13       ` Ferruh Yigit
2023-02-20 22:11 ` [PATCH v3 1/2] net/ark: limited support for secondary processes Ed Czeck
2023-02-20 22:11   ` [PATCH v3 2/2] net/ark: support for single function with multiple port Ed Czeck
2023-02-21 16:30 ` [PATCH v4] " Ed Czeck
2023-02-23 14:25   ` Ferruh Yigit
2023-05-16 14:27     ` Ferruh Yigit
2023-05-16 15:33 ` [PATCH 1/3] net/ark: support secondary process Burakov, Anatoly

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=b3aa1da6-f42e-b620-9e14-f7e9bf5335f0@amd.com \
    --to=ferruh.yigit@amd.com \
    --cc=anatoly.burakov@intel.com \
    --cc=dev@dpdk.org \
    --cc=ed.czeck@atomicrules.com \
    --cc=john.miller@atomicrules.com \
    --cc=shepard.siegel@atomicrules.com \
    --cc=stephen@networkplumber.org \
    /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).