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.133.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 BEF1D28AAEE for ; Wed, 24 Sep 2025 08:55:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758704106; cv=none; b=J8EeYWsJgMMGB0b91AnOuhycVc4GBVrUcxRs9EP4S/UL1d5m4LHYPJm/3WsRw+hhi7BKNU49S0pXw05k4pH/WHgoHKLUycP9EyDUeu+O7gGYaVakELHlYwpcsbFIfuhGOtsobwH70xHP/yNZtKEw6gDgQa2NQjRBNGwCryS+MTo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758704106; c=relaxed/simple; bh=yC4F9BxKMD2tLjzPZNMkOfB70p02zY5u5wUAbNq4KtE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=HF8fYlrWbekzMgtLimntfR0gEaXWA6leEvJVP/QcNwCvKp4P/zlRcT3ccQ0aTDCaXH/ydn4a8t6DG0eNWnPrwtVxgQyafSweG6+PiLL1Ag2aLrDQe9lkebMF7mkuQXb2QAamADpTCv5xtH1Q392u7cXq/rvfSYJ0oZ9hByZuk7c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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=LKPQJMFl; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine 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="LKPQJMFl" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1758704103; 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=oeF4iLafWqiyYhAJj/z0HEWgGu1flHRP9T+bwNm7VOY=; b=LKPQJMFlPtlepooEfDAZhUqpUFS1VJAA3mhfz0yE9QIMcmitxyvLd3qKqqj8xGAb2uYCel LWnPCTxVOfWE/yWPx+bypCwf0O3FMKvF7CDW2iwAPYNRvfpp3t2p1Xew1FUVr5x2e2xsJx yCoZN8VitByyd4ETILd9MBAaIpFmmpc= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-658-L9oTIcoZP-OatoGMk5E47w-1; Wed, 24 Sep 2025 04:55:02 -0400 X-MC-Unique: L9oTIcoZP-OatoGMk5E47w-1 X-Mimecast-MFC-AGG-ID: L9oTIcoZP-OatoGMk5E47w_1758704101 Received: by mail-ed1-f69.google.com with SMTP id 4fb4d7f45d1cf-631845b4998so4363299a12.1 for ; Wed, 24 Sep 2025 01:55:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758704101; x=1759308901; 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=oeF4iLafWqiyYhAJj/z0HEWgGu1flHRP9T+bwNm7VOY=; b=Z2IPn93/2Pb807CXH4i2GnVrHOBMRYcHBKy1ZO8A1OUTEtSnCAjXUSqOO3nUZzYkaK JBRSow7+poK5sBYMC4hsDRnc2eknL05p14tEYQE0mQ6yKSJJUDNCljWQCy2RZZm8yx6j mpZ1XFegG3oVuUhb88qfEjvUt7Dqko4V+srb77tGzkFH5XLmHHtNvICnu3Aq5QiAJVRV ZMRH7OFLhmnrMgFuqVEAlcPUdz78YTyKxOCEnxULuIsKzN5QHxbLWLtk1AfvFBdxg7qz bu2pj4qmmEkIBgnW5spIOSgbjH0LufBTBgLuq+9wtsiR7icE5BQdT4LFpa2BSaBeGd9/ WIBg== X-Forwarded-Encrypted: i=1; AJvYcCWWB83uqvqVjCD4047KgEQV2wugj1OABL/kgLcIg0Q/VnETuCSa+D3iqImKS2y0LhHtE3btXts=@vger.kernel.org X-Gm-Message-State: AOJu0YzMIZs4GRCIcPhwuJ+VzN4toND/Mtkj2l9bQl+90QFGRuuXvvPQ AMAWlfZ1hJjGYTtCWLKjwvndYpMXVREs4ooq1Jq0nVuaTs40mVCagNQSM37H4OWNv+hjpsKDsu8 fVk5rKmGiwK5pWn1ZNvB+GHWXu0zSUWQV44vsxp15kF3P5KiLwOvhfOEU7A== X-Gm-Gg: ASbGncsWwWwaYdIhQKTWBbAzFSs2nmnVP8Ev6Um/Da8Xcg4sWTixUKEQ7SAVNLcYV6O oH6OPom5Sp7WSjzuje9OhINMSkS/PD1oApF1uivH6yRGG2XhtflmR9Hfp6dqTLKI0m0HsTJ4FqT qGPOYN0pkvLwT0VCtvhUGS82zQPxU+wnN8nG8XdTQ4cRjcinBsOVf6yuVxqvKb8b3VDDQNUJikY appZR16NeCSW7P4Wh1VS4uR/Q12Hs6jwIQCzgyYTfoLPdXUAXa2yOxVJ5Uj3g25pmVOvjWS5nl1 RUF+rAuPqbN/7FsE85vO5pCza9Cr X-Received: by 2002:a05:6402:42d4:b0:634:66c8:9e6d with SMTP id 4fb4d7f45d1cf-63467a196c6mr5117516a12.35.1758704100844; Wed, 24 Sep 2025 01:55:00 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGsvQzI/barPCHCcY3wmgFpimCqdL8DPZENn3l5dqczZHN9mqSB95iiRU7jvEjFsRYlUtc7jA== X-Received: by 2002:a05:6402:42d4:b0:634:66c8:9e6d with SMTP id 4fb4d7f45d1cf-63467a196c6mr5117491a12.35.1758704100372; Wed, 24 Sep 2025 01:55:00 -0700 (PDT) Received: from redhat.com ([31.187.78.57]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-62fa5d03befsm12964100a12.2.2025.09.24.01.54.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Sep 2025 01:54:59 -0700 (PDT) Date: Wed, 24 Sep 2025 04:54:56 -0400 From: "Michael S. Tsirkin" To: Jason Wang Cc: Simon Schippers , willemdebruijn.kernel@gmail.com, eperezma@redhat.com, stephen@networkplumber.org, leiyang@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux.dev, kvm@vger.kernel.org Subject: Re: [PATCH net-next v5 0/8] TUN/TAP & vhost_net: netdev queue flow control to avoid ptr_ring tail drop Message-ID: <20250924045430-mutt-send-email-mst@kernel.org> References: <20250922221553.47802-1-simon.schippers@tu-dortmund.de> <20250924031105-mutt-send-email-mst@kernel.org> <20250924034112-mutt-send-email-mst@kernel.org> <20250924040915-mutt-send-email-mst@kernel.org> Precedence: bulk X-Mailing-List: netdev@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, Sep 24, 2025 at 04:30:45PM +0800, Jason Wang wrote: > On Wed, Sep 24, 2025 at 4:10 PM Michael S. Tsirkin wrote: > > > > On Wed, Sep 24, 2025 at 04:08:33PM +0800, Jason Wang wrote: > > > On Wed, Sep 24, 2025 at 3:42 PM Michael S. Tsirkin wrote: > > > > > > > > On Wed, Sep 24, 2025 at 03:33:08PM +0800, Jason Wang wrote: > > > > > On Wed, Sep 24, 2025 at 3:18 PM Michael S. Tsirkin wrote: > > > > > > > > > > > > On Tue, Sep 23, 2025 at 12:15:45AM +0200, Simon Schippers wrote: > > > > > > > This patch series deals with TUN, TAP and vhost_net which drop incoming > > > > > > > SKBs whenever their internal ptr_ring buffer is full. Instead, with this > > > > > > > patch series, the associated netdev queue is stopped before this happens. > > > > > > > This allows the connected qdisc to function correctly as reported by [1] > > > > > > > and improves application-layer performance, see our paper [2]. Meanwhile > > > > > > > the theoretical performance differs only slightly: > > > > > > > > > > > > > > > > > > About this whole approach. > > > > > > What if userspace is not consuming packets? > > > > > > Won't the watchdog warnings appear? > > > > > > Is it safe to allow userspace to block a tx queue > > > > > > indefinitely? > > > > > > > > > > I think it's safe as it's a userspace device, there's no way to > > > > > guarantee the userspace can process the packet in time (so no watchdog > > > > > for TUN). > > > > > > > > > > Thanks > > > > > > > > Hmm. Anyway, I guess if we ever want to enable timeout for tun, > > > > we can worry about it then. > > > > > > The problem is that the skb is freed until userspace calls recvmsg(), > > > so it would be tricky to implement a watchdog. (Or if we can do, we > > > can do BQL as well). > > > > I thought the watchdog generally watches queues not individual skbs? > > Yes, but only if ndo_tx_timeout is implemented. > > I mean it would be tricky if we want to implement ndo_tx_timeout since > we can't choose a good timeout. > > Thanks userspace could supply that, thinkably. anyway, we can worry about that when we need that. -- MST