From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50085.outbound.protection.outlook.com [40.107.5.85]) by dpdk.org (Postfix) with ESMTP id 0CC5C7D0B for ; Fri, 25 Aug 2017 09:15:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=5QWH5OcDGI9K60alvHFxQ8sMD0jE9b8AEfq7Ok4jajE=; b=JvWagGTDpIQN/PGCpf2GSJOEkCCjapbROQDykCo6PEDVfDmGhkFKX3j/Be6cPlI7eBZiKi7FU/+GRRtDbIXqY30qyhpeuEZ5PpsJOtVL0fBlzeTlAC2E0MeAPWLJdxYT6iVJP8l4qKWW0NVtIothV8ywDzBx4PCAe9P3P+muUWU= Received: from DB3PR05MB297.eurprd05.prod.outlook.com (10.141.6.13) by DB3PR05MB0604.eurprd05.prod.outlook.com (10.242.137.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1362.18; Fri, 25 Aug 2017 07:15:50 +0000 Received: from DB3PR05MB297.eurprd05.prod.outlook.com ([fe80::192:275c:2976:260e]) by DB3PR05MB297.eurprd05.prod.outlook.com ([fe80::192:275c:2976:260e%14]) with mapi id 15.01.1362.019; Fri, 25 Aug 2017 07:15:50 +0000 From: "Xueming(Steven) Li" To: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= CC: "dev@dpdk.org" Thread-Topic: [PATCH v1 1/2] net/mlx5: change eth device reference for secondary process Thread-Index: AQHTHOImMeIjlLH4ZEq3/L5qVXJqYqKUo5iAgAAE/oA= Date: Fri, 25 Aug 2017 07:15:50 +0000 Message-ID: References: <20170824140341.95471-1-xuemingl@mellanox.com> <20170825065213.GR4544@autoinstall.dev.6wind.com> In-Reply-To: <20170825065213.GR4544@autoinstall.dev.6wind.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=xuemingl@mellanox.com; x-originating-ip: [180.162.41.219] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB3PR05MB0604; 6:Y/s2KNdTgSw658Vcu8xiCxvVzAl7MDWW6jstwpjVjxRnEsHdVDudQmzEHNjiDSZcUpDaPANLm5WaDa2dgfcTcK5ASzF1hz51kPbtfsoowgjb66gEAQrpVPPaegH/qsDboKZ2od++dMIzqLfpG1lctJGFcxXCK1JxLx2R9yUFEUkUyfAmqxjAWF1yMFF2vkYm8nBQIZBextV9p//XJ31IZ5XA1WNa2CguTEiU6bz31S6h/7j7MVav1BFkANxGUgKw2JBqdBJeenMXTSQXdHXVIfxjzcvVuhrn/Ji5JIXVizDoIbMq7QHTMzcPhdZdP5M+K4eNwTGld21UhnMPFl554g==; 5:DL4J2wpoF1lqC/9Z55ZgQE2ABNTapnLh6a+79NBZqQBknnnjeWLuusT6tyQM0liuhsn/KbJDm0ZqZxADuHp4c0oLhfkDVygzU9MkFkutpupc73RwKuPKiInWJA9Hah6J1a0F+BKY5ZxSxF3ZdxVHaA==; 24:qkKKfJpXy1WZ14A54TXNMZcfwBf7rU4m8cqp61JfTd1nqrRdcrStLndMj7JnB12O8pvjATJMXodUTxuSHLpHnjic7h3IPjupjSHd5rk7Srw=; 7:GtHcNYKLVGD3wadiTBVxxAwkzQHLGrJdItyldXVEsj+hwh+ZYkA0a8C4iT/psGTcAIsV/GrG7y2b1s5VdIXevMv5QnLhy3vkr3ZNjiurV+WiILrwtp1BM0yPa9Y6gkyBDOd2lwzcbJbARLuVxJFOu8E360UQ9x6BNo3KvJgg8BKqWglnet/xfZ7LRYubhu9G66e/v3lPN1s6KnmZBgy929jQoJoF9vwPoQpBp8guWY0= x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-ms-office365-filtering-correlation-id: 1f00eec4-689b-43aa-cfe4-08d4eb891dbe x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DB3PR05MB0604; x-ms-traffictypediagnostic: DB3PR05MB0604: x-exchange-antispam-report-test: UriScan:(17755550239193); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123562025)(20161123564025)(20161123558100)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB3PR05MB0604; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB3PR05MB0604; x-forefront-prvs: 041032FF37 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(377454003)(13464003)(199003)(24454002)(189002)(8936002)(81166006)(14454004)(55016002)(9686003)(305945005)(53936002)(53546010)(7736002)(2950100002)(8676002)(33656002)(6916009)(81156014)(3280700002)(66066001)(6246003)(99286003)(189998001)(110136004)(25786009)(68736007)(50986999)(76176999)(6436002)(97736004)(229853002)(2906002)(3660700001)(54356999)(478600001)(101416001)(2900100001)(5660300001)(6116002)(7696004)(102836003)(86362001)(3846002)(5250100002)(106356001)(6506006)(105586002)(74316002)(4326008); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR05MB0604; H:DB3PR05MB297.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 25 Aug 2017 07:15:50.6142 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR05MB0604 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 07:15:52 -0000 Nelio, thanks, comments inline. > -----Original Message----- > From: N=E9lio Laranjeiro [mailto:nelio.laranjeiro@6wind.com] > Sent: Friday, August 25, 2017 2:52 PM > To: Xueming(Steven) Li > Cc: dev@dpdk.org > Subject: Re: [PATCH v1 1/2] net/mlx5: change eth device reference for > secondary process >=20 > Hi Xueming, >=20 > Please see some comments below, >=20 > 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 =3D priv->dev; > > + struct priv *priv =3D dev->data->dev_private; > > int err; > > >=20 > This function should lock/unclock priv. This is a static function, caller function do the lock/unlock.=20 Is there naming convention here? Mlx5_* is outpost interfaces that normally= require lock/unlock priv? >=20 > > if (up) { > > err =3D 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); >=20 > This also induce that those function mlx5_dev_select_rx/tx_function() sho= uld > be renamed to: > priv_dev_select_rx/tx_function(struct *priv, struct rte_eth_dev *dev, ..= .) >=20 > this will avoid the multiple lock/unlocks inside the functions. So priv_* are lock-free functions? >=20 > > 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 =3D EINVAL; > > struct priv *priv =3D dev->data->dev_private; > > > > + if (mlx5_is_secondary()) > > + return -E_RTE_SECONDARY; > > + >=20 > Extra empty line also in the following copy/past of this if statement. > >[...] >=20 > Thanks, >=20 > -- > N=E9lio Laranjeiro > 6WIND