Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp873794lqt; Fri, 7 Jun 2024 00:46:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXaFMPHeeH46cfO5kRPXcSQHmL7IpkB4nsUEMDk86z8m076fS2UKKUiT8hpszKZS5B3QLRXa6w30Axruxrll0cM/82Yre17D0a8GJXkaw== X-Google-Smtp-Source: AGHT+IHHsjUEhllOTViVgYHOawc8GSOUDMX5L9qFwVgxveUSBTpiln9BVCTdNoRSTKhLPC/hW0zX X-Received: by 2002:a05:6a20:748c:b0:1b2:93bc:b7c6 with SMTP id adf61e73a8af0-1b2f9c6ea7cmr1919562637.43.1717746405987; Fri, 07 Jun 2024 00:46:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717746405; cv=pass; d=google.com; s=arc-20160816; b=eRTcZMn1/RpUm0wKZOiWLQtPnMhiUqWY9enHynkh27eBmfIPcHOVJF/rjutRziZC/S iyxfexHQ/MuO1u1b9NzJ178dJPetToCBRqv5ntl2uTh9V7SAWSZbLfJdNQukIzDtkMsq O4cTqm4xbGptUuAbBm71MqGJg35TWn7ERgmU9EEWJt8e/+lzPx2Qtad9nH+SeVhYgzT5 M+7PKnkDtOyrIDYviIEzDqWcWgqGaBQf4An+zXX8yL1u3i5BOttFPRGrbK1umwf2L81E aoRhhl+8dtIeYSCtrlBMkziWEj6Xoc3syWgoGLfiHciIr/omwdUoVDrqK55GLW5bApqN kGYA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=AS72jLuSxBJ0gHW3RNFPmyDKK389zQityL0CcC1+x9A=; fh=5P9pPZQ4bZ9+D9n8gSpUmlKXXyNhZVN5h5Se3kgr6bI=; b=Vd8Yr3zyxI2y6JCtudi5piXzkP7SUZuqa3e8wqD0ZB53P9FfrVtZjeyQLlaza2ypU7 7ZB7/Ks2ah7OcPOIigWn4tOethr7xPk5uUUrIDiLkopgg09ByHvdlAllm1HFfEyOvuav h5zTxfmIDILCcYSrhOh5PhC6P2J2Eln4DWsqCtGWABKm5Bez4nUBHL2wnaXHIhlPQ1PD kMQ3ayo9cBAcwNyjY0RKpgGYrJ9DzuCg7oP4/Zh5tvy4ELy68s0Chf9Vx7whc6E37UA5 +HFuuXPfh0t6DlyBmaTVSeQUKJ3ZpxLmsa8WqH+kQPzG1R0o8vGP182IS41lmC5S6W3q chWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RVmhyIzO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-205548-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205548-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-6e42acdf83esi249349a12.7.2024.06.07.00.46.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 00:46:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205548-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=RVmhyIzO; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-205548-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205548-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 27CABB213F5 for ; Fri, 7 Jun 2024 07:40:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31EC1155C83; Fri, 7 Jun 2024 07:40:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RVmhyIzO" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A655B154C17; Fri, 7 Jun 2024 07:40:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717746045; cv=none; b=lGoCZ+bUpgu8USR9Fo7Ot9a7frVmtWCG8bloMbWkWUKmHaPTOH09G3O33xxpnV1guLZcsUOG/PhlN2EOB2uGWqjCszAoD667eOD+KOmmp9qXJYy9ZhQf/kjrYpDQjK19K0Xa1H7GgP/9DyJLi3ugB1E8O0Q3n7FVfzJ8ErpX7SA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717746045; c=relaxed/simple; bh=Gm3qXYT7sPdPu6m611tvaJ8w9yI0dFVyI6RzRJF+Wls=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=K6KcsscjmEmb8qSqpjLhEDn0HRAKhF3OF2JMgQvFkMGnAkGYh4OJWKam8dHsnDzjc/Wdj+rAY/DDjtl7pe0Egsg/2Y1GQKbpH+NSi01D6iqJZS9BfAVafwqxnhsQn11V/aGzl6+Qx/0xjSIQjz1RMUnKLhxakKFmz+r2VHrN5DU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RVmhyIzO; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-52bbf73f334so178657e87.2; Fri, 07 Jun 2024 00:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1717746042; x=1718350842; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=AS72jLuSxBJ0gHW3RNFPmyDKK389zQityL0CcC1+x9A=; b=RVmhyIzOCdbRYr4jOZjChMeW8rFDoiET8bTmfs9uOne2caYcP2MTTINqLQu6UN91+H X+RVSQ5myYvW6COLrdtA0DlyxzQwEKPEJg3RgP2Dq4l8vOAwCQ9eFJwPGf4atcQeat7H UOjTqEgl/eo0glQ5o2rjDAdDd3/Kq4cME++QgM9HM8+VPLMxnFHQ6jENmP9a3vVKa6OC O9O/7mXZ7sZHGM0cVViykEc//vE7oiltFNShCGlYfYROiFVD9tSqOfKheUG3h984M4lN q0it7qRN6mNiM4B4UhG+9iq4u+C60hKYD6b78Q70Rkp0+HqHsfaTzD+g9LiMEZoHCjZC Qvlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717746042; x=1718350842; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=AS72jLuSxBJ0gHW3RNFPmyDKK389zQityL0CcC1+x9A=; b=LL4mR5x5sFvFZr1BM+XVqIKbxRlsel6/k/og2fvx6uJkzKWGSGjsSbcV+HRBhCF7cR gkZKA8yzaPzU35Va/KWfCjAlcJxWgC0aFhfR067+wTgx23L5B7Q2f9dcM/NUfE6IVnIA X2QMx2gsfRK8lCxIGzB4b945nwu+WbD/ii9q9gMxpzuR7dvidxmLv6lcSYgdU5owFhu9 zzNhwIa36XhGZPV4s1r9K1G9B4PTKNMXxyLCSR0Hnd2UvoEMU8HUSbIg6aQ6h3Z0RXY7 xipcu/KlyIt8i+6D09/3HYc4RqbrllsGILM4z6iAo8C3i9Ejqp5RDqPedCoNfM2IDYvC vXGQ== X-Forwarded-Encrypted: i=1; AJvYcCWQUd0Ob2/PTr4YepiLFrUhA9A+EjE7IQzD62XDuX6q0PXbCZWNp8jMmIgJ37KIus4i3Gwcwpbo+iJmoAG8ly0Dktu4uc5OiVnhljYEqvR3vcOPTfsfPxhtO0mMCgWOrNZsG3PnkHUiKdYNVUk/j4RRFenWkLr2+zFEW7IK34TvXg== X-Gm-Message-State: AOJu0YwiTiISmVc9bKFI63DQHOhqO1W0GBMJw/DSq0UkRPAukrxv1u0F uV5c17PF0ElsferYHF2pj/450qQ3zNZ6As9x6pRSIelxSqD5PcSF X-Received: by 2002:ac2:4a9c:0:b0:52b:844f:dd10 with SMTP id 2adb3069b0e04-52bb9f83a84mr1115177e87.40.1717746041445; Fri, 07 Jun 2024 00:40:41 -0700 (PDT) Received: from [172.27.33.107] ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4215811d13esm76100585e9.24.2024.06.07.00.40.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 07 Jun 2024 00:40:41 -0700 (PDT) Message-ID: <15007808-b5b1-441c-9a20-94195330b245@gmail.com> Date: Fri, 7 Jun 2024 10:40:38 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC net-next v4 2/2] net/mlx5e: Add per queue netdev-genl stats To: Jakub Kicinski , Joe Damato Cc: Tariq Toukan , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, nalramli@fastly.com, Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Paolo Abeni , Richard Cochran , "open list:MELLANOX MLX5 core VPI driver" , Tariq Toukan References: <20240604004629.299699-1-jdamato@fastly.com> <20240604004629.299699-3-jdamato@fastly.com> <11b9c844-a56e-427f-aab3-3e223d41b165@gmail.com> <20240606171942.4226a854@kernel.org> Content-Language: en-US From: Tariq Toukan In-Reply-To: <20240606171942.4226a854@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 07/06/2024 3:19, Jakub Kicinski wrote: > On Thu, 6 Jun 2024 14:54:40 -0700 Joe Damato wrote: >>>> Compare the values in /proc/net/dev match the output of cli for the same >>>> device, even while the device is down. >>>> >>>> Note that while the device is down, per queue stats output nothing >>>> (because the device is down there are no queues): >>> >>> This part is not true anymore. >> >> It is true with this patch applied and running the command below. >> Maybe I should have been more explicit that using cli.py outputs [] >> when scope = queue, which could be an internal cli.py thing, but >> this is definitely true with this patch. >> >> Did you test it and get different results? > > To avoid drivers having their own interpretations what "closed" means, > core hides all queues in closed state: > > https://elixir.bootlin.com/linux/v6.10-rc1/source/net/core/netdev-genl.c#L582 > Oh, so the kernel doesn't even call the driver's mlx5e_get_queue_stats_rx/tx callbacks if interface is down. Although our driver can easily satisfy the query and provide the stats. I think the kernel here makes some design assumption about the stats, and enforces it on all vendor drivers. I don't think it's a matter of "closed channel" interpretation, it's more about persistent stats. IMO the kernel should be generic enough to let both designs (persistent and non-persistent stats) integrate naturally with this new queue netdev-genl stats feature. >>> PTP RQ index is naively assigned to zero: >>> rq->ix = MLX5E_PTP_CHANNEL_IX; >>> >>> but this isn't to be used as the stats index. >>> Today, the PTP-RQ has no matcing rxq in the kernel level. >>> i.e. turning PTP-RQ on won't add a kernel-level RXQ to the >>> real_num_rx_queues. >>> Maybe we better do. >>> If not, and the current state is kept, the best we can do is let the PTP-RQ >>> naively contribute its queue-stat to channel 0. >> >> OK, it sounds like the easiest thing to do is just count PTP as >> channel 0, so if i == 0, I'll in the PTP stats. >> >> But please see below regarding testing whether or not PTP is >> actually enabled or not. > > If we can I think we should avoid making queue 0 too special. > If someone configures steering and only expects certain packets on > queue 0 - getting PTP counted there will be a surprise. > I vote to always count it towards base. +1, let's count PTP RX in the base, especially that it has no matching kernel-level rxq. Another option is to add one more kernel rxq for it (i.e. set real_num_rx_queues to num_channels + 1). But, that would be a bigger change, we can keep it for a followup discussion.