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 DFFC1A0096 for ; Fri, 12 Apr 2019 19:55:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD8D91B3A1; Fri, 12 Apr 2019 19:55:08 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50051.outbound.protection.outlook.com [40.107.5.51]) by dpdk.org (Postfix) with ESMTP id E66581B277; Fri, 12 Apr 2019 19:55:06 +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=mELqPCxYBa06Cfy4a2c7pl1MhpscxrhESU5xYlgNByA=; b=UQTf4lowdsKazBzCKv1AImhJk6hucTU6g3PqCvzSK7BHhfTjUJnbCdrquxjWug9ezxGwWqMWTA9U04nJZJ8Xc9R1OLJI4DKdUlt4xKvdPhbhe9JGAryMctgtqlqvNx57oa0w4Xi8pXP1L7xu4l5/V4gdbRnmmPiA2vs8j2phF2k= Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com (52.134.72.27) by DB3PR0502MB3994.eurprd05.prod.outlook.com (52.134.67.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.21; Fri, 12 Apr 2019 17:55:01 +0000 Received: from DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a]) by DB3PR0502MB3980.eurprd05.prod.outlook.com ([fe80::6072:43be:7c2d:103a%3]) with mapi id 15.20.1792.009; Fri, 12 Apr 2019 17:55:00 +0000 From: Yongseok Koh To: Slava Ovsiienko CC: dev , Shahaf Shuler , "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH 1/1] net/mlx5: fix memory region cleanup routine Thread-Index: AQHU8UbOmKdgBvGj2E6SzIUwQAqKvqY4zyQA Date: Fri, 12 Apr 2019 17:55:00 +0000 Message-ID: <42204664-A008-4CE9-BE60-0D32F734CF78@mellanox.com> References: <1555083927-24499-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1555083927-24499-1-git-send-email-viacheslavo@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=yskoh@mellanox.com; x-originating-ip: [209.116.155.178] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3d4c042a-64e8-429a-05fd-08d6bf6ffc02 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:DB3PR0502MB3994; x-ms-traffictypediagnostic: DB3PR0502MB3994: x-microsoft-antispam-prvs: x-forefront-prvs: 0005B05917 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(346002)(366004)(39860400002)(136003)(376002)(189003)(199004)(2906002)(97736004)(6636002)(3846002)(6116002)(71190400001)(6246003)(83716004)(82746002)(66066001)(6512007)(36756003)(86362001)(4326008)(71200400001)(53936002)(25786009)(68736007)(450100002)(76176011)(37006003)(106356001)(53546011)(81156014)(6862004)(229853002)(256004)(81166006)(26005)(6486002)(14444005)(105586002)(476003)(102836004)(2616005)(14454004)(54906003)(7736002)(11346002)(33656002)(45080400002)(99286004)(478600001)(316002)(186003)(8936002)(6436002)(446003)(6506007)(5660300002)(305945005)(486006); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3994; H:DB3PR0502MB3980.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: cTTDdpf/0VAeTkYSYWBUnMu4TUWWNtyLDFRg7J8JGo94AHXL5nS6YYvtWANf4pKgMKrdjAK+hni1dCAo86WAjxStuXsG1xDwIM+Oh6WzbRbm05RvxiQnvAXHmrP2+e4NG+KIjruez1pAKjs9VzI459yodwzX6MFCKwa70AU6P6s0BMOu6SrA7MDiHm99B5XVeJiN5eHLLUvxGAP8yO+G1yMajbLdOb/UTewEmme6GvRD/j93DKxNvosJPPp6kN6wWIUkKjpQh1pV1UpIakEcC6zmBGgkpfwoOw2z9z4bONlbTl2VcEKodJ3e2Lkj88E9ksaQ5Etf57/0V3gWjyICJJEpVssZnqCkhueEjIznZU6fuisxcYHbxgnJd6EcY3iqjS0Ig/tL8dMtMGjqdSBUTO1d8VjkXub6IJ8zzbIgtKg= Content-Type: text/plain; charset="UTF-8" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d4c042a-64e8-429a-05fd-08d6bf6ffc02 X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2019 17:55:00.8549 (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: DB3PR0502MB3994 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: <20190412175500.YYUwRGalsqqoDvDKDKTesT03Od9K5A_etMPUwvEeeGI@z> > On Apr 12, 2019, at 8:45 AM, Viacheslav Ovsiienko wrote: >=20 > 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. >=20 > Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support") > Cc: stable@dpdk.org >=20 > Signed-off-by: Viacheslav Ovsiienko > --- Nice catch, Slava Can you please submit the same fix for mlx4? Acked-by: Yongseok Koh Thanks > drivers/net/mlx5/mlx5_mr.c | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) >=20 > 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 { > } >=20 > /** > - * 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 { > } >=20 > /** > - * Create a new global Memroy Region (MR) for a missing virtual address. > + * Create a new global Memory Region (MR) for a missing virtual address. > * This API should be called on a secondary process, then a request is se= nt to > * the primary process in order to create a MR for the address. As the gl= obal MR > * list is on the shared memory, following LKey lookup should succeed unl= ess the > @@ -562,7 +562,7 @@ struct mr_update_mp_data { > } >=20 > /** > - * Create a new global Memroy Region (MR) for a missing virtual address. > + * Create a new global Memory Region (MR) for a missing virtual address. > * 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 { > } >=20 > /** > - * Create a new global Memroy Region (MR) for a missing virtual address. > + * Create a new global Memory Region (MR) for a missing virtual address. > * 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; >=20 > /* 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; >=20 > --=20 > 1.8.3.1 >=20