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 1FF3026D4F7 for ; Thu, 16 Apr 2026 10:52:03 +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=1776336724; cv=none; b=hxZhbLWmrB4jP4DTg6eHuVDfucWPsO1/ZypB2FDsQv3PBRoDPMqS54YB9up07w41/iyW9QbcwtvDoXOozSSIiMI/6UbbqApfjOF0hWgcl0z8oLeU678GqB16S9hG4hiB6vzrYt7j/fMgUCyZRDTUKDJVI8i5HdvKo6AzkmUudYE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776336724; c=relaxed/simple; bh=EixB+VBYELB9QZou2WcR2YRGdtQyBm7qn3tnBBWJdDY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BTL5V6Ny/YSdaFIiGpQP7bVGJS0froRSIv9sw/GZIkJGzeszfz4awPo7BmtpLSVRdEWCyv/7M7d92uDpoECXvp9XSj3HLzgGz6RQaRiAI/Q4pvGlGeI+UwPgx+ZvNzF888LoaYvQdhCUsXx7vjNb6pTDjYPK2SSGhvOGAUUZ45U= 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=FNQ5dx8c; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=YJCV6YH8; 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="FNQ5dx8c"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="YJCV6YH8" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1776336722; 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: in-reply-to:in-reply-to:references:references; bh=RWWOQAJEN/95l4X8m42iXJycRGuqxRmfK0Cq2b139G8=; b=FNQ5dx8c6ErdBngsENolYzOejj3f9uG9sKgk3zt7bIulZQY1JSqBSIMxpahmBU2QlCQAkh jQ6BlwsuA0GJCZ+cW7KXw420e/C97XJ60Nne9wdIH3d7ibJhP4gy0OSDrECpc/UEJI3+sn ff/PVMftux6wq9WTk9lqpkApUhOwGgk= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-18-WKpB1q3IOzivltoG0SR1Mw-1; Thu, 16 Apr 2026 06:52:00 -0400 X-MC-Unique: WKpB1q3IOzivltoG0SR1Mw-1 X-Mimecast-MFC-AGG-ID: WKpB1q3IOzivltoG0SR1Mw_1776336720 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-488bd1ee9e7so49447685e9.1 for ; Thu, 16 Apr 2026 03:52:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1776336719; x=1776941519; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=RWWOQAJEN/95l4X8m42iXJycRGuqxRmfK0Cq2b139G8=; b=YJCV6YH8KDAOF/LgNXM5zZEOM2M7B/vyyNQMVv/YYHuZkXmk+uj+mT28cljJ2xz3Te I9zJZ6dKdbfNRkZgHxy8UBHsHlJAjseoz+t+BfoIdTnLfhlNeX/nEplu4hzyt9eXueiR K5+u7qpLKzxJ1LglBxA4qnDSqIJ99z/jjQBGv5Eek9Ns+WUPwhV5WJ2Pgd1mWjSSzdG6 UElY11WIU2bm+og2DeWSWzgboOevGZsjaZLoQpRhcA/1lNglJQMpLul/KxsYeMJ2YQN5 VlqoP4UI9++fVVrn3WhsAR7l5lTufOC5t1wT9kFg6QlnLcj6CIIYRiomgrZqMCxcABSD 969A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776336719; x=1776941519; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RWWOQAJEN/95l4X8m42iXJycRGuqxRmfK0Cq2b139G8=; b=lP89IGQDR8YuZZS1Qz7JsPaBocFNYQLEKLBHDl0Ug09HXY+vfDFbbX8zK/Weq1uYJi WcUCq6S56ufWPtAvFiSKkU+XafLVB357Vb1Zby8XL5pVXF68J/S12QnW6Gnx5vKXkiKM 7xm5NF60WntEFd/S6zidS2UnY1M4FSR65OudnzS+4hNdpzfyiS9DiY3ucvGVX455zFUw cuZrR8INbdH9gdzLwVHe4cixZGGqPMs8fgADqWoC9bElt5mOLVFSxCuhrHq5QX9s+BbU fPuNbygWhaBN/6NepBYHFKqMVcm/vhnlum9W9Bpg+Gfe70VsNY3mVXG8NapWf1CrYzN6 C8hw== X-Forwarded-Encrypted: i=1; AFNElJ9Tr2QY6BUv+P9PjB97RDcVG20477H7jz23JtmgBrbOWrodep0tfLmG5IqT97wADYG5RT2EiMgUXPpIQYw=@vger.kernel.org X-Gm-Message-State: AOJu0YxnE9wG4HqGgGGRgK1U0dic2Hbm5HKnk2y+uGa/0Gscnw+/2gXa +kXMUo0tgYWFG/3eLvrSFFSvKkerxz9p3z0uzK9oholE/Ef+fAsSNHHSDuY3NlzYGsIZLbrmv4i Ve/NgDUmYFLJE7rbDxTpwuBzNphDuhMgv7wIFySADxzynrt/H/bHLkjMhagR0xP7dkQ== X-Gm-Gg: AeBDieuW/fhhm2nv+XVsFZQ62eHpI1IIhFK5GjC8Jbs6iFFqeQytJcJzsYfV3tPfGJC Ywh+VCU/pWZJFE2m1z4IuFxTnDECMIbeuULl80ls3+UgME3sTW1Zsb9s2ipsJSZaWpR/APljxDD ABboIwu+Dw4HbgsEKdiwi/+Wdwm7y7Zti63JGabK3crDf9pVtGOKyiw2tkWswn1sZqdQ2aAgi0H l6wbCd2RMT1NqpAW96rYjvuiXDbQDf1Rw5wf0I0pvNogcLJwREORVk/0iLAQzNNvS5/uUe4ELF1 yN1+1Fj2rlbY1F6H9OmrCgbICMmu4a1Qo1/tkpwx+BwMXHo9xQPkmd3ZZ7ZDcuY1Aacmzom305r mT51sdHDTywHwv7GWPmxTy4sIomP1iWpwWUfK0ER38EQ= X-Received: by 2002:a05:600c:c08b:b0:488:bc6a:528d with SMTP id 5b1f17b1804b1-488d68867a0mr252350525e9.22.1776336719535; Thu, 16 Apr 2026 03:51:59 -0700 (PDT) X-Received: by 2002:a05:600c:c08b:b0:488:bc6a:528d with SMTP id 5b1f17b1804b1-488d68867a0mr252350285e9.22.1776336718976; Thu, 16 Apr 2026 03:51:58 -0700 (PDT) Received: from redhat.com (IGLD-80-230-25-21.inter.net.il. [80.230.25.21]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488f5818d70sm73936565e9.4.2026.04.16.03.51.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Apr 2026 03:51:58 -0700 (PDT) Date: Thu, 16 Apr 2026 06:51:54 -0400 From: "Michael S. Tsirkin" To: Simon Schippers Cc: Jason Wang , willemdebruijn.kernel@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, eperezma@redhat.com, leiyang@redhat.com, stephen@networkplumber.org, jon@nutanix.com, tim.gebauer@tu-dortmund.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux.dev Subject: Re: [PATCH net-next v8 4/4] tun/tap & vhost-net: avoid ptr_ring tail-drop when a qdisc is present Message-ID: <20260416065132-mutt-send-email-mst@kernel.org> References: <20260312130639.138988-1-simon.schippers@tu-dortmund.de> <20260312130639.138988-5-simon.schippers@tu-dortmund.de> <0908392d-6314-4141-b908-6c9a880ba0a4@tu-dortmund.de> <3d3274b4-f274-4cf9-9d0f-989d05148604@tu-dortmund.de> <73033bfc-4da3-4057-9480-bd977a66ecef@tu-dortmund.de> 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=us-ascii Content-Disposition: inline In-Reply-To: <73033bfc-4da3-4057-9480-bd977a66ecef@tu-dortmund.de> On Thu, Apr 16, 2026 at 10:54:45AM +0200, Simon Schippers wrote: > To summarize the discussion from my POV: > > Open point: __ptr_ring_zero_tail() is only called after > consuming ring.batch elements. > 1) Consumer wakes up the producer but the slot is not cleaned. > --> I disagree, the consumer only wakes after consuming ring.size/2. > Then __ptr_ring_zero_tail() was called at least once. > 2) Producer is woken up but see the ring is full, so it need to > drop the packet. > --> I disagree, because then NETDEV_TX_BUSY is returned. This is > noticeable as qdisc requeue and only happens very rarely. > > Points I will address: > - Minor nit on patch 2 by MST. > - Rebase patch 3 because of commit d748047 > ("ptr_ring: disable KCSAN warnings"). > - Document the pair of the smp_mb__after_atomic() in tun_net_xmit > with tun_ring_consume(). > - Use 1 ptr_ring spinlock instead of 2 (currently used for consume > and empty check), not sure how to implement it pretty rn. > - Run pktgen benchmarks with pg_set SHARED. Thanks! The plan makes sense to me. -- MST