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 DFA08A00E6 for ; Mon, 15 Apr 2019 10:45:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3D1421B119; Mon, 15 Apr 2019 10:45:36 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00055.outbound.protection.outlook.com [40.107.0.55]) by dpdk.org (Postfix) with ESMTP id AA0D21B117; Mon, 15 Apr 2019 10:45:34 +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=EQgKMJjsKl1qDJ76Nm/i+LAIdRdgN0PwnJ6uOzHbneE=; b=fY/kPpwRcI/qOh90n6nGvj2bMHWWQjXelgdluKYE7L5kROyrnaEVo/ZxeInHxXTR5dOwz5GlPqvg9eUbN/skAN8PEojiHJP40sz6PBdYKGdWtUcIU/Kdal2Yp5zY4Dc0N3GV+Q1izwfUJ1Q/+JYI836t0725UQF03JPEOGFC+Dk= Received: from AM4PR05MB3265.eurprd05.prod.outlook.com (10.171.188.154) by AM4PR05MB3251.eurprd05.prod.outlook.com (10.171.187.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1792.14; Mon, 15 Apr 2019 08:45:32 +0000 Received: from AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::c5f8:16a9:a4a6:a135]) by AM4PR05MB3265.eurprd05.prod.outlook.com ([fe80::c5f8:16a9:a4a6:a135%4]) with mapi id 15.20.1792.018; Mon, 15 Apr 2019 08:45:32 +0000 From: Slava Ovsiienko To: Shahaf Shuler , Yongseok Koh CC: dev , "stable@dpdk.org" Thread-Topic: [dpdk-stable] [PATCH 1/1] net/mlx5: fix memory region cleanup routine Thread-Index: AQHU8VjcJYE7GdyM4U+yt+qFVWbauqY7PDoAgAGvEDA= Date: Mon, 15 Apr 2019 08:45:32 +0000 Message-ID: References: <1555083927-24499-1-git-send-email-viacheslavo@mellanox.com> <42204664-A008-4CE9-BE60-0D32F734CF78@mellanox.com> In-Reply-To: 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=viacheslavo@mellanox.com; x-originating-ip: [95.164.10.10] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 60684992-24a4-4d47-0ecf-08d6c17eb8bb x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600140)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:AM4PR05MB3251; x-ms-traffictypediagnostic: AM4PR05MB3251: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-forefront-prvs: 000800954F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(376002)(39860400002)(396003)(346002)(13464003)(189003)(199004)(6436002)(86362001)(68736007)(106356001)(256004)(305945005)(3846002)(7736002)(54906003)(450100002)(6506007)(110136005)(2906002)(71190400001)(4326008)(99286004)(11346002)(7696005)(486006)(53546011)(14444005)(52536014)(71200400001)(476003)(229853002)(105586002)(446003)(14454004)(76176011)(8936002)(316002)(966005)(6636002)(6306002)(102836004)(97736004)(33656002)(74316002)(186003)(25786009)(6246003)(6116002)(53936002)(26005)(66066001)(9686003)(45080400002)(478600001)(55016002)(81156014)(81166006)(5660300002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3251; H:AM4PR05MB3265.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: EeQa0/PBJg8sEsSa/Yx/U61VlpoZDIGIwEh5Ij+34Vok17RbhJVe/N145NMoQjPy1rk0k9YE07Y5aRSPps34YDeDEZ2Vhy6uJ15d9sdgjJVxGShynmPpLU1vLuzJ7A5qhEkJr80uOc6jsdEbWKyaBaDQZsR1FdTrw6VIyyD7IQxa0bof/oDupLvz6/RMZpp4IBsyiEJbmNN6g0qyoTm0rCxgLA+ZTbl4p1z9zrZ85yNlX4Z1RWS1lpKQWqfub8YbQ2JpPN+5OrNwV6PZGSjC5qfaWAjrvFOBQfx+pxIQ7lPmxO1hhfiNp3fMo97yrW1c7ZYPuCXnp3bcm6vN6FLPUzN/8f+f0ikLD7P0nvblXPySCYhRVXSwv8End6YwtCEXI7dhgM0D3Q7hq+LyogOfIINXS2Go+t0IGibiCRJOhDs= 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: 60684992-24a4-4d47-0ecf-08d6c17eb8bb X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Apr 2019 08:45:32.7479 (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: AM4PR05MB3251 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: <20190415084532.jm6juQHI1q8JVBOsuyw8dz5XN-K5gxtSc5ajLpvPDNA@z> > -----Original Message----- > From: Shahaf Shuler > Sent: Sunday, April 14, 2019 9:58 > To: Yongseok Koh ; Slava Ovsiienko > > Cc: dev ; stable@dpdk.org > Subject: RE: [dpdk-stable] [PATCH 1/1] net/mlx5: fix memory region cleanu= p > routine >=20 > Friday, April 12, 2019 8:55 PM, Yongseok Koh: > > Subject: Re: [dpdk-stable] [PATCH 1/1] net/mlx5: fix memory region > > cleanup routine > > > > > > > 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 > > > --- > > > > Nice catch, Slava > > Can you please submit the same fix for mlx4? > > > > Acked-by: Yongseok Koh >=20 > Slava - please merge both mlx4 and mlx5 into the same patch. > Keep Koh's acked-by. >=20 > I will take the v2. There are some troubles with passing check-log script for mlx4/mlx5 merged = patch. So, I prepared the separated patch for mlx4 with right headline and fix ref= erence. http://patches.dpdk.org/patch/52791/ If you don't mind - please apply both (for mlx4 and mlx5) patches. Thanks. With best regards, Slava >=20 > > > > Thanks > > > > > 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 > 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 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 > address. > > > + * Create a new global Memory Region (MR) for a missing virtual > address. > > > * Register entire virtually contiguous memory chunk around the addre= ss. > > > * 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 > 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; > > > > > > /* 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 > > >