Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp731658rdh; Wed, 14 Feb 2024 09:37:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCW/kc/jwq/zEUAC6LyWVYfHC9OxPe8M/8crdm9/8Be7pTUOv0lKATdu7x5hbGfuqjxjTPi8O01teLD5fI8rXcmfkgtzzTI0E0WMRdPjfQ== X-Google-Smtp-Source: AGHT+IFAJsU8zqmm0kOsz18V1APryuis4DS0p3FPI+cbZGd27vMe01TAiiol4Y9DQVqxYMS9RZ4e X-Received: by 2002:a17:903:22cf:b0:1db:596e:8b93 with SMTP id y15-20020a17090322cf00b001db596e8b93mr2951677plg.62.1707932256627; Wed, 14 Feb 2024 09:37:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707932256; cv=pass; d=google.com; s=arc-20160816; b=mYT2/MY3jf1BDhs+VT0SlC95PeoC+mbPigJSXNSlKIUstSIXVK5jk8l+WpPDxnk36b rtxpHlrLZwMB8USOlcLFwXCZwWY8xb23Dn5Oh3woW/YXF/kr52NbIdSD90LRYodNVWXv pRRn1kjmYe3gM2cEqRCD3uNSXumxktmjU494idg2AU2k4oAhsJYq7mJQZVeAfMvxdtgB 1Xw1RNP1PZWkVgK5yt/v4yLgEVgCAM1AssfAvqAfoGn3QF0BdP7vmiK+8E5De6PQpI1l r6/vUF3MZEAmU6a+3fsIMdDoWvis66niH05X1y8Urqm4iXeuxwieGrZ71tRAZdr4wzzJ jZQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date; bh=KlfPrkPJhB6RnllcrS7qovDvaF/KY1qwGjvc2MBg3WE=; fh=ZTNa1My/nsqKcYBnex6pHWiA5deI7RL65/K7tDQaXpo=; b=zXDY/6iyZjHiuOaVUxBxjeG9yEYBCVgs0H16Kdk3IxYPzQP3BgQgcCwPCygttPYAE8 q8umzx1rJxAKvD9OXF+204lq/7+fwfkDNgrbPrlhRhmbuW44klVKeq7hm/NEU+Nb+wuF 0WSGjLwehHdpBoPS66bwni7lXHZhoJKnzZXxvqBWI4U3+IQFE5RRb2nCtVZr8pVZyW8/ 5qmynD6d2v4XhHH9TJWJU8Dvi9k+ik8c7UkTLaVmj9s8eiDujd21BH7tQljkRuFWFWmA ZrIMfNSu00wMkQC2qRjdokRh7ZjBU3O7ejsdMMgN7T8kHM2jXcHsVGioGiR5a63vKybR RvCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-65684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65684-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCUqOQe3pvwv9u/GQ0kXRQ5306PP7MpIpybQz8wPTdOycKmeGUAXnYc6XMOGHPdTdHuiHjZg7JII+MN9robwjqUiMmCd2tYMJpGCYJfXHw== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id q8-20020a170902f78800b001d9a61d7bf4si1253594pln.194.2024.02.14.09.37.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 09:37:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65684-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; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-65684-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65684-linux.lists.archive=gmail.com@vger.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 6763028F6EC for ; Wed, 14 Feb 2024 17:32:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D810C84A58; Wed, 14 Feb 2024 17:31:23 +0000 (UTC) Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (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 7D86760DE5; Wed, 14 Feb 2024 17:31:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707931883; cv=none; b=qfFDAFiNMXxr2uYwNTXChj6JL8SbUUVUee3w96bWxEvmh82GGFtW8xV4bVdIzY2xOXglPwUZJz/PJO+ogzLcIiXXTomdyB9DpwX6lCPKhq8iXWhX+BzbR3MsEfk0aQf88z37nGz5y9Ir4K2p13r5ewsGRJEPleQavE39rslR5L8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707931883; c=relaxed/simple; bh=TI2ouCUQfA4fr9a9yre8mcJK8Eb5SODMsK3voKBojIc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hBbIfbs4N55BK53cJEwkl5sWw6fQKZtqYUQ9nwSoJY8s9trgEaJ6rbltPDWjkRdGsBWjnWSWRMxLpVVLULBmcmNYeYRMn63OGrs52eoA9VxRzRwHORBLSvzdSjPvT3mF1CeRUnONuTs0ff/PDPkexKan8kDCsXWnu83rpAAfGAo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-5116ec49081so6438801e87.2; Wed, 14 Feb 2024 09:31:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707931879; x=1708536679; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KlfPrkPJhB6RnllcrS7qovDvaF/KY1qwGjvc2MBg3WE=; b=XGdCXJjHWdXkBkqhrCodfH6GaXui4Y77TNqIpr0+G4ZMk0R65+3tEyDnEwVhfDCNCW Mb9BY2ELEynu5x3C2gHO9FNpyeywVogBFoy9lT7r3kCEiH5HKPS965w+nLERZsYZq15/ pJ1DTWjxMciMUR6Ck6sDRWvfWop+lM4FZ+labpi7+M/wHM4xSLrTEQNpCanTZ/vyEGWe cmQZcINMuCPXZT2l/X4RaXDUE/Gqd8pDDwLe0WhBFr0/qBRoeoVibgZrPRobiqGZUJ7S Gw2fpFQJeZpxB2jI7F+6j5xtFnggWDJSiMot8LSOe0NnMH9vdwCTSDZnvsDwGY9Mbwrj gUeg== X-Forwarded-Encrypted: i=1; AJvYcCVCcqb/jOcPScfdl21y8DAG/SUQFOvj6a0LmDiORYAJKg5JsL52xtiJE/vv0PnRCd7k6rBmvnteeNfYKoITagBgdAsQSMPkMpCtfzCyD8uZtOFLd7m4LfXInuTElTdipQtx1KvASK2vKFQDJCkNeqT281y59N0RPmHFAL0xABUmLmnl5uYK3sAC X-Gm-Message-State: AOJu0Yx01Xdnm3IZbAg1DkUtm1DKa52HWeO86Khh4XeE/qhPyzvOoTA5 5uvjFVMQ2VsHj9fLR7Fh8Jm48Z40MhRxEJiT01kdk+UUtLzGIjZL X-Received: by 2002:a05:6512:4dc:b0:511:5e2c:e63 with SMTP id w28-20020a05651204dc00b005115e2c0e63mr2269094lfq.59.1707931879222; Wed, 14 Feb 2024 09:31:19 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUS/aTw6rXkB58RduOcUE6wZ1CsNrUweG18iwnbpQhJSXLjs9OUeuTYWhRg9+f0Ny+68pSA1SGaoCEgzUoD+nqVuQVSDGUWkLw+oqvs5asDRoxKfB++I3+aIBZeUWBy9mAqTJz3ay0FuUjYHQ56GJxHkBaPVrlWREGyRwb5Yabp/KrK7Y+QwBvEWn0knEFVbpZ34EwW7kvW/dOziDAnPx+jOTkdfI8x0TdrDLy7COfxF9bRZu34pBtij56MYgZxxQ6optYj+gwaoSb/rlAusMG021RPnZZeoiKw9ef8BqA7GrWS4g5OfPfeytwD4AWRWKahBEflt7XBvh1yfXlNx3UzXu92P3jo8G4S0a1g5qXYWuepNAKBAor82j2nsArUgNQh38H5qHyVUqaNLnLW01dZaHS7THZru2L3kToooeAHNFoN68ObTtooTD965+pACWqh4I8sino7WSwrvDUKGwFCawjp7Z4hH7apxQzdMDKq5gc/oQiihXopWV5qWo44jIroFomgtb9AS1JJd8Xd8U+ZYRjzW+nbqvfbQIG2I1aURxe+Yeyc Received: from gmail.com (fwdproxy-lla-008.fbsv.net. [2a03:2880:30ff:8::face:b00c]) by smtp.gmail.com with ESMTPSA id d20-20020a1709064c5400b00a3c598d6b74sm2510250ejw.54.2024.02.14.09.31.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 09:31:18 -0800 (PST) Date: Wed, 14 Feb 2024 09:31:16 -0800 From: Breno Leitao To: Eric Dumazet Cc: Jakub Kicinski , davem@davemloft.net, pabeni@redhat.com, Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , Andrew Morton , weiwan@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, horms@kernel.org, Jonathan Corbet , Randy Dunlap , Bjorn Helgaas , Johannes Berg , Thomas =?iso-8859-1?Q?Wei=DFschuh?= , "open list:TRACING" Subject: Re: [PATCH net-next v3] net: dqs: add NIC stall detector based on BQL Message-ID: References: <20240202165315.2506384-1-leitao@debian.org> <20240213100457.6648a8e0@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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Feb 14, 2024 at 05:58:37PM +0100, Eric Dumazet wrote: > On Wed, Feb 14, 2024 at 5:49 PM Breno Leitao wrote: > > > > On Wed, Feb 14, 2024 at 04:41:36PM +0100, Eric Dumazet wrote: > > > On Wed, Feb 14, 2024 at 3:45 PM Breno Leitao wrote: > > > > > > > > On Tue, Feb 13, 2024 at 10:04:57AM -0800, Jakub Kicinski wrote: > > > > > On Tue, 13 Feb 2024 14:57:49 +0100 Eric Dumazet wrote: > > > > > > Please note that adding other sysfs entries is expensive for workloads > > > > > > creating/deleting netdev and netns often. > > > > > > > > > > > > I _think_ we should find a way for not creating > > > > > > /sys/class/net//queues/tx-{Q}/byte_queue_limits directory > > > > > > and files > > > > > > for non BQL enabled devices (like loopback !) > > > > > > > > > > We should try, see if anyone screams. We could use IFF_NO_QUEUE, and > > > > > NETIF_F_LLTX as a proxy for "device doesn't have a real queue so BQL > > > > > would be pointless"? Obviously better to annotate the drivers which > > > > > do have BQL support, but there's >50 of them on a quick count.. > > > > > > > > Let me make sure I understand the suggestion above. We want to disable > > > > BQL completely for devices that has dev->features & NETIF_F_LLTX or > > > > dev->priv_flags & IFF_NO_QUEUE, right? > > > > > > > > Maybe we can add a ->enabled field in struct dql, and set it according > > > > to the features above. Then we can created the sysfs and process the dql > > > > operations based on that field. This should avoid some unnecessary calls > > > > also, if we are not display sysfs. > > > > > > > > Here is a very simple PoC to represent what I had in mind. Am I in the > > > > right direction? > > > > > > No, this was really about sysfs entries (aka dql_group) > > > > > > Partial patch would be: > > > > That is simpler than what I imagined. Thanks! > > > > > > > for netdev_uses_bql(), would it be similar to what I proposed in the > > previous message? Let me copy it here. > > > > static bool netdev_uses_bql(struct net_device *dev) > > { > > if (dev->features & NETIF_F_LLTX || > > dev->priv_flags & IFF_NO_QUEUE) > > return false; > > > > return true; > > } > > I think this should be fine, yes. Awesome, thanks. I am planning to send this in separate from the "net: dqs: add NIC stall detector based on BQL" patch since there isn't really a dependency here.