From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f174.google.com (mail-wr0-f174.google.com [209.85.128.174]) by dpdk.org (Postfix) with ESMTP id 11BA37CFC for ; Fri, 25 Aug 2017 08:52:24 +0200 (CEST) Received: by mail-wr0-f174.google.com with SMTP id o76so2506890wrb.5 for ; Thu, 24 Aug 2017 23:52:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=onbsl5htOtwWZbOzs7YfO6nk7awb3ZSCh4ohHIn3gDA=; b=tDzNU3RSe0WVgPa8KX9k2ze0c9ehHnFuNsdn79lj1wJHaV8qvU3vKjACLiRrGbS2ow GWR0q4hPQnqw3W7piUhjF5bR4kYindIOZXAAN0MlFy9oCokOAJ3DnjSMsaMC8Q6j8PzM 7kdMcbM0VVpccqkNxTbqtE68oqJLg6RuXzbLoxjbmaZ3Xc5i4Y/q2Iz40UVYhk0DyURI PJPmRYig0dXaUeHlO2lvVPaJsTEpQk5m7PkeeOq9XUWC38Gc0i72UYCY1nDMyZr3vp9A 6QUhmz6wyyGi1Y5bKSieKkiGY8KmUP/L8feXJhT4zpVpDM27qdZWmXqxtSrKwogUBpmJ 4G7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=onbsl5htOtwWZbOzs7YfO6nk7awb3ZSCh4ohHIn3gDA=; b=cZHQsVuI605fAAsPpcXKuvRlm+FT/A0T9lfS1tpteFiNQnOmZGRRLkbwKMyQ1PeGOx XboZSPWaJVasJS+i6fOLZwNJoPH1tsHQNguEgwH51k4k8Kg0xVN8x/bL6VUbV1Ogtdrk 0bOuXZLiFS5C1jVMjSJV5m+ms0Dn9+SAky80iLeydErVKlxbnuFOzW9Cirlo7YP6nWCg E8CHO37+hEqUx/RkA55HHoTCFdnJ0x3qLYTA1c4iTk+r23XHN2FIRCSf3wLxKRSkxPHu 9CcCH1tGFXIAZb7XiJejJw7/zEeQyblqOMnicHv/R2ANDpcMV9K+h9JslDaAZ5eznaSw OlhA== X-Gm-Message-State: AHYfb5jguSHEL4XV1aXJpZVbWOvh0HAVZ2tpB6IwntCzoprXiyvZgDBu BDe6swlHf2qKmRIYD99lxg== X-Received: by 10.223.136.228 with SMTP id g33mr303897wrg.186.1503643943637; Thu, 24 Aug 2017 23:52:23 -0700 (PDT) Received: from autoinstall.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id w65sm601200wme.6.2017.08.24.23.52.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Aug 2017 23:52:23 -0700 (PDT) Date: Fri, 25 Aug 2017 08:52:13 +0200 From: =?iso-8859-1?Q?N=E9lio?= Laranjeiro To: Xueming Li Cc: dev@dpdk.org Message-ID: <20170825065213.GR4544@autoinstall.dev.6wind.com> References: <20170824140341.95471-1-xuemingl@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170824140341.95471-1-xuemingl@mellanox.com> User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v1 1/2] net/mlx5: change eth device reference for secondary process X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Aug 2017 06:52:24 -0000 Hi Xueming, Please see some comments below, On Thu, Aug 24, 2017 at 10:03:40PM +0800, Xueming Li wrote: > rte_eth_dev created by primary process were not available in secondary > process, it was not possible to use the primary process local memory > object from a secondary process. > > This patch modify the reference of primary rte_eth_dev object, use > local rte_eth_dev secondary process instead. > > Cc: Nelio Laranjeiro > Signed-off-by: Xueming Li > --- > drivers/net/mlx5/mlx5.h | 6 ++--- > drivers/net/mlx5/mlx5_ethdev.c | 52 ++++++++++++++++++++++------------------- > drivers/net/mlx5/mlx5_fdir.c | 3 +++ > drivers/net/mlx5/mlx5_rss.c | 3 +++ > drivers/net/mlx5/mlx5_rxq.c | 2 ++ > drivers/net/mlx5/mlx5_trigger.c | 4 ++-- > 6 files changed, 41 insertions(+), 29 deletions(-) > > diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c > index f5167e0..fce7dd5 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -1356,17 +1356,17 @@ struct priv * > * 0 on success, errno value on failure. > */ > static int > -priv_set_link(struct priv *priv, int up) > +mlx5_dev_set_link(struct rte_eth_dev *dev, int up) > { > - struct rte_eth_dev *dev = priv->dev; > + struct priv *priv = dev->data->dev_private; > int err; > This function should lock/unclock priv. > if (up) { > err = priv_set_flags(priv, ~IFF_UP, IFF_UP); > if (err) > return err; > - priv_select_tx_function(priv); > - priv_select_rx_function(priv); > + mlx5_dev_select_tx_function(dev); > + mlx5_dev_select_rx_function(dev); This also induce that those function mlx5_dev_select_rx/tx_function() should be renamed to: priv_dev_select_rx/tx_function(struct *priv, struct rte_eth_dev *dev, ...) this will avoid the multiple lock/unlocks inside the functions. > diff --git a/drivers/net/mlx5/mlx5_fdir.c b/drivers/net/mlx5/mlx5_fdir.c > index 6acc053..0f3b70a 100644 > --- a/drivers/net/mlx5/mlx5_fdir.c > +++ b/drivers/net/mlx5/mlx5_fdir.c > @@ -1075,6 +1075,9 @@ struct mlx5_fdir_filter { > int ret = EINVAL; > struct priv *priv = dev->data->dev_private; > > + if (mlx5_is_secondary()) > + return -E_RTE_SECONDARY; > + Extra empty line also in the following copy/past of this if statement. >[...] Thanks, -- Nélio Laranjeiro 6WIND