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 E89F912FF7C; Thu, 7 Mar 2024 17:01:47 +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=1709830908; cv=none; b=o0gxhTx+Y1BWLGRrVxMd6iaoMTZ1NgoaT6OnSpIV2KXvoZTC6txKHcH1jm/leaRuGUMkUdk0LnpXrYKRW8tG90PWqZa5LkxbUUKzw6JhtA79/HDgeEvzKYJAvmwlT3asZMQm7VsUGuSdeD7afwoQw51tIr2FyAeydyGVsU1dM2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709830908; c=relaxed/simple; bh=7G4vPcy1mVijMS9YptzTs4Sy9VY1PByVCAyawRbldZo=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ttkpggNCg8EBOJC0M5fVV4tc32asURq42SX8MhOMW4ej1N/rLBfKUFc1omxgCsBc7WVFO0re9+td2aZcjVcmgzRkLSeenhH4r1xbBm3jebj+c5lmVtlGRf57mcusf4qW95YLojCjGcNp2P9cul9SE9yerw0i4v/bg22bZTm7VzE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V05fzXYX; 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="V05fzXYX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 94FAEC433F1; Thu, 7 Mar 2024 17:01:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709830907; bh=7G4vPcy1mVijMS9YptzTs4Sy9VY1PByVCAyawRbldZo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=V05fzXYXPZJtUZZkphCUMCbcmNTYxpe5srx+UWvP1T0xxlIrhwkrlFqnCihMnLfRw mW1+jEfwzbc4uzz672NEfHJ9q1yUTmrzpvdawpMZVsM8khCyt6WqHDK4tMQh/5/0Dz 3P17nayM+w019SlqInHJRrmrRbVc6NnC/xg3Cu8XeVHkJhSDGEb7noBhMAWOCJlpzf t6xm9DHf4fX+IkQPD4l7qkm8Uz64u/6vBJIozxfdHxS/sB1D50E1cRzyTyWLCEOlNB nx8x8+trQODCI8eFY2DxsbuF2pEfMFl1LJHkxlHrLyzplpH/sapqinQqOBnfXgc9NA 5n+MloVbNUYBg== Date: Thu, 7 Mar 2024 09:01:45 -0800 From: Jakub Kicinski To: Haiyang Zhang Cc: Shradha Gupta , Shradha Gupta , "linux-kernel@vger.kernel.org" , "linux-hyperv@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "netdev@vger.kernel.org" , Eric Dumazet , Paolo Abeni , Ajay Sharma , Leon Romanovsky , Thomas Gleixner , Sebastian Andrzej Siewior , KY Srinivasan , Wei Liu , Dexuan Cui , Long Li , Michael Kelley Subject: Re: [PATCH] net :mana : Add per-cpu stats for MANA device Message-ID: <20240307090145.2fc7aa2e@kernel.org> In-Reply-To: References: <1709823132-22411-1-git-send-email-shradhagupta@linux.microsoft.com> <20240307072923.6cc8a2ba@kernel.org> 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 Thu, 7 Mar 2024 15:49:15 +0000 Haiyang Zhang wrote: > > > Extend 'ethtool -S' output for mana devices to include per-CPU packet > > > stats > > > > But why? You already have per queue stats. > Yes. But the q to cpu binding is dynamic, we also want the per-CPU stat > to analyze the CPU usage by counting the packets and bytes on each CPU. Dynamic is a bit of an exaggeration, right? On a well-configured system each CPU should use a single queue assigned thru XPS. And for manual debug bpftrace should serve the purpose quite well. Please note that you can't use num_present_cpus() to size stats in ethtool -S , you have to use possible_cpus(), because the retrieval of the stats is done in a multi-syscall fashion and there are no explicit lengths in the API. So you must always report all possible stats, not just currently active :(