From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60048.outbound.protection.outlook.com [40.107.6.48]) by dpdk.org (Postfix) with ESMTP id 1F9D5239 for ; Thu, 14 Mar 2019 13:36:30 +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=RzgnIVEC3ufp9FGIcSKFN1ZS0A5fYjZ7G/wjV6fDY+Q=; b=BI/AyNTb73HHBQm0j01pVaZ24IeWBZocxiusAwcQ+YuMRsTWNteihKXiJFzgVQERkXrWeSvhKtta/LNKKfXjYIY4zayxYc8r5Yiw0s7d+fOv2trkcVPo9WEnZy5mztZ8CA9YTi3LcfS+mZpjGgQtJ4Jk8tvToSZTA/u3MuvEjRE= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3891.eurprd05.prod.outlook.com (52.133.45.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Thu, 14 Mar 2019 12:36:29 +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.1709.011; Thu, 14 Mar 2019 12:36:29 +0000 From: Shahaf Shuler To: Yongseok Koh CC: "dev@dpdk.org" Thread-Topic: [PATCH 3/4] net/mlx5: rework PMD global data init Thread-Index: AQHU1LgX7zYIOT32k0ySUzf2696uVKYK78KQ Date: Thu, 14 Mar 2019 12:36:28 +0000 Message-ID: References: <20190307073314.18324-1-yskoh@mellanox.com> <20190307073314.18324-4-yskoh@mellanox.com> In-Reply-To: <20190307073314.18324-4-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: 0e806c46-38c2-4d91-8720-08d6a879ae79 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3891; x-ms-traffictypediagnostic: AM0PR0502MB3891: x-microsoft-antispam-prvs: x-forefront-prvs: 09760A0505 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(346002)(39860400002)(136003)(189003)(199004)(7696005)(99286004)(186003)(6116002)(14454004)(3846002)(446003)(11346002)(26005)(5660300002)(86362001)(486006)(14444005)(33656002)(256004)(476003)(52536014)(53936002)(71190400001)(71200400001)(66066001)(74316002)(8936002)(305945005)(106356001)(6436002)(8676002)(2906002)(6636002)(229853002)(68736007)(81166006)(81156014)(76176011)(105586002)(4326008)(6506007)(9686003)(6862004)(55016002)(6246003)(102836004)(7736002)(25786009)(478600001)(316002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3891; 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: 5QxtALloI/xGlly7p+ii+Q1lCtwAoDDvtv1zArs+gqUEGcME8V/OwEE8wTHgn8Qxcxybm5o3c0hlvrurDo92aCRtd05fbKZKlbmW3zjYAdzh09t9c7mmcOCZqIIhBR2k2XsqH8UIhK3pyzeeqFdCc7PyLuQ3Ac6tEcK+lvCmWA+NCoAUGwCKH35GFchz6DOJKq/J3kbZhn1p7juWi5MXtlpuwe7v+MimShbSFNjDfPaUoIYlbtIGwTexnw/M7rTiLhc9rXb49mQUa9xYqWymsbHxQpG9iqYbI9BxN8Ha6pI3UBKUjTe50ORav9ETy9SF6jq7PsFowlisxAIWQEIbatB/zVN3Zkuh2gBg5jfgnZtQzoB9QgMTXzW/4aOk6M5rAiCw4H76+zsAHmNxzE9Wob/ZKdrHOPqXmOzcg/k9OAk= 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: 0e806c46-38c2-4d91-8720-08d6a879ae79 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2019 12:36:28.9651 (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: AM0PR0502MB3891 Subject: Re: [dpdk-dev] [PATCH 3/4] net/mlx5: rework PMD global data init 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: Thu, 14 Mar 2019 12:36:30 -0000 Hi Koh, Thursday, March 7, 2019 9:33 AM, Yongseok Koh: > Subject: [PATCH 3/4] net/mlx5: rework PMD global data init >=20 > There's more need to have PMD global data structure. It should be initial= ized > once per a process regardless of how many PMD instances are probed. > mlx5_init_once() is called during probing and make sure all the init func= tions > are called once per a process. The existing shared memory gets more > extensively used for this purpose. As there could be multiple secondary > processes, a static storage (local to process) is also added. It is hard to understand from the commit log what was missing on the old de= sign.=20 >=20 > As the reserved virtual address for UAR remap is a PMD global resource, t= his > doesn't need to be stored in the device priv structure, but in the PMD gl= obal > data. I thought we agreed to drop those and have different VA for each process.=20 If so, is the extra work on the UAR here is needed?=20 >=20 > Signed-off-by: Yongseok Koh > --- > drivers/net/mlx5/mlx5.c | 250 ++++++++++++++++++++++++++++++++-- > ---------- > drivers/net/mlx5/mlx5.h | 19 +++- > drivers/net/mlx5/mlx5_mp.c | 19 +++- > drivers/net/mlx5/mlx5_txq.c | 7 +- > 4 files changed, 217 insertions(+), 78 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > 6ed2418106..ea8fd55ee6 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -128,16 +128,26 @@ struct mlx5_shared_data *mlx5_shared_data; > /* Spinlock for mlx5_shared_data allocation. */ static rte_spinlock_t > mlx5_shared_data_lock =3D RTE_SPINLOCK_INITIALIZER; >=20 > +/* Process local data for secondary processes. */ static struct > +mlx5_local_data mlx5_local_data; Why not storing this context as part of ethdev-> process_private instead of= declaring it static?=20 > + > /** Driver-specific log messages type. */ int mlx5_logtype; >=20 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 41B5EA0096 for ; Thu, 14 Mar 2019 13:36:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5871A3572; Thu, 14 Mar 2019 13:36:31 +0100 (CET) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-eopbgr60048.outbound.protection.outlook.com [40.107.6.48]) by dpdk.org (Postfix) with ESMTP id 1F9D5239 for ; Thu, 14 Mar 2019 13:36:30 +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=RzgnIVEC3ufp9FGIcSKFN1ZS0A5fYjZ7G/wjV6fDY+Q=; b=BI/AyNTb73HHBQm0j01pVaZ24IeWBZocxiusAwcQ+YuMRsTWNteihKXiJFzgVQERkXrWeSvhKtta/LNKKfXjYIY4zayxYc8r5Yiw0s7d+fOv2trkcVPo9WEnZy5mztZ8CA9YTi3LcfS+mZpjGgQtJ4Jk8tvToSZTA/u3MuvEjRE= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB3891.eurprd05.prod.outlook.com (52.133.45.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.13; Thu, 14 Mar 2019 12:36:29 +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.1709.011; Thu, 14 Mar 2019 12:36:29 +0000 From: Shahaf Shuler To: Yongseok Koh CC: "dev@dpdk.org" Thread-Topic: [PATCH 3/4] net/mlx5: rework PMD global data init Thread-Index: AQHU1LgX7zYIOT32k0ySUzf2696uVKYK78KQ Date: Thu, 14 Mar 2019 12:36:28 +0000 Message-ID: References: <20190307073314.18324-1-yskoh@mellanox.com> <20190307073314.18324-4-yskoh@mellanox.com> In-Reply-To: <20190307073314.18324-4-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: 0e806c46-38c2-4d91-8720-08d6a879ae79 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR0502MB3891; x-ms-traffictypediagnostic: AM0PR0502MB3891: x-microsoft-antispam-prvs: x-forefront-prvs: 09760A0505 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(346002)(39860400002)(136003)(189003)(199004)(7696005)(99286004)(186003)(6116002)(14454004)(3846002)(446003)(11346002)(26005)(5660300002)(86362001)(486006)(14444005)(33656002)(256004)(476003)(52536014)(53936002)(71190400001)(71200400001)(66066001)(74316002)(8936002)(305945005)(106356001)(6436002)(8676002)(2906002)(6636002)(229853002)(68736007)(81166006)(81156014)(76176011)(105586002)(4326008)(6506007)(9686003)(6862004)(55016002)(6246003)(102836004)(7736002)(25786009)(478600001)(316002)(97736004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB3891; 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: 5QxtALloI/xGlly7p+ii+Q1lCtwAoDDvtv1zArs+gqUEGcME8V/OwEE8wTHgn8Qxcxybm5o3c0hlvrurDo92aCRtd05fbKZKlbmW3zjYAdzh09t9c7mmcOCZqIIhBR2k2XsqH8UIhK3pyzeeqFdCc7PyLuQ3Ac6tEcK+lvCmWA+NCoAUGwCKH35GFchz6DOJKq/J3kbZhn1p7juWi5MXtlpuwe7v+MimShbSFNjDfPaUoIYlbtIGwTexnw/M7rTiLhc9rXb49mQUa9xYqWymsbHxQpG9iqYbI9BxN8Ha6pI3UBKUjTe50ORav9ETy9SF6jq7PsFowlisxAIWQEIbatB/zVN3Zkuh2gBg5jfgnZtQzoB9QgMTXzW/4aOk6M5rAiCw4H76+zsAHmNxzE9Wob/ZKdrHOPqXmOzcg/k9OAk= 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: 0e806c46-38c2-4d91-8720-08d6a879ae79 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Mar 2019 12:36:28.9651 (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: AM0PR0502MB3891 Subject: Re: [dpdk-dev] [PATCH 3/4] net/mlx5: rework PMD global data init 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: <20190314123628.qXqBnCuxdVYQOQkgYOyBTBXnV9zNAHtb5FCTSQJm71M@z> Hi Koh, Thursday, March 7, 2019 9:33 AM, Yongseok Koh: > Subject: [PATCH 3/4] net/mlx5: rework PMD global data init >=20 > There's more need to have PMD global data structure. It should be initial= ized > once per a process regardless of how many PMD instances are probed. > mlx5_init_once() is called during probing and make sure all the init func= tions > are called once per a process. The existing shared memory gets more > extensively used for this purpose. As there could be multiple secondary > processes, a static storage (local to process) is also added. It is hard to understand from the commit log what was missing on the old de= sign.=20 >=20 > As the reserved virtual address for UAR remap is a PMD global resource, t= his > doesn't need to be stored in the device priv structure, but in the PMD gl= obal > data. I thought we agreed to drop those and have different VA for each process.=20 If so, is the extra work on the UAR here is needed?=20 >=20 > Signed-off-by: Yongseok Koh > --- > drivers/net/mlx5/mlx5.c | 250 ++++++++++++++++++++++++++++++++-- > ---------- > drivers/net/mlx5/mlx5.h | 19 +++- > drivers/net/mlx5/mlx5_mp.c | 19 +++- > drivers/net/mlx5/mlx5_txq.c | 7 +- > 4 files changed, 217 insertions(+), 78 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > 6ed2418106..ea8fd55ee6 100644 > --- a/drivers/net/mlx5/mlx5.c > +++ b/drivers/net/mlx5/mlx5.c > @@ -128,16 +128,26 @@ struct mlx5_shared_data *mlx5_shared_data; > /* Spinlock for mlx5_shared_data allocation. */ static rte_spinlock_t > mlx5_shared_data_lock =3D RTE_SPINLOCK_INITIALIZER; >=20 > +/* Process local data for secondary processes. */ static struct > +mlx5_local_data mlx5_local_data; Why not storing this context as part of ethdev-> process_private instead of= declaring it static?=20 > + > /** Driver-specific log messages type. */ int mlx5_logtype; >=20