From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 679D245512; Wed, 3 Jul 2024 02:35:16 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17961402C5; Wed, 3 Jul 2024 02:35:16 +0200 (CEST) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2130.outbound.protection.outlook.com [40.107.100.130]) by mails.dpdk.org (Postfix) with ESMTP id 9BFEC4003C for ; Wed, 3 Jul 2024 02:35:13 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=JLATvoIhV84SF5o3f1SM+I5amoKZGtp9mPXCvVXlMohszWMcjlKGiHHe7N8iSKgNKJ7J8GjuwL4LoMjGRZ0d3t5rdJt54Ezi9xpCONERh6GzJjPlsyPQ4NKfyGFJK4wHun+8D75ldXmn+9PsWSMtSmxJpp7mjJR9sJtS/wj1bvJr0V7d1DWM+GEW0aNQtqaa2q0I5VeWZoWR/A9cJAcI6VbwF2rEqwaiN63hTkcCINhodHELJXdqqBKwnnb+ToHcWokG5W6UqRXg3wA0U8dIJdloJbHnmTMdbbxv03paw9c+2C+5e6/hf4skdxqhdoIOrGhqWBGs0tnoN54ny4Ud2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HRkGtkMPgs39U6pU9l0hiDZ5X+0n/nowQ/WDXHcfu+Q=; b=dt5/cRotSRHBvY3Jq0nLebWfDRWb1zyax4Kip521EwW7pqTN+ZuRQepKGrUGcMLcqyEw/eVI+MxbB1wmMBzMENdDZ3c/QQi/o6rdfsVY7kttaRL2nIZpx95IVLLD3OWcuJq/PBQTuHnlahEzSqB21963cdt0G/aSA/F3WgvSqBFjwCgf7RHzYpM2OIPzcGn3iFHTxq9iCNeTOd8T0QDAuLXt/rOcqmB4g7AQX8KYUGiXE4+67PfKF8MGXdTwRw9asI+bYgA9nok5rUJCpEWEbpugzjYGzMUsbDecGVcNv/93Rh01lY9NxrcSPH61EG1aMkVtX5361697b4FbaDKveg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HRkGtkMPgs39U6pU9l0hiDZ5X+0n/nowQ/WDXHcfu+Q=; b=gZxnbJYNSdc0tGdoH1oiA7g6X7vh3b7FpOHUaC+dnJgDdGJYZkFFecXYa4SE9PXc+ixRYKOOjHVh9t604p4j6Hdii/5oP80zs7x6hsBXcRIu6geB1JZsluqBnIaI5BWTGGAsPX3FLe9Nw4JVipFkq9+a6suMj33pwot98J7XUJ8= Received: from PH7PR21MB3071.namprd21.prod.outlook.com (2603:10b6:510:1d0::12) by MW4PR21MB4066.namprd21.prod.outlook.com (2603:10b6:303:223::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7762.6; Wed, 3 Jul 2024 00:35:09 +0000 Received: from PH7PR21MB3071.namprd21.prod.outlook.com ([fe80::204c:c88b:65d2:7d3a]) by PH7PR21MB3071.namprd21.prod.outlook.com ([fe80::204c:c88b:65d2:7d3a%3]) with mapi id 15.20.7762.005; Wed, 3 Jul 2024 00:35:08 +0000 From: Long Li To: Alexander Skorichenko , "stephen@networkplumber.org" , Sam Andrew CC: "ferruh.yigit@amd.com" , "andrew.rybchenko@oktetlabs.ru" , Wei Hu , "dev@dpdk.org" , Matthew Smith Subject: RE: [PATCH] net/netvsc: fix mtu_set in netvsc devices Thread-Topic: [PATCH] net/netvsc: fix mtu_set in netvsc devices Thread-Index: AQHayXlOF03cba54hE+zrTp/XzdPH7HgdMaAgAKxtoCAAQfi0A== Date: Wed, 3 Jul 2024 00:35:08 +0000 Message-ID: References: <20240628163503.15893-1-askorichenko@netgate.com> <20240630084041.44e86a57@hermes.local> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-Mentions: samandrew@microsoft.com X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=f76f574f-b785-4f2b-8dd4-773b1d07b897; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2024-07-03T00:33:43Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR21MB3071:EE_|MW4PR21MB4066:EE_ x-ms-office365-filtering-correlation-id: 0740c3e4-7e01-4ad5-5802-08dc9af7fe02 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|1800799024|366016|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?EzI4AMo2Rqq/kfolcAGz4Y8b3BNbQVEryG+ioafeMDI4QFcYQzpFBzJQHQ9A?= =?us-ascii?Q?IIo+R38C0GuQW6eT5Z2K0rZi00makdK6vMvJq89AXLMJsoDdqO5s7urvyq9I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pVA5DWZAI6H6DBj5jRsFvczkVHPipdtgrJuU584L?= =?us-ascii?Q?uFDWceON/jEvTlm/sf+n44yt+OcTBSPmvEx69jUQPKhpaqtAVGG/a1IMqolY?= =?us-ascii?Q?zyRAtoqg5V6li1MHGI72/k/uzW2DF+K1abGH6In4bksMLLbrDr2GEKAf2D9r?= =?us-ascii?Q?rkUsbPC0wIjlM9P91Ohx5xcozsJmjssUQcu8L1Gly/LvEWPVDUogYMjWfN4P?= =?us-ascii?Q?mW1WQOes1Ey4w+FQjRgRKtwbWl6bBTsx2FIC8Mx52LlHebskKae5P6yoO5qM?= =?us-ascii?Q?fPYasLkhHGO0Nyi6YEIP+554ehxD58TxP2pMkgER9ZQyOAnTQNBsa7fDMQZK?= =?us-ascii?Q?sOhlql3KJ4hiZbymaa6CQ3810hNu1yA11qAM6lUz2SvIGinAw+ZYJ1hS0eqb?= =?us-ascii?Q?VNjN7MIshXRq9JIK3L4imPT3BCYXetbeGbf+vzpb04YtZsplPQ=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR21MB3071.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(366016)(376014)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?RbE4/GJJY9VR1/yKP7+60VPbb6Y30H2WZVGO8DY4N9FtL27VXpZY4khTnNQb?= =?us-ascii?Q?jqMpiJ0xnyjqchPp31ss4gFMTBOjyKEnTZDtO4Y+6ZcaXwaX+SULwC8iCCL/?= =?us-ascii?Q?RMDSPDJxUAPLIpZkldGWUhJG95NNLbym7zqvzCV4Vj2IiM3xz3Yf+h2njlTH?= =?us-ascii?Q?5srwL6gxoxE8lKehLOYDMTZqiCbPfYLuKjIhZ5SwviTkNmCr/b2RGFITE8WQ?= =?us-ascii?Q?d1fqbO2gEpJO+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?Q?hxid2vEvPBH0aeoTJk4K5auERl6CxB7XPxZHueYIDhQON9wVdOlA5GnzZtka?= =?us-ascii?Q?ckENJgApcPn9pWr6yMz2gtTyIKhwal69jau5+yA2bGCU8NZ52hC8e3OsK4fT?= =?us-ascii?Q?a1JcCmydfIKAtiyMnjE0YdyU++hKAaKiRiPRyEBq1VJiwlHGnMfu2GVmYLDh?= =?us-ascii?Q?H5rae43Fj5HK16/OLd3kl0CycbjOJIXK7jS6xTzZ4vigx/D1lo4H9oDz2/em?= =?us-ascii?Q?vQCKjQxul47CvYyYHStAEKK67T1birfPHgZB0SKIVZ/bmGErB6ZbNG27undX?= =?us-ascii?Q?J2SW1hWVfKP3mvODcT0RypZnQXO3MDHJuMXxb0b/Vs+PD8JWuftFHKFbJjvj?= =?us-ascii?Q?tfjBBGmMHwoDXUyHAotcSv5jhI9fuCydajsrc9n0cdbUxEZ3FHJXxCOhm0gK?= =?us-ascii?Q?kgeoK/N+Uo9I8RMZk6EdeGtNC3K0JDsB1MX1wSgs?= Content-Type: multipart/alternative; boundary="_000_PH7PR21MB3071639147C08FC949321153CEDD2PH7PR21MB3071namp_" MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR21MB3071.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0740c3e4-7e01-4ad5-5802-08dc9af7fe02 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jul 2024 00:35:08.8343 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lzfFtCa/xcPHJU4UkJTLMgnEJNkiTWNAsK4+wDfYLBn4tEC8wf7KggrcgCNZK60aCxbSsEBkv7LlRbdwk/s/mg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR21MB4066 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --_000_PH7PR21MB3071639147C08FC949321153CEDD2PH7PR21MB3071namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thank you, Alexander. The patch looks good to me. With this patch, do you see other problems with= VPP? I'd like to get a review from @Sam Andrew. Acked-by: Long Li From: Alexander Skorichenko Sent: Tuesday, July 2, 2024 1:49 AM To: stephen@networkplumber.org Cc: Sam Andrew ; ferruh.yigit@amd.com; andrew.rybc= henko@oktetlabs.ru; Long Li ; Wei Hu ; dev@dpdk.org; Matthew Smith Subject: Re: [PATCH] net/netvsc: fix mtu_set in netvsc devices You don't often get email from askorichenko@netgate.com. Learn why this is important Hello, The failure happens when running under VPP. In terms of dpdk calls the foll= owing sequence of events occurs for a NetVSC device: Durung device probing stage of VPP 1. eth_hn_dev_init() memory for a single primary rx_queue is allocated dev->data->rx_queues[0] =3D 0, allocated, but not set yet no allocation happened for tx_queues[i] and non-primary rx_queu= es[i] During device setup stage of VPP from VPP's own generic dpdk_device_setup()= : 2. rte_eth_dev_set_mtu() currently it segfaults in hn_reinit() when trying to reach into dev->data->rx_queues[i], dev->data->tx_queues[i] 3. rte_eth_tx_queue_setup() dev->data->tx_queues[i] are being allocated and set 4. rte_eth_rx_queue_setup() dev->data->rx_queues[i] get allocated (i > 0) and set So rx_queues[0] could be set in step 1, but rx_queues[i] and tx_queues[i] a= re still NULL. Allocating all the remaining rx/tx queues in step 1 would prevent the crash= , but then in steps 3-4 would go through releasing and allocating all of th= e queues again. Another comment regarding the uniform condition introduced in hn_reinit() i= n the patch: if (dev->data->rx_queues[0] !=3D NULL) ... Because of the difference between rx/tx queues described above, it's probab= ly safer to extend the condition to check both rx and tx separately if (dev->data->rx_queues[0] !=3D NULL && dev->data->tx_queues[0] != =3D NULL) - Alexander Skorichenko --_000_PH7PR21MB3071639147C08FC949321153CEDD2PH7PR21MB3071namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thank you, Alexander.

 

The patch looks good to me. With this patch, do you = see other problems with VPP?

 

I’d like to get a review from @Sam Andrew.

 

Acked-by: Long Li <longli@microsoft.com><= /o:p>

 

 

From: Alexander Skorichenko <asko= richenko@netgate.com>
Sent: Tuesday, July 2, 2024 1:49 AM
To: stephen@networkplumber.org
Cc: Sam Andrew <samandrew@microsoft.com>; ferruh.yigit@amd.com= ; andrew.rybchenko@oktetlabs.ru; Long Li <longli@microsoft.com>; Wei = Hu <weh@microsoft.com>; dev@dpdk.org; Matthew Smith <mgsmith@netga= te.com>
Subject: Re: [PATCH] net/netvsc: fix mtu_set in netvsc devices<= /o:p>

 

Hello,
The failure happens when running under VPP. In terms of dpdk calls the foll= owing sequence of events occurs for a NetVSC device:

Durung device probing stage of VPP
   1. eth_hn_dev_init() memory for a single primary rx_queue is a= llocated
            dev->data->rx_queues[0] =3D= 0, allocated, but not set yet
            no allocation happened for tx_que= ues[i] and non-primary rx_queues[i]

During device setup stage of VPP from VPP's own generic dpdk_device_setup()= :
   2.  rte_eth_dev_set_mtu()
            currently it segfaults in hn_rein= it() when trying to reach into
            dev->data->rx_queues[i], de= v->data->tx_queues[i]
   3.  rte_eth_tx_queue_setup()
            dev->data->tx_queues[i] are= being allocated and set
   4.  rte_eth_rx_queue_setup()
            dev->data->rx_queues[i] get= allocated (i > 0) and set

So rx_queues[0] could be set in step 1, but rx_queues[i] and tx_queues[i] a= re still NULL.
Allocating all the remaining rx/tx queues in step 1 would prevent the crash= , but then in steps 3-4 would go through releasing and allocating all of th= e queues again.

Another comment regarding the uniform condition introduced in hn_reinit() i= n the patch:
        if (dev->data->rx_queues[0] !=3D NULL) ..= .
Because of the difference between rx/tx queues described above, it's probab= ly safer to extend the condition to check both rx and tx separately
        if (dev->data->rx_queues[0] !=3D NULL &am= p;& dev->data->tx_queues[0] !=3D NULL)
       
- Alexander Skorichenko

 

--_000_PH7PR21MB3071639147C08FC949321153CEDD2PH7PR21MB3071namp_--