patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: John Daley <johndale@cisco.com>
Cc: dev@dpdk.org, stable@dpdk.org,
	Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-stable] [PATCH] net/enic: fix multi-process operation
Date: Mon, 18 Sep 2017 22:27:15 +0100	[thread overview]
Message-ID: <488ca130-7a8e-223f-5b9e-50bdab9b93f2@intel.com> (raw)
In-Reply-To: <20170911185833.11458-1-johndale@cisco.com>

On 9/11/2017 7:58 PM, John Daley wrote:
> - Use rte_malloc() instead of malloc() for the per device 'vdev' structure
>   so that it can be shared across processes.
> - Only initialize the device if the process type is RTE_PROC_PRIMARY
> - Only allow the primary process to do queue setup, start/stop, promisc
>   allmulticast, mac add/del, mtu.
> 
> Fixes: fefed3d1e62c ("enic: new driver")
> Cc: stable@dpdk.org
> 
> Signed-off-by: John Daley <johndale@cisco.com>

<...>

> diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c
> index da8fec2d0..33a3f87e2 100644
> --- a/drivers/net/enic/enic_ethdev.c
> +++ b/drivers/net/enic/enic_ethdev.c
> @@ -142,6 +142,10 @@ enicpmd_dev_filter_ctrl(struct rte_eth_dev *dev,
>  static void enicpmd_dev_tx_queue_release(void *txq)
>  {
>  	ENICPMD_FUNC_TRACE();
> +
> +	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> +		return;
> +

Hi John,

I am not sure about these updates. Agree that these functions should
know process type, but all others PMDs don't do this.

Added a few more people for comment, but as far I understand its
application responsibility to NOT call these functions if it is
secondary process.

For device init/uninit, that is part of eal_init() and have to be called
both for primary and secondary process and PMD needs to protect it, for
other functions application's responsibility.


>  	enic_free_wq(txq);
>  }
>  
> @@ -196,6 +200,9 @@ static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,
>  	int ret;
>  	struct enic *enic = pmd_priv(eth_dev);
>  
> +	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> +		return -E_RTE_SECONDARY;
> +
>  	ENICPMD_FUNC_TRACE();
>  	if (queue_idx >= ENIC_WQ_MAX) {
>  		dev_err(enic,
> @@ -272,6 +279,10 @@ static int enicpmd_dev_rx_queue_stop(struct rte_eth_dev *eth_dev,
>  static void enicpmd_dev_rx_queue_release(void *rxq)
>  {
>  	ENICPMD_FUNC_TRACE();
> +
> +	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> +		return;
> +
>  	enic_free_rq(rxq);
>  }
>  

<...>

  parent reply	other threads:[~2017-09-18 21:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11 18:58 John Daley
2017-09-12 13:53 ` [dpdk-stable] [dpdk-dev] " Aaron Conole
2017-09-18 21:27 ` Ferruh Yigit [this message]
2017-09-22 16:50 ` [dpdk-stable] " Ferruh Yigit
  -- strict thread matches above, loose matches on Subject: below --
2017-09-11 18:56 John Daley
2017-09-11 18:41 John Daley
2017-09-11 18:32 John Daley
2017-09-10 17:59 John Daley
2017-07-06 20:19 John Daley

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=488ca130-7a8e-223f-5b9e-50bdab9b93f2@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@dpdk.org \
    --cc=johndale@cisco.com \
    --cc=sergio.gonzalez.monroy@intel.com \
    --cc=stable@dpdk.org \
    --cc=thomas@monjalon.net \
    /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).