From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20063.outbound.protection.outlook.com [40.107.2.63]) by dpdk.org (Postfix) with ESMTP id 70EAE44C3; Wed, 8 May 2019 06:44:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s3hmSxVIqGim3sI1vkGh8MjzrB4Sf3kbO7xHWtB4CEo=; b=X7aPCyC1AA+9AI5U59KAOTFZNr1upw2oo6UASLh6bfBW6OOYZ0hFpqxjINdn0dSrRyy3a7moMP3b4YqhZweNdven4ZTR122ch58uR2LsW4aK8ZywbbKq9319VLtC70p3XrDwQHDqUlxebYgcG03nTGyadeT+m7ZMi65HO1bdxZg= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB4001.eurprd05.prod.outlook.com (52.133.36.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 04:44:13 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::8c0:a6ef:6abc:334d]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::8c0:a6ef:6abc:334d%7]) with mapi id 15.20.1856.012; Wed, 8 May 2019 04:44:13 +0000 From: Shahaf Shuler To: Dekel Peled , Yongseok Koh CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3] net/mlx5: fix init with zero Rx queues Thread-Index: AQHVAzhKO3UqH7MGpEeiSFFv8qXCLqZgpNSQ Date: Wed, 8 May 2019 04:44:13 +0000 Message-ID: References: <02664e0b50e375e0b0d4ee05c8ad554295b0ccde.1556794185.git.dekelp@mellanox.com> <0df2fcb64b1ed5250aea42b65a5791c72291cf0b.1557056580.git.dekelp@mellanox.com> In-Reply-To: <0df2fcb64b1ed5250aea42b65a5791c72291cf0b.1557056580.git.dekelp@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: b338e927-274d-478e-1d3b-08d6d36fd1db x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR0502MB4001; x-ms-traffictypediagnostic: AM0PR0502MB4001: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0031A0FFAF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(396003)(39860400002)(136003)(199004)(189003)(305945005)(26005)(55016002)(66946007)(2906002)(73956011)(76116006)(25786009)(110136005)(7736002)(316002)(54906003)(33656002)(7696005)(4326008)(64756008)(66556008)(45080400002)(6116002)(186003)(9686003)(68736007)(256004)(99286004)(3846002)(450100002)(6436002)(66446008)(5660300002)(6306002)(66066001)(81166006)(81156014)(8936002)(6246003)(66476007)(14454004)(446003)(8676002)(52536014)(6636002)(74316002)(11346002)(53936002)(486006)(966005)(76176011)(71200400001)(71190400001)(86362001)(102836004)(476003)(478600001)(229853002)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB4001; 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: ej+M87J/zGp2A6By61mpS++4qlnNCRAxQrFs90C/97RnoANN3ItShdQLXiZ+o4C+IujmlCYhASDCb4iTfh1OYh4219iIYDVNUAJjwY6F53cbO08g8TTc7NT9xI1j/WraQwyhfN0fyQ4X9rY/fWQ+NoaDRuwLRhBVero7DbyEPSlDAOZxpSPpIbmd479lrgT7tLDgc40SkZr00jRv2tPVv6EGWhKquOXrb8vBeNXsCmPiD0Udb5/YpJsmfsh9QzxuX9L8ifzJbsGH25O3oSO0baTMItx8P6XWDLttdX/aLOXIioskfTmLTvJNyJPS/Ty0GFXdaFAcom893/c0hm+vcqTJks7RupN48Cc//5GNyHzyigewwxThoiTLuAaBUiDPnWnsOLF8HeLjuCgeI7Rrro3WOmIRJozHzb9W1FIP+V8= 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: b338e927-274d-478e-1d3b-08d6d36fd1db X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2019 04:44:13.3523 (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: AM0PR0502MB4001 Subject: Re: [dpdk-dev] [PATCH v3] net/mlx5: fix init with zero Rx queues 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: Wed, 08 May 2019 04:44:14 -0000 Sunday, May 5, 2019 2:44 PM, Dekel Peled: > Subject: [dpdk-dev] [PATCH v3] net/mlx5: fix init with zero Rx queues >=20 > Recent patch [1] added, at the end of mlx5_dev_configure(), a call to > mlx5_proc_priv_init(), initializing process_private data of eth_dev. > This call is not reached if PMD is started with zero Rx queues. > In this case mlx5_dev_configure() returns earlier due to the check: > if (rxqs_n =3D=3D priv->rxqs_n) > return 0; > In such a scenario, later references to uninitialized process_private dat= a will > result in segmentation fault. > For example see in function txq_uar_init(). >=20 > This patch changes the check logic. The following code is executed if (rx= qs_n > !=3D priv->rxqs_n), and skipped otherwise. > Function mlx5_proc_priv_init() is always invoked, to ensure process_priva= te > data is initialized. >=20 > [1] > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatch > es.dpdk.org%2Fpatch%2F52629%2F&data=3D02%7C01%7Cshahafs%40mel > lanox.com%7C18b3d5bb065348a57ef408d6d14f6b26%7Ca652971c7d2e4d9ba > 6a4d149256f461b%7C0%7C0%7C636926536374830910&sdata=3D7KXyV1U7 > 9P%2Bhc4HtZ8W05m95ZYyhY0m0Yc3A9NECvwo%3D&reserved=3D0 >=20 > Fixes: 120dc4a7dcd3 ("net/mlx5: remove device register remap") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dekel Peled > Acked-by: Yongseok Koh Applied to next-net-mlx, thanks. 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 7005AA0096 for ; Wed, 8 May 2019 06:44:16 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id CAB7A3772; Wed, 8 May 2019 06:44:15 +0200 (CEST) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20063.outbound.protection.outlook.com [40.107.2.63]) by dpdk.org (Postfix) with ESMTP id 70EAE44C3; Wed, 8 May 2019 06:44:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s3hmSxVIqGim3sI1vkGh8MjzrB4Sf3kbO7xHWtB4CEo=; b=X7aPCyC1AA+9AI5U59KAOTFZNr1upw2oo6UASLh6bfBW6OOYZ0hFpqxjINdn0dSrRyy3a7moMP3b4YqhZweNdven4ZTR122ch58uR2LsW4aK8ZywbbKq9319VLtC70p3XrDwQHDqUlxebYgcG03nTGyadeT+m7ZMi65HO1bdxZg= Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com (52.133.45.150) by AM0PR0502MB4001.eurprd05.prod.outlook.com (52.133.36.157) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1856.12; Wed, 8 May 2019 04:44:13 +0000 Received: from AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::8c0:a6ef:6abc:334d]) by AM0PR0502MB3795.eurprd05.prod.outlook.com ([fe80::8c0:a6ef:6abc:334d%7]) with mapi id 15.20.1856.012; Wed, 8 May 2019 04:44:13 +0000 From: Shahaf Shuler To: Dekel Peled , Yongseok Koh CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3] net/mlx5: fix init with zero Rx queues Thread-Index: AQHVAzhKO3UqH7MGpEeiSFFv8qXCLqZgpNSQ Date: Wed, 8 May 2019 04:44:13 +0000 Message-ID: References: <02664e0b50e375e0b0d4ee05c8ad554295b0ccde.1556794185.git.dekelp@mellanox.com> <0df2fcb64b1ed5250aea42b65a5791c72291cf0b.1557056580.git.dekelp@mellanox.com> In-Reply-To: <0df2fcb64b1ed5250aea42b65a5791c72291cf0b.1557056580.git.dekelp@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: b338e927-274d-478e-1d3b-08d6d36fd1db x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(4618075)(2017052603328)(7193020); SRVR:AM0PR0502MB4001; x-ms-traffictypediagnostic: AM0PR0502MB4001: x-ms-exchange-purlcount: 1 x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0031A0FFAF x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(396003)(39860400002)(136003)(199004)(189003)(305945005)(26005)(55016002)(66946007)(2906002)(73956011)(76116006)(25786009)(110136005)(7736002)(316002)(54906003)(33656002)(7696005)(4326008)(64756008)(66556008)(45080400002)(6116002)(186003)(9686003)(68736007)(256004)(99286004)(3846002)(450100002)(6436002)(66446008)(5660300002)(6306002)(66066001)(81166006)(81156014)(8936002)(6246003)(66476007)(14454004)(446003)(8676002)(52536014)(6636002)(74316002)(11346002)(53936002)(486006)(966005)(76176011)(71200400001)(71190400001)(86362001)(102836004)(476003)(478600001)(229853002)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR0502MB4001; 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: ej+M87J/zGp2A6By61mpS++4qlnNCRAxQrFs90C/97RnoANN3ItShdQLXiZ+o4C+IujmlCYhASDCb4iTfh1OYh4219iIYDVNUAJjwY6F53cbO08g8TTc7NT9xI1j/WraQwyhfN0fyQ4X9rY/fWQ+NoaDRuwLRhBVero7DbyEPSlDAOZxpSPpIbmd479lrgT7tLDgc40SkZr00jRv2tPVv6EGWhKquOXrb8vBeNXsCmPiD0Udb5/YpJsmfsh9QzxuX9L8ifzJbsGH25O3oSO0baTMItx8P6XWDLttdX/aLOXIioskfTmLTvJNyJPS/Ty0GFXdaFAcom893/c0hm+vcqTJks7RupN48Cc//5GNyHzyigewwxThoiTLuAaBUiDPnWnsOLF8HeLjuCgeI7Rrro3WOmIRJozHzb9W1FIP+V8= 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: b338e927-274d-478e-1d3b-08d6d36fd1db X-MS-Exchange-CrossTenant-originalarrivaltime: 08 May 2019 04:44:13.3523 (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: AM0PR0502MB4001 Subject: Re: [dpdk-dev] [PATCH v3] net/mlx5: fix init with zero Rx queues 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: <20190508044413.mKdISK--8sAY0iSFvPN8Pia-uyc1POH8ouh8MZMW4qc@z> Sunday, May 5, 2019 2:44 PM, Dekel Peled: > Subject: [dpdk-dev] [PATCH v3] net/mlx5: fix init with zero Rx queues >=20 > Recent patch [1] added, at the end of mlx5_dev_configure(), a call to > mlx5_proc_priv_init(), initializing process_private data of eth_dev. > This call is not reached if PMD is started with zero Rx queues. > In this case mlx5_dev_configure() returns earlier due to the check: > if (rxqs_n =3D=3D priv->rxqs_n) > return 0; > In such a scenario, later references to uninitialized process_private dat= a will > result in segmentation fault. > For example see in function txq_uar_init(). >=20 > This patch changes the check logic. The following code is executed if (rx= qs_n > !=3D priv->rxqs_n), and skipped otherwise. > Function mlx5_proc_priv_init() is always invoked, to ensure process_priva= te > data is initialized. >=20 > [1] > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatch > es.dpdk.org%2Fpatch%2F52629%2F&data=3D02%7C01%7Cshahafs%40mel > lanox.com%7C18b3d5bb065348a57ef408d6d14f6b26%7Ca652971c7d2e4d9ba > 6a4d149256f461b%7C0%7C0%7C636926536374830910&sdata=3D7KXyV1U7 > 9P%2Bhc4HtZ8W05m95ZYyhY0m0Yc3A9NECvwo%3D&reserved=3D0 >=20 > Fixes: 120dc4a7dcd3 ("net/mlx5: remove device register remap") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dekel Peled > Acked-by: Yongseok Koh Applied to next-net-mlx, thanks.