Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp15262lqc; Thu, 7 Mar 2024 09:01:59 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVAihX5GZrKpAoAwNV6neOwNhbCKUOzhni2K8aaWpy+f0Xt/ecH19OP7mNaLjmjsY1/dZZ2hUdSqro8JpjOj4gp1YkKrjoVl3oyLTQTuQ== X-Google-Smtp-Source: AGHT+IEsgNcMBIbOTS5zXqWEDXSYpy6/wI5DzSnXedy2dXOBr2GlELOl17raxb70tdnsToJmI+Hp X-Received: by 2002:a05:6a20:c88a:b0:1a0:e463:fcc0 with SMTP id hb10-20020a056a20c88a00b001a0e463fcc0mr2893621pzb.17.1709830919217; Thu, 07 Mar 2024 09:01:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709830919; cv=pass; d=google.com; s=arc-20160816; b=bI8vj8LbxJhhBaepP3SOazpXdCtuFJ4gaQoaKmIqOTdrSqh9ORdzmrVgzBhhjkNIvO aLdtntk9vi4GcHJs7fK3SVVokK8BdkLeaCID9yF1OgTcYOd1n4HDzybSVsbim3N4H8kA hViFABbcL1LahB4ukjPwGOiBOfjdBwOyP7jaTRNeEyKV+yzoCdhExokuVAMHEn5KTt85 jaJPt77h8YDoz7KKa9KG56iBomxfw7fuaqGN18PrKq52DpaFXTvKUoI4X17qcHOQxnNU vy3ILfPj8QJPdFlY0euUNPOtTHsFW0KFBTDjMp4T6lHhQpaOihwIYivhjrhwXjxLM5IH G7Sw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=MU76kTNbDt7IWQhS91WHtrFrZTrTYv+IrRVgvY7HTf4=; fh=oSncddIQe6sxrLRPuHckyNLVbA2HlUldVJLGGVfG3Z8=; b=wyfUpTnVT5/OutgxLR5mVg3oXgCO49YaHUkEN78KTr4xfqdHHo4G60LAGeebNUqycB 0HlDYtv7Xqjhz0Q5rRo5xNrD4e/9pc++tWLXtwoUghpYgU2b8x5VWELIRA3TQ22iGAiY t4qRl+mqyP1YVhXT9aCNJR1JYzpiUbb1TnBWDP3E4QsrhmHMj6YEhPIeyCY2CSjAWcIk vJYax3mNCULhFH8kng0RS8ivk7Picb6JdP8pGBRfsHkkFAR32fqJ/CTeQnIectaEBY5S H22O7DQYnAFWG1iPBbf/mUX11mT+ISoQNmlVQyw/RD7fKJs9iYyKxorA4PeacW7VqKwA kkCg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V05fzXYX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-95903-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h26-20020a63575a000000b005df42c5313bsi14423394pgm.16.2024.03.07.09.01.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 09:01:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-95903-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V05fzXYX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-95903-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-95903-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D0DA2284C24 for ; Thu, 7 Mar 2024 17:01:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED47312FF73; Thu, 7 Mar 2024 17:01:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V05fzXYX" 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 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: linux-kernel@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 :(