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 2F9E943E7D; Mon, 15 Apr 2024 20:11:34 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9CA1B4028B; Mon, 15 Apr 2024 20:11:33 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2067.outbound.protection.outlook.com [40.107.223.67]) by mails.dpdk.org (Postfix) with ESMTP id B4CB84021E for ; Mon, 15 Apr 2024 20:11:31 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Tms37nzVOfrbFwys2gHRMN6f4MQEJgSu4WM4y9GHwFDp4AbZxFHOXlLBUa0Nets6kJdQfUScE0I2x3W5roxSasSd5ZYcSkcGCah1oppwo1KYYTPPqiXGwVuXbNeQNEoYriZvUMRBMm1rPddxct/EEWfgOq0KsSg6zpAKxA4C+R25uivbMzwER6G8XGtVzp2XcUFhEC2mZLwMi1vAs8w8AN0vWyST6qWl39Vr3GA+rz4drUmL+Ds+Aq2AuU2EYv4NWKPlLtQWI8o/UgLq0rS27FSwDxBCg8VP+1989AQN12NSAA/aQ6AysddlSAczgl8tfjwsxTjFGUzE7cfPDytiyA== 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=D/guOp/DtD46a58qSgD//kC4HEZQXZBW2Fbqb93Kr2o=; b=fY8NeP/TYpbQhWw5/r9GXjAebEeYVz9W3IZSlstTkEyvmVaCHgji87QIChhf2y9n5C7Qj1iii/d1MxDPyZP1aH+twpBKUAecg55SINEqm2xwrGGuInvIVc8NID81aKRS6me9UWyDBK1hw9pEaO97uO07uKb/c3gjLlYenTXyqrWi3ebCr2F9cbcqxYausqOT71GU0B7S7GgeLOiEgORzMs+oZ8iJRFRgAyHOuFE5aDB0z03Kf+OOnI2GIIIUin6DujESaEBlBU59JRaxGkWzLaBUORW0yQN97RtS4lytXmBLE9FCFDp/6c6PQXf79VGd0V+uRMXXKTjuROzX95Hkfg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=D/guOp/DtD46a58qSgD//kC4HEZQXZBW2Fbqb93Kr2o=; b=k7QB+XBtKqC0iviadY0Uubjml8inAzif0DfwvhOb0rjaLvH6naexr6O6GdmeCUEMw9pQPytXTna0dFNFj9fHdcYta8Hg2/wxARb7DnwKFDGrZoSLGTO7RuADwMPCmeQeiQ5fCSXhUpSO0F8Zc1+bvlfyySDS3KkIRKe6DkOIdGg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by IA1PR12MB9063.namprd12.prod.outlook.com (2603:10b6:208:3a9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Mon, 15 Apr 2024 18:11:28 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::282f:29d3:cac1:cde3]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::282f:29d3:cac1:cde3%7]) with mapi id 15.20.7452.049; Mon, 15 Apr 2024 18:11:28 +0000 Message-ID: <2db62108-c655-4e00-8cf6-045a98f7d37e@amd.com> Date: Mon, 15 Apr 2024 19:11:24 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4] net/netvsc: fix number Tx queues > Rx queues To: Alan Elder , Long Li , Andrew Rybchenko Cc: "dev@dpdk.org" , stephen References: Content-Language: en-US From: Ferruh Yigit Autocrypt: addr=ferruh.yigit@amd.com; keydata= xsFNBGJDD3EBEAC/M7Tk/DfQSmP1K96vyzdhfSBzlCaGtcxNXorq4fALruqVsD3oi0yfyEz9 4YN8x7py0o9EL8ZdpOX0skc0AMCDAaw033uWhCn0GLMeGRKUbfOAPvL6ecSDvGD7CJIO9j0J eZUvasBgPdM/435PEr9DmC6Ggzdzt8IuG4PoLi5jpFSfcqxZFCCxLUDEo/w0nuguk2FTuYJg B2zEZ4JTBZrw7hIHiFh8D8hr6YA6a5uTofq1tr+l048lbtdFUl8TR0aIExVzE4Z8qKZlcE+9 RQaewjK5Al1jLE4sHdmd3GN+IvgDF3D/fLsi25SKJDeGSdeHkOmaX0qGeM4WKIfU6iARRCiQ N3AmBIxZ/A7UXBKLaOyZ+/i3sE6Wb53nrO4i8+0K2Qwyh6LjTeiJAIjYKN43ppxz3DaI+QwQ vI+uyHr4Gg0Da9EPPz/YyKauSeOZCfCB5gIfICO0j6x0SCl8uQ2nLpjxcZkf0gjcwUzP3h+S 3x6NfDji9YEij0zczW/dcSpGgZ6vsFpPrtnP9ZXy6J53yp0kJtOJoOlkEFFdU2yCZnCDseum CoudmGLZVvS0/DzHDJejq+3kK3FDGktZBOxZIIpal+nFqS7lVgOZc4+huVv3jyhzoAUOEyXA XK5j6o7g8STUY+z33QNnHpdLvecMwuzmvqy0jR54yAbZ64mB9QARAQABzSNGZXJydWggWWln aXQgPGZlcnJ1aC55aWdpdEBhbWQuY29tPsLBlwQTAQgAQQIbAwULCQgHAgYVCgkICwIEFgID AQIeAQIXgAIZARYhBEm7aYjps5XGsPHCElRTPtCKKm/6BQJkdyEEBQkE3meNAAoJEFRTPtCK Km/6UdcP/0/kEp49aIUhkRnQfmKmNVpcBEs4NqceNCWTQl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TF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DUZPR01CA0131.eurprd01.prod.exchangelabs.com (2603:10a6:10:4bc::16) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|IA1PR12MB9063:EE_ X-MS-Office365-Filtering-Correlation-Id: 6b5b2316-2cf5-4737-6ee4-08dc5d77787f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4Tm7JitMP+a8lmwM3MfNTEQ2ebfDojU6T5rU6+d8oKmBeiM3riFnp0dc58ukmOJxftebciQ16zYCO4alysHYx2ldCMBcQkSF9l3WVPsC1fz8gBbhHsneHUmcxpTQ+XEGgBfOPyRDZ1bf6TAectYpNcGNlcNQuKK0loKDCOPYn2+UrcRXSWnKOaKjgfhDWF1hzLiA/N5Be8cUXo6r1Ja+ObMgJrUl41KctfNNuRqdzz1DMuNcBUvnOxQ1BfN4PYK30xL07wXVvSLqXeXZn8Lax0lNfQn9VSBIDD/OMWp0OxCSip21wR/TAqFLuAl4km1+AdurQy1r+y+v2DwMOCvTsFrfs/dDm3y/aPUH3jLCl2TGFvWaUVYSo2gz3/sDfMkDoYK1w0mJzgsFIr/Tb5DZmQanjQRFqgWgAkZgkpWtjuc6NB5uLqk94omefJQ2rCgw/A3+W1NzJA5rXRSif0jblc8G0KQvD0mknWZGPJihlN3A97szwtE/lzonf6KjTrnZeJAt5BQrn6emwLQoPHFMEbov2aJYjaYbKkI7hKNa2FTlq3Uw8zWxMXKq9nBc5vCjPla+4DT3gR/XYkEs51qodhbFgQPjeU4QZ1wX15AchmdpY05G/uKwnsEi5WLdwFEr15lmXjZ+8hEoUQqiI5orStHNfMd2yO4rjoy+VIf0Yvw= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366007)(376005)(1800799015); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?NTU5eXRNNTN6cnd5bmtzQ1N6TDZXNUh6ci9UN0pud1RDbS9pTFllZnNKeXhO?= =?utf-8?B?UzJZRnVlaHpWQkFmeEtRbTZHcVVCdGd2bkJOU1kvUTRJOVBBRy9CT0N2a3ZT?= =?utf-8?B?c0VBT0UyTEJxbVZOZzIrOHlHWFYvNkdrdUZrVUR4MzUydjhpMUFJT0JwUWdw?= =?utf-8?B?YWtrc3I3c1BjOENrdWwrekJGQ2Zmb2VndFhETjBaenpQREtOQjVLMHl2STNl?= =?utf-8?B?UTRsU1BiaGtsM0VhWmZqMGNRY2JMMU96ZWZRSlNjc1R1MmpLT2lQcE4yTC9j?= =?utf-8?B?QnFIZVZlWEYrSTlGTk5EZ2VjM2RBOVoyNm9OTFlKL2Y0ZmY5MXkxZjdKcHZS?= =?utf-8?B?alBtQjFNQndpN1llNkRscUpJTlRPaVZlYlMwQ3l6ejN4Y1lBWmVlVzBFSitj?= =?utf-8?B?WHdaYi9BQW82aVQ2Z1lQV3Zsc2xjT00xbDArRWU3YjY2YzNoRWpTV1lhbFNa?= =?utf-8?B?NzQ1VkJZdHRMZ3VzSUsrTjhNMWhnU1FUS3N2SzZ3TjRacFRGZzNTdUl4Tk51?= =?utf-8?B?WXl4QkIxVWxIN2c4YXE4MDlaWFlCTm9mUkx0d3dpNmNpYTRiR0UvSU5qc0Vm?= =?utf-8?B?Vk1RaGRHaUJuL0lRbW0wNmpGMXNqQld4Q0FJd1dJYk5URnVqYXVZZ1N3Mkc0?= =?utf-8?B?VDE3NnlKMlI1aDMrcEFWRXg4bVk3TllsYWpNdnlYaTYzZTVIUjJ3T2RjWDZD?= =?utf-8?B?cThhN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QTlw?= =?utf-8?B?T0NHZkVIQTczZlFCaDJLT0ExU2JJUjNsekhjeGtlWVV2NlJYb29GcWZYQjVN?= =?utf-8?B?dE1Ca0RwTDN6K0txNVY4YjFzcHBQZVlzbWhmSGs2OWtKUUxVT3I0d1ZsVjlm?= =?utf-8?B?STNWeWpzdVExcGx3dFl6QVRUYUlwb0NQb2ZIWG5qQ3NjbDhwOUhJd0dtVW9J?= =?utf-8?B?NU9EZWI4V3NuZW1rMlBZTUZZMkFMdE1XRWVFNFp1aDUxWEM0NS8ranEwNzFp?= =?utf-8?B?R0MzVFYvNDBsWUE5MXlNY1NPYVZSSWR1MnFoMlJBRlE4eHMzMG95ekJNandK?= =?utf-8?B?T01NL2REQnBya2VVMEwzNjJxOVVjUFZWcW80cWZ6eEl1QmZpdEJFakZpc2dk?= =?utf-8?B?aW9MUERrb20wMnBHNnk1cEE5RHcrS3FPVXFIYWpNQTRFWE1oSk5ZZVVscElG?= =?utf-8?B?cW10MWNkS1VlL0dWblJDN0ljdzJKUnp4cHdtWUF4WnBhalp4Y0ttWS9QWXBO?= =?utf-8?Q?x58FFZespXfGuxJOI9JwR0vHK?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6b5b2316-2cf5-4737-6ee4-08dc5d77787f X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Apr 2024 18:11:28.5912 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aIqpAC924aLoJN53J5zhVrl87eSFlcElDaZ38s9VQxADU+5GAw1xFTa2Sj1qHmNK X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB9063 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 On 4/15/2024 3:40 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 >> = number Rx queues there was a segfault due to accessing beyond the end of the dev->data->rx_queues[] array. > > #0 rte_spinlock_trylock (sl = invalid address) at /include/rte_spinlock.h L63 > #1 hn_process_events at /drivers/net/netvsc/hn_rxtx.c L 1129 > #2 hn_xmit_pkts at /drivers/net/netvsc/hn_rxtx.c L1553 > > 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 <...> > @@ -552,10 +595,12 @@ static void hn_rxpkt(struct hn_rx_queue *rxq, struct hn_rx_bufinfo *rxb, > const struct hn_rxinfo *info) > { > struct hn_data *hv = rxq->hv; > - struct rte_mbuf *m; > + struct rte_mbuf *m = NULL; > bool use_extbuf = false; > > - m = rte_pktmbuf_alloc(rxq->mb_pool); > + if (likely(rxq->mb_pool != NULL)) > + m = rte_pktmbuf_alloc(rxq->mb_pool); > + > This introduced additional check in Rx path, not sure what is the performance impact. I can see Long already acked the v3, I just want to double check. If Tx queue number > Rx queue number is not a common usecase, perhaps it can be an option to forbid it instead of getting performance hit. Or it can be possible to have a dedicated Rx queue, like queue_id 0, for Tx completion events for Tx queue_id > Rx queue number, etc.. But Long if you prefer to continue with this patch, please ack it and I can continue with it.