From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <thomas@monjalon.net>
Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com
 [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 3F04D239
 for <dev@dpdk.org>; Tue, 19 Sep 2017 00:25:27 +0200 (CEST)
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id DD56620C3C;
 Mon, 18 Sep 2017 18:25:26 -0400 (EDT)
Received: from frontend1 ([10.202.2.160])
 by compute1.internal (MEProxy); Mon, 18 Sep 2017 18:25:26 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 cc:content-transfer-encoding:content-type:date:from:in-reply-to
 :message-id:mime-version:references:subject:to:x-me-sender
 :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=t8wXBjIZCOERNPj
 QO7aSOaYIx/bGWaVVpuTacpdZMrU=; b=GqD6rKXFxD+piIrBbYoHLcrSD88r7+g
 5Sw3E2yD22VTgRZtG3VGYzaC//+J+FYXvlln4O18mz5oRjkIWRzwYjzDgUIML4mE
 p0J6kxPu1bv3Wta/zFQ4wYKmvcbtwR/m2H/mxiSzfzteiAahy0LZy6vYamMx56CL
 I7m3cLms50Ys=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :date:from:in-reply-to:message-id:mime-version:references
 :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=
 fm1; bh=t8wXBjIZCOERNPjQO7aSOaYIx/bGWaVVpuTacpdZMrU=; b=Cyc9SggM
 b2eRCYWs6834Wrmd67d+A2ljwcw/aVi+ns3Viu1V71Q6A2CeVLhgAkQYKdf6Lcxn
 jxMvOEiBxO7Fn4d5V/lnKo/kKtAjXZ+qPEyldxJ/6NXfUH9gLh2khjddI49Bk1cf
 PoywlZPQPW5T+CysrfjDA9JWrbdM8wNhwBGzfRbFEW4KsBoCGRkfUXG3gXuNAVQL
 5Y9AetaL9htVMx5wlstMOqgmdIxFxbuJtzewauCiU59XXDb814n4XmpSVn31DA2B
 qHxH5rYX9Q6qftjXVNM7lQ0qCwGZlv9KkyddjVBBCFCOkoIWhDVjo9lnEhQIvBDg
 sspRAsiRxzlb9A==
X-ME-Sender: <xms:1kfAWepbpRc2qek-HmCap3wF3-trLQDaSXofPWilIs8VaaOlA_MeHg>
X-Sasl-enc: DZ3VEz8qFGXtx/Az4MmvKBW47uFN29qcJnpBcmlC4IP+ 1505773526
Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 931947F9BA;
 Mon, 18 Sep 2017 18:25:26 -0400 (EDT)
From: Thomas Monjalon <thomas@monjalon.net>
To: John Daley <johndale@cisco.com>
Cc: Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org,
 Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
Date: Tue, 19 Sep 2017 00:25:25 +0200
Message-ID: <4171800.AgbnscgTn2@xps>
In-Reply-To: <488ca130-7a8e-223f-5b9e-50bdab9b93f2@intel.com>
References: <20170911185833.11458-1-johndale@cisco.com>
 <488ca130-7a8e-223f-5b9e-50bdab9b93f2@intel.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"
Subject: Re: [dpdk-dev] [PATCH] net/enic: fix multi-process operation
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Mon, 18 Sep 2017 22:25:27 -0000

18/09/2017 23:27, Ferruh Yigit:
> 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.
[...]
> > --- 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.

Yes for now it is the policy.
But it is a gray area and it could be clearer with my "ownership proposal":
	http://dpdk.org/ml/archives/dev/2017-September/074656.html
A secondary process could manage the ports it owns.

Feel free to comment the proposal.