From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70053.outbound.protection.outlook.com [40.107.7.53]) by dpdk.org (Postfix) with ESMTP id D5C432BF4; Tue, 26 Mar 2019 13:28:03 +0100 (CET) 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=KVw1KpCGyitnMoLXrzmJG+k6XL8bjNSV2gZEtt4uQgo=; b=rXTVdkzM5/pimyUa6fjpoCE7I4zV1OloLm1BLcm7i4bznm57CIeCRMu94MOjYDwCkqUdZS2736qZo+U2yMuktdk/84ROzC1ox17PYliOWOaSrRTFIQM9PnhatVXRNC1WVi4tQ9GQxJCJSi6h4v2WVG8kw6JWJUwS+QCclbrWKLM= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3828.eurprd05.prod.outlook.com (52.133.47.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Tue, 26 Mar 2019 12:28:02 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003%2]) with mapi id 15.20.1750.014; Tue, 26 Mar 2019 12:28:02 +0000 From: Shahaf Shuler To: Yongseok Koh CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/4] net/mlx5: fix memory event on secondary process Thread-Index: AQHU4z8wbSnKZPX5f0a0UWR5vu4rW6Yd2BAw Date: Tue, 26 Mar 2019 12:28:02 +0000 Message-ID: References: <20190307073314.18324-1-yskoh@mellanox.com> <20190325191545.20707-1-yskoh@mellanox.com> <20190325191545.20707-2-yskoh@mellanox.com> In-Reply-To: <20190325191545.20707-2-yskoh@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: 8f4f59c0-6c40-465b-33ae-08d6b1e67d79 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3828; x-ms-traffictypediagnostic: AM0PR0502MB3828: x-microsoft-antispam-prvs: x-forefront-prvs: 09888BC01D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(366004)(376002)(346002)(199004)(189003)(25786009)(5660300002)(74316002)(14454004)(6116002)(105586002)(229853002)(6862004)(106356001)(4326008)(478600001)(7736002)(2906002)(305945005)(3846002)(6436002)(450100002)(6246003)(476003)(99286004)(446003)(66066001)(8936002)(11346002)(316002)(486006)(68736007)(9686003)(53936002)(71200400001)(71190400001)(97736004)(55016002)(6636002)(54906003)(14444005)(256004)(33656002)(102836004)(86362001)(7696005)(81156014)(81166006)(26005)(6506007)(186003)(52536014)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3828; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: vCEEG08t2rg3VHJfx3gcjbYDE/a1/13nTMSHEDYWH2xfWgDht39GYULPlubF/dpb/BytxrwcDqYazzUZLyfVZe21zbnuMaU86VorWqv4xQq4X2hPVOOeommdB7OaP5s6Uz9sMNWmILIF7ppd4DLmoOn9piAzyVDrHpchCOwaJ+JvQVQbg38X3oaVDlXHoDc3t2lJNmxJOY2J1TT9tSR+zYc9arguGhimEJFPrINb5MGe/Wrn0xHy/T5mogddMZTgK//mIYxRY+3oLg4gJT8MMcMuf205BuiwsgIq3EiCOidUh08XyjjSL+9sv5ityi2fRfESuhS92IpGKGxr9didK55lsVYqH7KChHV8XOJW7ArDXiFrOHtUmStUyBfFovHfBoKwgSvnB0PqavmUooc9XPpg+2/gnyGy3xjq0qDpmPk= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8f4f59c0-6c40-465b-33ae-08d6b1e67d79 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 12:28:02.4072 (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: AM0PR0502MB3828 Subject: Re: [dpdk-dev] [PATCH v2 1/4] net/mlx5: fix memory event on 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: Tue, 26 Mar 2019 12:28:04 -0000 Monday, March 25, 2019 9:16 PM, Yongseok Koh: > Subject: [dpdk-dev] [PATCH v2 1/4] net/mlx5: fix memory event on > secondary process >=20 > As the memory event is propagated to secondary processes, the event is > processed redundantly. This should be processed once because the data > structure used for MR and the event is global across the processes. >=20 > Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support") > Cc: stable@dpdk.org >=20 > Signed-off-by: Yongseok Koh Acked-by: Shahaf Shuler > --- > drivers/net/mlx5/mlx5.c | 5 +++-- > drivers/net/mlx5/mlx5_mr.c | 2 ++ > 2 files changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > ae4b71695e..dd29eba955 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -157,9 +157,10 @@ mlx5_prepare_shared_data(void) > if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) { > LIST_INIT(&mlx5_shared_data- > >mem_event_cb_list); > rte_rwlock_init(&mlx5_shared_data- > >mem_event_rwlock); > + > rte_mem_event_callback_register("MLX5_MEM_EVENT_CB", > + > mlx5_mr_mem_event_cb, > + NULL); > } > - > rte_mem_event_callback_register("MLX5_MEM_EVENT_CB", > - mlx5_mr_mem_event_cb, > NULL); > } > rte_spinlock_unlock(&mlx5_shared_data_lock); > } > diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c inde= x > 700d83d1bc..d336a77e40 100644 > --- a/drivers/net/mlx5/mlx5_mr.c > +++ b/drivers/net/mlx5/mlx5_mr.c > @@ -891,6 +891,8 @@ mlx5_mr_mem_event_cb(enum rte_mem_event > event_type, const void *addr, > struct mlx5_priv *priv; > struct mlx5_dev_list *dev_list =3D &mlx5_shared_data- > >mem_event_cb_list; >=20 > + /* Must be called from the primary process. */ > + assert(rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY); > switch (event_type) { > case RTE_MEM_EVENT_FREE: > rte_rwlock_write_lock(&mlx5_shared_data- > >mem_event_rwlock); > -- > 2.11.0 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 89EB2A05D3 for ; Tue, 26 Mar 2019 13:28:05 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 55DA13576; Tue, 26 Mar 2019 13:28:05 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70053.outbound.protection.outlook.com [40.107.7.53]) by dpdk.org (Postfix) with ESMTP id D5C432BF4; Tue, 26 Mar 2019 13:28:03 +0100 (CET) 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=KVw1KpCGyitnMoLXrzmJG+k6XL8bjNSV2gZEtt4uQgo=; b=rXTVdkzM5/pimyUa6fjpoCE7I4zV1OloLm1BLcm7i4bznm57CIeCRMu94MOjYDwCkqUdZS2736qZo+U2yMuktdk/84ROzC1ox17PYliOWOaSrRTFIQM9PnhatVXRNC1WVi4tQ9GQxJCJSi6h4v2WVG8kw6JWJUwS+QCclbrWKLM= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3828.eurprd05.prod.outlook.com (52.133.47.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Tue, 26 Mar 2019 12:28:02 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::84f3:7e92:7a51:1003%2]) with mapi id 15.20.1750.014; Tue, 26 Mar 2019 12:28:02 +0000 From: Shahaf Shuler To: Yongseok Koh CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/4] net/mlx5: fix memory event on secondary process Thread-Index: AQHU4z8wbSnKZPX5f0a0UWR5vu4rW6Yd2BAw Date: Tue, 26 Mar 2019 12:28:02 +0000 Message-ID: References: <20190307073314.18324-1-yskoh@mellanox.com> <20190325191545.20707-1-yskoh@mellanox.com> <20190325191545.20707-2-yskoh@mellanox.com> In-Reply-To: <20190325191545.20707-2-yskoh@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: 8f4f59c0-6c40-465b-33ae-08d6b1e67d79 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3828; x-ms-traffictypediagnostic: AM0PR0502MB3828: x-microsoft-antispam-prvs: x-forefront-prvs: 09888BC01D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(366004)(376002)(346002)(199004)(189003)(25786009)(5660300002)(74316002)(14454004)(6116002)(105586002)(229853002)(6862004)(106356001)(4326008)(478600001)(7736002)(2906002)(305945005)(3846002)(6436002)(450100002)(6246003)(476003)(99286004)(446003)(66066001)(8936002)(11346002)(316002)(486006)(68736007)(9686003)(53936002)(71200400001)(71190400001)(97736004)(55016002)(6636002)(54906003)(14444005)(256004)(33656002)(102836004)(86362001)(7696005)(81156014)(81166006)(26005)(6506007)(186003)(52536014)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3828; H:AM0PR0502MB3795.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: vCEEG08t2rg3VHJfx3gcjbYDE/a1/13nTMSHEDYWH2xfWgDht39GYULPlubF/dpb/BytxrwcDqYazzUZLyfVZe21zbnuMaU86VorWqv4xQq4X2hPVOOeommdB7OaP5s6Uz9sMNWmILIF7ppd4DLmoOn9piAzyVDrHpchCOwaJ+JvQVQbg38X3oaVDlXHoDc3t2lJNmxJOY2J1TT9tSR+zYc9arguGhimEJFPrINb5MGe/Wrn0xHy/T5mogddMZTgK//mIYxRY+3oLg4gJT8MMcMuf205BuiwsgIq3EiCOidUh08XyjjSL+9sv5ityi2fRfESuhS92IpGKGxr9didK55lsVYqH7KChHV8XOJW7ArDXiFrOHtUmStUyBfFovHfBoKwgSvnB0PqavmUooc9XPpg+2/gnyGy3xjq0qDpmPk= 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: 8f4f59c0-6c40-465b-33ae-08d6b1e67d79 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Mar 2019 12:28:02.4072 (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: AM0PR0502MB3828 Subject: Re: [dpdk-dev] [PATCH v2 1/4] net/mlx5: fix memory event on 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190326122802.1BCGLaX51L-MsnG68AovYABozrhKYExvSnyvMauIek8@z> Monday, March 25, 2019 9:16 PM, Yongseok Koh: > Subject: [dpdk-dev] [PATCH v2 1/4] net/mlx5: fix memory event on > secondary process >=20 > As the memory event is propagated to secondary processes, the event is > processed redundantly. This should be processed once because the data > structure used for MR and the event is global across the processes. >=20 > Fixes: 974f1e7ef146 ("net/mlx5: add new memory region support") > Cc: stable@dpdk.org >=20 > Signed-off-by: Yongseok Koh Acked-by: Shahaf Shuler > --- > drivers/net/mlx5/mlx5.c | 5 +++-- > drivers/net/mlx5/mlx5_mr.c | 2 ++ > 2 files changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > ae4b71695e..dd29eba955 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -157,9 +157,10 @@ mlx5_prepare_shared_data(void) > if (rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY) { > LIST_INIT(&mlx5_shared_data- > >mem_event_cb_list); > rte_rwlock_init(&mlx5_shared_data- > >mem_event_rwlock); > + > rte_mem_event_callback_register("MLX5_MEM_EVENT_CB", > + > mlx5_mr_mem_event_cb, > + NULL); > } > - > rte_mem_event_callback_register("MLX5_MEM_EVENT_CB", > - mlx5_mr_mem_event_cb, > NULL); > } > rte_spinlock_unlock(&mlx5_shared_data_lock); > } > diff --git a/drivers/net/mlx5/mlx5_mr.c b/drivers/net/mlx5/mlx5_mr.c inde= x > 700d83d1bc..d336a77e40 100644 > --- a/drivers/net/mlx5/mlx5_mr.c > +++ b/drivers/net/mlx5/mlx5_mr.c > @@ -891,6 +891,8 @@ mlx5_mr_mem_event_cb(enum rte_mem_event > event_type, const void *addr, > struct mlx5_priv *priv; > struct mlx5_dev_list *dev_list =3D &mlx5_shared_data- > >mem_event_cb_list; >=20 > + /* Must be called from the primary process. */ > + assert(rte_eal_process_type() =3D=3D RTE_PROC_PRIMARY); > switch (event_type) { > case RTE_MEM_EVENT_FREE: > rte_rwlock_write_lock(&mlx5_shared_data- > >mem_event_rwlock); > -- > 2.11.0