From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 9E775126F37 for ; Wed, 7 Feb 2024 20:21:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707337290; cv=none; b=W9zzbtyC9jXB978M4XP5Z8cqc2nJFEfeyRqI3vPEmtkB7SsT2MVAXtjszBsiEQ5POawghy5mSwX9bLgsqwuPqMNS6b1VSNKjc62a5MOBVfe+zjrr5qf1fmlMNmaIJYYraw7+6D6eCNLIG8LLGAzvZQ9k20788okkYIhNJ6uM4bU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707337290; c=relaxed/simple; bh=C1+aE5zy9B03xrsMBL8HKVA2xk9DSY7YIYN3YM8Nm6Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: In-Reply-To:Content-Type:Content-Disposition; b=fGz0o0QMDrYFIxXvPMEpavos5YeEWxGo8ttUENtGFwyPxFvMzTWFgOV0mq5awWOKvOC6b3Z4a0B81ox/XE6DVnrJHjjAgRX80VHL1U1oFWvmmyS47x4CfTv24UWcNUgss9XGrC6oIHzExP08O7R6nC4PUk9u3bSrQkyxllEJlaw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=VBoy2rn8; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="VBoy2rn8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1707337287; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=3H8QJtDMIo3MZizJfYWH6nlrtUEhOFebosERzPFJAFw=; b=VBoy2rn8sOQ5sXJRZTO5VPE3epRo9L7XfU+jvMJ6p8gM9PTs8EJ3nJ8fHxVLYWjgye5Iy5 X9GY/Dcv7CaLXDEf7w77VQ/iZuZdfqCpiLCm56jkTyx08cG16Sp8paHJN1GoAAB94d5ucv MM2PrezLyevD6cRLy1k+dMF9+ctCkVM= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-355-t2BXNpFWNhis5QXQz0gnOQ-1; Wed, 07 Feb 2024 15:21:26 -0500 X-MC-Unique: t2BXNpFWNhis5QXQz0gnOQ-1 Received: by mail-wr1-f72.google.com with SMTP id ffacd0b85a97d-33b0991ccb6so550691f8f.1 for ; Wed, 07 Feb 2024 12:21:25 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707337285; x=1707942085; 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=3H8QJtDMIo3MZizJfYWH6nlrtUEhOFebosERzPFJAFw=; b=nlnqLf1HdXBGJRXxk/6+Hc670D+N+TWsdJxB/cp3DGaoUtOddi+4TE0hDY2+3sDHxA mejQN37qRg4vQQP6cE9rTgV+XmD2WO1eLGaerz5EgQCChd+iT3cepGkX+1i1w8Hwut6j /qMbvLln/701YwBceJcKTJQZ66B2+xeYHX88qz10xNZnCf3enMUsLT+ct/eA/cPL+9gm cO+dWnKrKNZ6ax/o2fpHC5kw5NoAuZTKLNs/4UQcy51OmP5/RKRtr/GBICXs4wa7FEgl Snj4F0gPwqGYcjGbKYWrFug/4+LAffmq/Fvh4byMXX4FFaDhA1nQPqqmvEtTc1kWYAyS Om1g== X-Forwarded-Encrypted: i=1; AJvYcCVw6UrbVi/MjJ/coDujUPILySq2bnqH7zTkNJ6HaVoIjjm4YTG/wka9ef9ueV2a8DTROqXNy1LKYasFn4WeYMOkN3S3yYY+v75JoSjmGQk= X-Gm-Message-State: AOJu0YzfvsSTLxiXPgWGIf2YXZ4tioErKKEgm8UZKbHDQnO0c7ATkhB3 is2YLUU8NOU50jFawzZqpiAXR/fi70a1Hd+kPlseOwNN+wMGIv10aWNwiIMK/AEiHx3mcZH2dRE UWNKZYLMTji3EZsbpY7bC6IvhbIaMORZKuhDnNaT/7fjpij7v5wsgfAjxl+WlgSFO X-Received: by 2002:a05:600c:314d:b0:40e:60c3:c327 with SMTP id h13-20020a05600c314d00b0040e60c3c327mr5256609wmo.1.1707337284835; Wed, 07 Feb 2024 12:21:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IGBUnIvTGUQgEyU72QEFyFSVayytjrrRYGNqaslbqM5E2+LfRIRSySNBFM2rv2F01kmr+IzxA== X-Received: by 2002:a05:600c:314d:b0:40e:60c3:c327 with SMTP id h13-20020a05600c314d00b0040e60c3c327mr5256598wmo.1.1707337284498; Wed, 07 Feb 2024 12:21:24 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWpYYXxRiHzcANqsGuklB5kOjaBTsE/682jdZgjrs0S4+ysoDRer5JKr7rWC5Ibks+LvVBFr+MazWYA+1HVOYiwd6EWxB7mS3tVMvAXHWBAJ+6gTZE24tAz7SXDw3+4IS73a3Cj6hfHrHEWWqJD0Jda6VufAFxs7c9xS4vBbGY4AVs3u4OdoTPvEZSi1giVdcrqZTQ35ILwwN6iNmeq2ZfRjbEavQogfkr3u51RIwY+Mjq7amPKjQd+gDi6RPwD+feJU8amby5mcwyi65uy2r/Zrr58MFZ2fr76ZyyhfXufd69D/68/glvMZMhC9NKRzoHClX8JXohqL7FwagOOcjc= Received: from redhat.com ([2a02:14f:173:89f9:ff9e:3e5c:f749:4dfb]) by smtp.gmail.com with ESMTPSA id l8-20020a05600c4f0800b0040e4733aecbsm3114699wmq.15.2024.02.07.12.21.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 Feb 2024 12:21:23 -0800 (PST) Date: Wed, 7 Feb 2024 15:21:19 -0500 From: "Michael S. Tsirkin" To: Jason Wang Cc: Jakub Kicinski , Jason Xing , Daniel Jurgens , "netdev@vger.kernel.org" , "xuanzhuo@linux.alibaba.com" , "virtualization@lists.linux.dev" , "davem@davemloft.net" , "edumazet@google.com" , "abeni@redhat.com" , Parav Pandit Subject: Re: [PATCH net-next] virtio_net: Add TX stop and wake counters Message-ID: <20240207151940-mutt-send-email-mst@kernel.org> References: <20240130105246-mutt-send-email-mst@kernel.org> <20240201202106.25d6dc93@kernel.org> <20240202080126.72598eef@kernel.org> <20240204070920-mutt-send-email-mst@kernel.org> Precedence: bulk X-Mailing-List: virtualization@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Feb 05, 2024 at 09:45:38AM +0800, Jason Wang wrote: > On Sun, Feb 4, 2024 at 8:39 PM Michael S. Tsirkin wrote: > > > > On Sun, Feb 04, 2024 at 09:20:18AM +0800, Jason Wang wrote: > > > On Sat, Feb 3, 2024 at 12:01 AM Jakub Kicinski wrote: > > > > > > > > On Fri, 2 Feb 2024 14:52:59 +0800 Jason Xing wrote: > > > > > > Can you say more? I'm curious what's your use case. > > > > > > > > > > I'm not working at Nvidia, so my point of view may differ from theirs. > > > > > From what I can tell is that those two counters help me narrow down > > > > > the range if I have to diagnose/debug some issues. > > > > > > > > right, i'm asking to collect useful debugging tricks, nothing against > > > > the patch itself :) > > > > > > > > > 1) I sometimes notice that if some irq is held too long (say, one > > > > > simple case: output of printk printed to the console), those two > > > > > counters can reflect the issue. > > > > > 2) Similarly in virtio net, recently I traced such counters the > > > > > current kernel does not have and it turned out that one of the output > > > > > queues in the backend behaves badly. > > > > > ... > > > > > > > > > > Stop/wake queue counters may not show directly the root cause of the > > > > > issue, but help us 'guess' to some extent. > > > > > > > > I'm surprised you say you can detect stall-related issues with this. > > > > I guess virtio doesn't have BQL support, which makes it special. > > > > > > Yes, virtio-net has a legacy orphan mode, this is something that needs > > > to be dropped in the future. This would make BQL much more easier to > > > be implemented. > > > > > > It's not that we can't implement BQL, > > Well, I don't say we can't, I say it's not easy as we need to deal > with the switching between two modes[1]. If we just have one mode like > TX interrupt, we don't need to care about that. > > > it's that it does not seem to > > be benefitial - has been discussed many times. > > Virtio doesn't differ from other NIC too much, for example gve supports bql. > > 1) There's no numbers in [1] > 2) We only benchmark vhost-net but not others, for example, vhost-user > and hardware implementations > 3) We don't have interrupt coalescing in 2018 but now we have with DIM Only works well with hardware virtio cards though. > Thanks > > [1] https://lore.kernel.org/netdev/20181205225323.12555-1-mst@redhat.com/ > So fundamentally, someone needs to show benefit and no serious regressions to add BQL at this point. I doubt it's easily practical. Hacks like wireless does to boost buffer sizes might be necessary. > > > > > > Normal HW drivers with BQL almost never stop the queue by themselves. > > > > I mean - if they do, and BQL is active, then the system is probably > > > > misconfigured (queue is too short). This is what we use at Meta to > > > > detect stalls in drivers with BQL: > > > > > > > > https://lore.kernel.org/all/20240131102150.728960-3-leitao@debian.org/ > > > > > > > > Daniel, I think this may be a good enough excuse to add per-queue stats > > > > to the netdev genl family, if you're up for that. LMK if you want more > > > > info, otherwise I guess ethtool -S is fine for now. > > > > > > > > > > Thanks > >