Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp128678lqd; Tue, 23 Apr 2024 17:57:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV7eeLn1owkaCou8zvv/xuJnzad2jrLZVVWcyyAU6YTeCMEfhVKS8Z0psNDOK3UzUK+Yt9zr+2QVsVKqkp9cBR0hgrxiTMHmUh1m1kOQw== X-Google-Smtp-Source: AGHT+IFYaia9QfDKscgI4rmjOCtfQ65aOkJhSEh7V9whuces/XYiXVIt7wAr+fBVcO9AMxo9G09e X-Received: by 2002:a05:6000:12c3:b0:346:7f2e:6d19 with SMTP id l3-20020a05600012c300b003467f2e6d19mr486509wrx.39.1713920252304; Tue, 23 Apr 2024 17:57:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713920252; cv=pass; d=google.com; s=arc-20160816; b=w5IJrM+eeRX5usWMZDmiv4WEIxjTKMoLT7cu1ezbASYMYGBwCZ7asxv4BvHrk61dxM nJQFX7rGDYPRe0WIo/s/yeOnZsaPpApYuaoXdUO7RnJxbI1HnyH+fVdTf85pxHGtUmff z4X511WUrdJUMD83pPVontdUNNX76SCm9yzXBrbcFo1gkmaJ47F8TIewwfS2TpVJsv35 4gT8YyfwuS7nofZ+nNoDHP34U+gwkdR938H8HuTNuFfhO02JFt7FUitvVJIcjg9U2nFq W1bvjfIVcpd6WQPjWD9/djgTh1p89UCHBZuIqg0MXm035thEc5EzRa3XxC5GRDFhxJ75 k9xw== 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=p4AQzKUY8uzyy/arNEUlF+vp6B1iaFojwMNt73CFIwk=; fh=c1dFFm7P5DnGlxoIcqtQ1zIpAKQkg3ZQZ7vjqDdk7sg=; b=aPjcMNm9tQfTJ7+0f0uoq0F+z43k1jLS3jZpA3T/gxHmKzHbJ+c2eXE0Ex/VIKEVof PdoKaSYDM+BpaxtX8thzdhqfoIsB9VarzpqQgMrXJxQrUmWk9/UnqjYUPv3BDQnZk1qX TKfv8qp4SAzKYCIbN6jSy3JnOSi7GypsmLRiHjLpu7yyXOg9gBJGR6WlP+x56y9/Vncl 5/zIyX/0ujTlc2y3ag5LaFjqaGjdrMyARqHtyWdU1/sr6B3SKOmZnCDxjEBppvkvkk3V zXi4mVJapEIZ1wqkNTc//xxKq0bvXSWXKHZc6EwwnsFE5wGW4IStw3L2543i0GXdzR8c 3QGg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f3wRJQCj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-156066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156066-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t27-20020a170906269b00b00a51a48614b4si7681754ejc.426.2024.04.23.17.57.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 17:57:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-156066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f3wRJQCj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-156066-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-156066-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 am.mirrors.kernel.org (Postfix) with ESMTPS id D62241F236CD for ; Wed, 24 Apr 2024 00:57:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E7975258; Wed, 24 Apr 2024 00:57:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="f3wRJQCj" 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 57BF363D0; Wed, 24 Apr 2024 00:57:20 +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=1713920240; cv=none; b=uR/Vw/i1dUUBO1nRukaOcCBGxFjQVX4Hpkd1Bttb0iuz00cXf3ySQ+Kx916/Z18iOXuUIwhHep4zQXM4lDYlBrLIRxE3q6+Fc5WNatIcRmwZkiXsyLVNRtB8ENvGXktFycFaa93uPc+DanP4T4MjNc9CXkzn18vrYqfz8HDoKvk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713920240; c=relaxed/simple; bh=dU/mSRR2DatpobRTvXfLbp4WxXu8S7T6ZNvWUPBTg5M=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oYZv6BrySxepzzUSlxwLaF3OCxKD4PTT+cNHuF8UztfWJKJK4icKyXp7UnFxVsr/bb/IhR/7o7Oos8G4nrT7f0zgXE5OwP10aPZc9EtfCdyyyp7vFk18HTS9q1dd5MY0T5tf6sodcIu02LwPQfTXUSg/031cfhU9hcC82JBJrkU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=f3wRJQCj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 89F2CC116B1; Wed, 24 Apr 2024 00:57:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713920239; bh=dU/mSRR2DatpobRTvXfLbp4WxXu8S7T6ZNvWUPBTg5M=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=f3wRJQCjsRcBM8RFohLzlN9w61SLc4vWIOw0/yk7WdOAeo720eTDQXlMTyAnVX1b5 wUDbNfJ2Z8ezexX7Id6xCXQa4ymc9yiOzlvZBJerdUk7HooTxgIq7TMvZtI78Ppvxl EN/mhrVeSqu1xahRWiMcMVIKC/WtONrkXEFOiLhvsljLCZ49t4fNIcSaqpDw4DMvup 8T9mN9bo+MbWwcm7lqsVtq1FzRsq+MZzdnyEzzrBFujSFBzIFbcs7IwiiNN1dBsryl QgjhvJRJx7GMSi6jGJQd3lvQREE8vsskCvLfCmgqjTHUMILXY98IYfxz4IB4W/5Y8B ValZweNVWasrw== Date: Tue, 23 Apr 2024 17:57:18 -0700 From: Jakub Kicinski To: Joe Damato Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, tariqt@nvidia.com, saeedm@nvidia.com, mkarsten@uwaterloo.ca, gal@nvidia.com, nalramli@fastly.com, "David S. Miller" , Eric Dumazet , Paolo Abeni , "open list:MELLANOX MLX4 core VPI driver" Subject: Re: [PATCH net-next 3/3] net/mlx4: support per-queue statistics via netlink Message-ID: <20240423175718.4ad4dc5a@kernel.org> In-Reply-To: References: <20240423194931.97013-1-jdamato@fastly.com> <20240423194931.97013-4-jdamato@fastly.com> 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=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, 23 Apr 2024 12:42:13 -1000 Joe Damato wrote: > I realized in this case, I'll need to set the fields initialized to 0xff > above to 0 before doing the increments below. I don't know mlx4 very well, but glancing at the code - are you sure we need to loop over the queues is the "base" callbacks? The base callbacks are for getting "historical" data, i.e. info which was associated with queues which are no longer present. You seem to sweep all queues, so I'd have expected "base" to just set the values=20 to 0. And the real values to come from the per-queue callbacks. The init to 0xff looks quite sus. Also what does this: > if (!priv->port_up || mlx4_is_master(priv->mdev->dev)) do? =F0=9F=A4=94=EF=B8=8F what's a "master" in this context? > Sorry about that; just realized that now and will fix that in the v2 (alo= ng > with any other feedback I get), probably something: >=20 > if (priv->rx_ring_num) { > rx->packets =3D 0; > rx->bytes =3D 0; > rx->alloc_fail =3D 0; > } >=20 > Here for the RX side and see below for the TX side. FWIW I added a simple test for making sure queue stats match interface stats, it's tools/testing/selftests/drivers/net/stats.py You have to export NETIF=3D$name to make it run on a real interface. To copy the tests to a remote machine I do: make -C tools/testing/selftests/ TARGETS=3D"net drivers/net drivers/net/hw"= install INSTALL_PATH=3D/tmp/ksft-net-drv rsync -ra --delete /tmp/ksft-net-drv root@${machine}:/root/ HTH