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 AD89045AA4; Fri, 4 Oct 2024 00:55:19 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9485440268; Fri, 4 Oct 2024 00:55:19 +0200 (CEST) Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) by mails.dpdk.org (Postfix) with ESMTP id 800644021F for ; Fri, 4 Oct 2024 00:55:17 +0200 (CEST) Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-2e053f42932so1148303a91.0 for ; Thu, 03 Oct 2024 15:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1727996116; x=1728600916; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=DZE7UZRHmoYm3H9dYRiXaKkauDVQsaNPjd2SUhzgxXY=; b=1/Te5+BmwxlVAQAyAtY8MjS/Twa1PLpK7tWE4ZXFgCCDD3YwSFcNIBH/si1doVKw5D vuGSi0xFI5SyazoDJxlDVoN2wjKoHeIW71ap2HyxV4IMsQbbE+UKwRMIO5t8jgXuhNIy iUv/rB1mI1SOudt2b5xjbJ6ckV0fkQ9NXbQW2ZfNIYA8ubIqTHEUZT4EhBzXhYVKOn47 DgSayhp+DnVEkLpEpripW/CzvKqrc8dqz/kT/0Nl1oMRMioaQJCsQCG6Rzn6m7Zjh05E 1Rh4Pe5Scyu6ysEuJL64RflgXS1ovj66g7LweTTlieNd3gGKwCeFgBUX3khZcA/QUXt7 d17g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727996116; x=1728600916; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DZE7UZRHmoYm3H9dYRiXaKkauDVQsaNPjd2SUhzgxXY=; b=M1DlsGuKNfyk0k23ydaXVUrU0c7IBcOf63K3gtVBekq4sF1KAc7nAyM9DWozV5mhmI zAQ/DDvNvJs9iuAZj8Y4HmN3E6/OOyvniDrE2sFPUVK9UodohVE2i1lRnj/d3G+mp+j9 vCe9RhvTUrPw04CilbR8apDQNs9PKjienMS8oiCsj5s+kliqfR8Ba4fSDDjE78LY7/KB ojApNFxZXmOaovsvFXese1vtTI5wEmoa5QC+1dftCoWkUOaU21mNSVtFtwV0u9oIbZoJ WnMSx27HiZg2yDNPjH22VrvZ8DnmW5q9j/ny14gQTlIiIdBSnDvq9taIcBR3dMdhKu5L zHMA== X-Forwarded-Encrypted: i=1; AJvYcCUrRFy5zWF97FDZ101SiE+n+viz3zVMZcIMZZ68a0+KOjDTs/YRvsYruzi9DTPgTqicpDM=@dpdk.org X-Gm-Message-State: AOJu0YwPK24hPmMoctBCK8btJTs/7q34nFtS8GnCpc3YW/si4WZ30r+I 3LqYb7jPB+2U4IxENw6rv7qJAQh5lK+gdlUW6E/q8Kdh7Fd/i1YdJwtCK4vlvNs= X-Google-Smtp-Source: AGHT+IFFwKWehAlw0ca6GYBb5uQG7gNvHUdE3714Ay+G22NK5QGohKGmDwb9a2aNS6Yw7eb8fVl3Gg== X-Received: by 2002:a17:90a:a00b:b0:2d8:27c3:87d7 with SMTP id 98e67ed59e1d1-2e1e6212fe7mr787413a91.8.1727996116556; Thu, 03 Oct 2024 15:55:16 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e1e85d9ac9sm52221a91.28.2024.10.03.15.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2024 15:55:16 -0700 (PDT) Date: Thu, 3 Oct 2024 15:55:14 -0700 From: Stephen Hemminger To: Alan Elder Cc: Long Li , Ferruh Yigit , Andrew Rybchenko , "dev@dpdk.org" Subject: Re: [PATCH v4] net/netvsc: fix number Tx queues > Rx queues Message-ID: <20241003155514.195b3a2b@hermes.local> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Mon, 15 Apr 2024 14:40:44 +0000 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 > --- > v4: > * Include segfault core stack in commit message > > v3: > * Handle case of Rx queue creation failure in hn_dev_tx_queue_setup. > * Re-use rx queue if it has already been allocated. > * Don't allocate an mbuf if pool is NULL. This avoids segfault if RSS > configuration is incorrect. > > v2: > * Remove function declaration for static non-member function > This version of the patch is garbled in patchwork which means the CI test never ran because patch would not apply. You need cleanup and resubmit it.