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 509FA43E4C; Fri, 12 Apr 2024 18:51:01 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0628402A8; Fri, 12 Apr 2024 18:51:00 +0200 (CEST) Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2139.outbound.protection.outlook.com [40.107.6.139]) by mails.dpdk.org (Postfix) with ESMTP id 2875440299 for ; Fri, 12 Apr 2024 18:50:59 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eLtoydinecNCPCUAufw24SsqhFt6wysRzM+5CqxvDajR4HcPaQol11mL9sbKQT4nQJIKhcfcELavZCjRMvhkKQ+ZQnT6kL+YKTD6e58Ib7jGWJWrZX5nS1SLK+fBDbpR2qweEwT4gPd1a67yBsYxU30Ysy9renbR+lcdM71fqinXf3VJallIRcY3MMPUtCEFZQQrdF59exOD6Ual1TQ6uixar/1o9ZW8isUYP4NjZfZ9aouB9MdoQzQFcQIEV+GBFAUJQB4eb/h4fTDF2Lv6tb+UHTkbf4F6fDWmQY7HRpKlRSUJCEGaCmPRAgVE8AVL7Ly0uPR9imFVGXoioZ+77A== 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=T6zMT6j5BThAYKL5QXku8/1qF/m2y6JouTZ/VWUb4JA=; b=kJCgg3MHwFh8xG+W4fJQ3BYf8j2xBaJsupYTr3DYkfx1y+fXRSie09B4A584Ix/thJ8qKyVuevk97tw7Z7N7fpNFqZw+U8+ToBYYQFbz2Cv6kWtjCg/Fx3kQ5nN+mpR5qrxk9WimCvhX2xrCGzK4vpAFJ9XXx+4ESsc93SGHb/aj2rYxmWWsarnBlKIawkpTgcmLv9NIw8SHNySWzQOWEZlEXZCVDfojZQ6U1wJa8si8fHu9RY6ajILFFnmvXqoUiGDtDyfOSnbDQj+ZNwbQsq2r3Vl/YcDMdK5ru5xFZ3v9xmnroBYQU1P2AkBo+i+8I3celQnNfF9XH8kNrsq9uQ== 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=T6zMT6j5BThAYKL5QXku8/1qF/m2y6JouTZ/VWUb4JA=; b=K/3/RplQHinRIgVvP4SwrCFQBV9MjxZKM3fTguiVTU8BbtY4GKJ6D9MPKzHxtnjvMjQzeotzVj0cpX4VrExceec+0WJJLPjfCbWImpyzj7aR/kOOy9qNsEAVNa+4jKKtlfsKE3kVVhpYiw/w2NgyGXJAcIjAWRy6EGEtFMajuW4= Received: from PA4PR83MB0526.EURPRD83.prod.outlook.com (2603:10a6:102:26b::17) by VI1PR83MB0415.EURPRD83.prod.outlook.com (2603:10a6:800:196::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.14; Fri, 12 Apr 2024 16:50:55 +0000 Received: from PA4PR83MB0526.EURPRD83.prod.outlook.com ([fe80::f0b:6b7f:eef8:2bcc]) by PA4PR83MB0526.EURPRD83.prod.outlook.com ([fe80::f0b:6b7f:eef8:2bcc%2]) with mapi id 15.20.7495.012; Fri, 12 Apr 2024 16:50:55 +0000 From: Alan Elder To: Ferruh Yigit , Long Li , Andrew Rybchenko CC: "dev@dpdk.org" , stephen Subject: RE: [EXTERNAL] Re: [PATCH v3] net/netvsc: fix number Tx queues > Rx queues Thread-Topic: [EXTERNAL] Re: [PATCH v3] net/netvsc: fix number Tx queues > Rx queues Thread-Index: AQHaeggTqFpeoId2+UWfevTY136nBrFjFWiAgACW9hCAAOZ0gIAAag/Q Date: Fri, 12 Apr 2024 16:50:55 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=7f3f590f-c596-407c-b78d-2e9b7c339fed; 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-04-12T16:42:56Z; 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: PA4PR83MB0526:EE_|VI1PR83MB0415:EE_ x-ms-office365-filtering-correlation-id: 5671933f-2555-42ff-25d3-08dc5b10b89c x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: =?us-ascii?Q?n25zj2SlAWfsRrWMH/lZZ8jDEZSGarwovxwipehY/CVOFWgDv1Bd8rZ78vmi?= =?us-ascii?Q?JqFDofCUcY7el5QA1w7lOc7S6D9Kmto/8M6M4jqkkRAwL/jCqz4bxOP66a4c?= =?us-ascii?Q?bknPYSzeHWd5lwbHvEXHfA7mTYJSEyre2EL5AtkUumK6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cfJMnuk+sQE0LxFOctzs/pt32qQxjkmF42wN60y?= =?us-ascii?Q?k2UmwNL9gVvqI3mysehIhfP4TlYBJdg4ldB48JZyi1ypdVQ8S9y1M1xd4A8G?= =?us-ascii?Q?nd+71bN8bZs2GZsgBb38Wj5wJdjrvWArLsNcGG46ao4kBVz17hjXCrqCfqzv?= =?us-ascii?Q?+92WrBE5vT04ponI1WHB5bzchegEmQ42HgW9HUzTCODIdrAQiOKOC62LNC8I?= =?us-ascii?Q?CLDghCQScjylUim8kRDjekD9a03H8Ip0+WAwjhRtpZmk6Kvdm1Yh4WG67ImR?= =?us-ascii?Q?x0VTKBklfBbYX1ih/Pz/L3adN7L5g+Ee/6OduGkSzmR4Nw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR83MB0526.EURPRD83.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(376005)(366007)(1800799015)(38070700009); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Zw6SSsmRZ5/s4tz2a7JQDe6Re2bKtlP2Pgam0VxtZ8YLKTJNy3DjcBmtEnAU?= =?us-ascii?Q?9e4op7eb0pEM6VwHY/+Al1iKxbeejRCCqwoL+XuQPr8GqBQhxbc+Wa6Ixiee?= =?us-ascii?Q?u5oZ3dd/gu5g1tfjU2mbXJxL3oDmip9bGYNRJ/OkLLsXij3E66YeyHjIlgRV?= =?us-ascii?Q?7A6QhN7twcn98yhLJ0iNzVU9ol9iBF0JvgQ/u43ra4kXCM4UtnzmTz2HU3ER?= =?us-ascii?Q?8mNIunR1K1jzJVLELcfl7J03X4OdqhUniLL+IAvsnLWzVHuiDOSsHd0jR7QA?= =?us-ascii?Q?ggez47ts13UJxDuYkMR6lKuYYVTWIUOOTxU+XdiMuFsrXd7OI+LHK9Y4RkW4?= =?us-ascii?Q?APzk3cMs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?= =?us-ascii?Q?QKDCTUAiUx+Y8q1WNoBFjrOkP6haXvXHBUdRdGN9RMkIZiElNwbyn5zoICl4?= =?us-ascii?Q?27rPAfea17cx15GtyyLZ849Giuday55ldj2uHI5LuKpRAFTcYL5ulfFYmZcr?= =?us-ascii?Q?hInbi7FFz0L5N3gV2IkMYRMkiCoY3JlCyfDme4yV6IbHWs9PcOcOGvjI1xeP?= =?us-ascii?Q?n9FCoqrySCqXJ9TSunvrWCniGrvs8pZlMBOxDI+QjX51ZDv582MeRgBxR0Rq?= =?us-ascii?Q?kfHG3cIsV5IYGifUjT//b6tMUTgCSKRBBQe+AffMd8wqrI/+24HH/AoVCKjk?= =?us-ascii?Q?rNLSQywQEQtj4s0tCnxCugYcw1EQ9IvVL3xWZyfu?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PA4PR83MB0526.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5671933f-2555-42ff-25d3-08dc5b10b89c X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Apr 2024 16:50:55.3994 (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: KUe6xt80GaiVvbOITSsHYw1qyvl0itNMQ8NolVozFYMtY1L6+GLRnF3Gkx5p5IK0ehFO5+N/BUq7+OsLFY1b6g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR83MB0415 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 > -----Original Message----- > From: Ferruh Yigit > Sent: Friday, April 12, 2024 6:23 AM > To: Alan Elder ; Long Li = ; > Andrew Rybchenko > Cc: dev@dpdk.org; stephen > Subject: Re: [EXTERNAL] Re: [PATCH v3] net/netvsc: fix number Tx queues >= Rx > queues >=20 > On 4/11/2024 9:45 PM, Alan Elder wrote: > >> -----Original Message----- > >> From: Ferruh Yigit > >> Sent: Thursday, April 11, 2024 7:38 AM > >> To: Alan Elder ; Long Li > >> ; Andrew Rybchenko > >> > >> Cc: dev@dpdk.org; stephen > >> Subject: [EXTERNAL] Re: [PATCH v3] net/netvsc: fix number Tx queues > > >> Rx queues > >> > >> On 3/19/2024 2:16 PM, Alan Elder wrote: > >>> The previous code allowed the number of Tx queues to be set higher > >>> than the number of Rx queues. If a packet was sent on a Tx queue > >>> with index > >>>> =3D number Rx queues there was a segfault. > >>> This commit fixes the issue by creating an Rx queue for every Tx > >>> queue meaning that an event buffer is allocated to handle receiving > >>> Tx completion messages. > >>> > >>> mbuf pool and Rx ring are not allocated for these additional Rx > >>> queues and RSS configuration ensures that no packets are received on > them. > >>> > >>> Fixes: 4e9c73e96e83 ("net/netvsc: add Hyper-V network device") > >>> Cc: sthemmin@microsoft.com > >>> Cc: stable@dpdk.org > >>> > >>> Signed-off-by: Alan Elder > >>> > >> > >> Hi Alan, > >> > >> What is the root cause of the crash, is it in driver scope or applicat= ion? > > > > Hi Ferruh, > > > > The root cause of the crash was in the driver - a packet received on a = Tx > queue that had no corresponding Rx queue would cause the dev->data- > >rx_queues[] array to be accessed past the length of the array. > > > > https://nam06.safelinks.protection.outlook.com/?url=3Dhttps%3A%2F%2Fgit= h > > > ub.com%2FDPDK%2Fdpdk%2Fblob%2Fmain%2Fdrivers%2Fnet%2Fnetvsc%2Fhn > _rxtx. > > > c%23L1071&data=3D05%7C02%7Calan.elder%40microsoft.com%7C3985f99c07c1 > 4a64 > > > 99fd08dc5ada98d0%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6 > 3848514 > > > 2149539930%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjo > iV2luMzI > > > iLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=3DY%2F6lr6v2j4Q > cSm6g0 > > dTcV%2FEimyfPs0nMBJ0X5s9omAE%3D&reserved=3D0 > > > > >=20 > Why there is an access to Rx queue when processing Tx queue? >=20 > A backtrace of the crash can help to understand the issue, can you please > include this in commit log, plus some explanation why crash happens? >=20 > Thanks, > Ferruh Hi Ferruh, Netvsc slow path needs to handle Tx completion messages (to know when it ca= n reclaim Tx buffers). Tx completion messages are received on Rx queue, wh= ich is why the Rx queue is accessed as part of transmit processing. An example call stack is: #6 rte_spinlock_trylock (sl=3D0x20) at /include/rte_spinlock.h #7 hn_process_events (hv=3D, queue_id=3D2, tx_limit=3D) at /drivers/net/ne= tvsc/hn_rxtx.c #8 hn_xmit_pkts (ptxq=3D, tx_pkts=3D, nb_pkts=3D1) at /drivers/net/netvsc/= hn_rxtx.c Which leads to the SEGV as 0x20 is not a valid address. I'll update the commit messages and resubmit the patch. Thanks, Alan=20