From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id A6418A00E6 for ; Sun, 14 Apr 2019 08:58:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C5457293B; Sun, 14 Apr 2019 08:58:31 +0200 (CEST) Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140075.outbound.protection.outlook.com [40.107.14.75]) by dpdk.org (Postfix) with ESMTP id E22B11DBF; Sun, 14 Apr 2019 08:58:30 +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:X-MS-Exchange-SenderADCheck; bh=7Vo5hVRY4ISv216BDiYZzNoMyLv3FH119cbrv/76xFI=; b=kUYD7BHrZG8pYLKRaG1zb/dLRaIAxyQjPHeuh1raZyooAdsbXbGZwrN16VLBUJV3zWr46nOx5vVFq14FT3wV5SqLZipvuZYWsveZpr3mUBHd2wZRK8wsfcUi6lUR0A1uRlUPOmwBDSgj1HpAGBio7MIsg6Chl7kXOVFQNBv3gOU= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3809.eurprd05.prod.outlook.com (52.133.50.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.17; Sun, 14 Apr 2019 06:58:28 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::4192:b468:41e1:c323]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::4192:b468:41e1:c323%4]) with mapi id 15.20.1792.018; Sun, 14 Apr 2019 06:58:28 +0000 From: Shahaf Shuler To: Yongseok Koh , Slava Ovsiienko CC: dev , "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH 1/1] net/mlx5: fix memory region cleanup routine Thread-Index: AQHU8VjcQFUQ4bkTaEiO1362j/N2vqY7O/bw Date: Sun, 14 Apr 2019 06:58:28 +0000 Message-ID: References: <1555083927-24499-1-git-send-email-viacheslavo@mellanox.com> <42204664-A008-4CE9-BE60-0D32F734CF78@mellanox.com> In-Reply-To: <42204664-A008-4CE9-BE60-0D32F734CF78@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c2dd7d69-18cc-4d5f-317e-08d6c0a69939 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR0502MB3809; x-ms-traffictypediagnostic: AM0PR0502MB3809: x-microsoft-antispam-prvs: x-forefront-prvs: 00073DB75F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(376002)(366004)(346002)(136003)(396003)(39850400004)(189003)(199004)(105586002)(316002)(106356001)(5660300002)(74316002)(7736002)(53546011)(478600001)(110136005)(229853002)(71190400001)(71200400001)(6436002)(81156014)(7696005)(45080400002)(81166006)(86362001)(102836004)(14444005)(256004)(6506007)(99286004)(54906003)(305945005)(52536014)(76176011)(8936002)(6636002)(26005)(11346002)(486006)(446003)(476003)(450100002)(33656002)(6246003)(2906002)(25786009)(6116002)(3846002)(14454004)(186003)(9686003)(68736007)(4326008)(66066001)(97736004)(53936002)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3809; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: JsA3C6HOdS53LjNumpnIEn+mpvokzkW90vwRy/X1iS/+EbQfXBZRfH6ItM8TE+R9nEsH01iQ1m93JCixFUq98gf1Jkfwd3YF+5fI0bbwJ0Z0LKQDTIDsFtkF/Pef9vYg5BlwKA0uQFAPU0G03ewd3GWLAKEAEvLVnMNXrGAjiyCXxoX9ueeqlgw0bVukKk5FGJtd8doYe3hSm1Z3MEbA84zCXOpIUMwZYiOR7nYnzsISMkop4//ooUzKY+aRvmyyZaAxhfaDGmZ6/fQ3xud9QqBzB8mr/SGstnb8WsP/gK/u3wauqGo7KpsRF2f+pRh9EhCHuyYAzSIx8Pz+JJYwgAsf9poQtP9bSta3MSO6uEdQfNLfRuDcmu+RwZTCIYKsoQZr/STC3+3381TWePpCd5KFYe8oZLogqgTEl/cqp0U= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2dd7d69-18cc-4d5f-317e-08d6c0a69939 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Apr 2019 06:58:28.6529 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR0502MB3809 Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH 1/1] net/mlx5: fix memory region cleanup routine 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190414065828.spYyteiqfO-q3ubWebw5rId4XSuBuFUJEKzrU6Eptz4@z> Friday, April 12, 2019 8:55 PM, Yongseok Koh: > Subject: Re: [dpdk-stable] [PATCH 1/1] net/mlx5: fix memory region cleanu= p > routine >=20 >=20 > > On Apr 12, 2019, at 8:45 AM, Viacheslav Ovsiienko > wrote: > > > > mlx5 driver has a global list of Memory Regions created by device, and > > there is a ml5_mr_release() routine which makes a memory cleanup at > > device closing. The head of device MR list was fetched outside the > > rwlock protected section. Also some noticed typos are fixed. > > > > Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support") > > Cc: stable@dpdk.org > > > > Signed-off-by: Viacheslav Ovsiienko > > --- >=20 > Nice catch, Slava > Can you please submit the same fix for mlx4? >=20 > Acked-by: Yongseok Koh Slava - please merge both mlx4 and mlx5 into the same patch. Keep Koh's acked-by. I will take the v2. >=20 > Thanks >=20 > > drivers/net/mlx5/mlx5_mr.c | 13 +++++++------ > > 1 file changed, 7 insertions(+), 6 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c > > index 44b6591..a3732d4 100644 > > --- a/drivers/net/mlx5/mlx5_mr.c > > +++ b/drivers/net/mlx5/mlx5_mr.c > > @@ -466,7 +466,7 @@ struct mr_update_mp_data { } > > > > /** > > - * Releass resources of detached MR having no online entry. > > + * Release resources of detached MR having no online entry. > > * > > * @param dev > > * Pointer to Ethernet device. > > @@ -516,7 +516,7 @@ struct mr_update_mp_data { } > > > > /** > > - * Create a new global Memroy Region (MR) for a missing virtual addres= s. > > + * Create a new global Memory Region (MR) for a missing virtual addres= s. > > * This API should be called on a secondary process, then a request is > > sent to > > * the primary process in order to create a MR for the address. As the > > global MR > > * list is on the shared memory, following LKey lookup should succeed > > unless the @@ -562,7 +562,7 @@ struct mr_update_mp_data { } > > > > /** > > - * Create a new global Memroy Region (MR) for a missing virtual addres= s. > > + * Create a new global Memory Region (MR) for a missing virtual addres= s. > > * Register entire virtually contiguous memory chunk around the address= . > > * This must be called from the primary process. > > * > > @@ -673,7 +673,7 @@ struct mr_update_mp_data { > > bmp_mem =3D RTE_PTR_ALIGN_CEIL(mr + 1, RTE_CACHE_LINE_SIZE); > > mr->ms_bmp =3D rte_bitmap_init(ms_n, bmp_mem, bmp_size); > > if (mr->ms_bmp =3D=3D NULL) { > > - DEBUG("port %u unable to initialize bitamp for a new MR of" > > + DEBUG("port %u unable to initialize bitmap for a new MR of" > > " address (%p).", > > dev->data->port_id, (void *)addr); > > rte_errno =3D EINVAL; > > @@ -811,7 +811,7 @@ struct mr_update_mp_data { } > > > > /** > > - * Create a new global Memroy Region (MR) for a missing virtual addres= s. > > + * Create a new global Memory Region (MR) for a missing virtual addres= s. > > * This can be called from primary and secondary process. > > * > > * @param dev > > @@ -1600,7 +1600,7 @@ struct mr_update_mp_data { > > mlx5_mr_release(struct rte_eth_dev *dev) { > > struct mlx5_priv *priv =3D dev->data->dev_private; > > - struct mlx5_mr *mr_next =3D LIST_FIRST(&priv->mr.mr_list); > > + struct mlx5_mr *mr_next; > > > > /* Remove from memory callback device list. */ > > rte_rwlock_write_lock(&mlx5_shared_data->mem_event_rwlock); > > @@ -1610,6 +1610,7 @@ struct mr_update_mp_data { > > mlx5_mr_dump_dev(dev); > > rte_rwlock_write_lock(&priv->mr.rwlock); > > /* Detach from MR list and move to free list. */ > > + mr_next =3D LIST_FIRST(&priv->mr.mr_list); > > while (mr_next !=3D NULL) { > > struct mlx5_mr *mr =3D mr_next; > > > > -- > > 1.8.3.1 > >