From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 639748831 for ; Wed, 1 May 2024 01:59:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714528793; cv=none; b=i/1pQikgGm2tsZbJR0B5XEgLIZyJhoPC9NtJiyMyTYIInUQumFi76u4iWwsRx7GIwAvEAonVYRX1uYdPCYlfpFUa05AmB39pJTB4QAJprSoYveDxXh/ygNCioeAWbdUakX6JT4bYe48CiFiyO7qY51Esj030HvInpWJ3f4Fa8fo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714528793; c=relaxed/simple; bh=rp5OH52ha8HSN6lyCYj9IlqquxeOKpsSry+qWfo8eW8=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=nEL81dcWx+eun0e7DfexlXtwsa2/D8K+HMBcam2kMhZCW7Yr5ifkccz3yfqOz2j+JHhJUoHtaGq4yHVzmV7lM7rxCAc51zVArk3zjqfN2zEK1ws/R4Cwjp7DH6BddE3zQ0h0pWZ0VS3fA+JgZTvrsevi6GiQptM+Xtv9vCF4jR8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=GKr0fJDz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="GKr0fJDz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 622BEC2BBFC; Wed, 1 May 2024 01:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714528792; bh=rp5OH52ha8HSN6lyCYj9IlqquxeOKpsSry+qWfo8eW8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GKr0fJDzGXmdTq5D3WNPk/cuCPtikx6bf+wLB6GOHKxIkAqLYEzkVAb1f1vr2eZ8Q 5840IGJnTzpQvVbQEKuAiw8nwpy3DZc1RsJcNxpoPwHXe28lbuY1qo2Mohq62JWhq0 hccw65xnYrJBgdO92wXZq0veiOafzAFZdHO8r0DdE27wGCjQdW5BOGyQUJO5kRnYK6 bSDrRNBceo+eTqMAEDNjXjJl4hmMx9fHOgWqz773ZUXuvnYe5SPRBcZWYW+ulVO4ks MaLZRcOFGycE1GdT1n+M1+nbCVGrFmxCk0rcxdAciODEP45lKmQFBn6JP+cy1WQAfP AKjJPIvTD+lwg== Date: Tue, 30 Apr 2024 18:59:51 -0700 From: Jakub Kicinski To: Jiawen Wu Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, rmk+kernel@armlinux.org.uk, andrew@lunn.ch, netdev@vger.kernel.org, mengyuanlou@net-swift.com, duanqiangwen@net-swift.com Subject: Re: [PATCH net v2 1/4] net: wangxun: fix the incorrect display of queue number in statistics Message-ID: <20240430185951.5005ff96@kernel.org> In-Reply-To: <20240429102519.25096-2-jiawenwu@trustnetic.com> References: <20240429102519.25096-1-jiawenwu@trustnetic.com> <20240429102519.25096-2-jiawenwu@trustnetic.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 29 Apr 2024 18:25:16 +0800 Jiawen Wu wrote: > When using ethtool -S to print hardware statistics, the number of > Rx/Tx queues printed is greater than the number of queues actually > used. The ethtool API fetches the number of stats and the values in an unsafe, non-atomic way. If someone increases the number of queues while someone else is fetching the stats the memory of the latter process will get corrupted. The code is correct as is.