From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 84052378D77 for ; Fri, 30 Jan 2026 11:13:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769771630; cv=none; b=jhbQA78ox/C+lfRncW1AKqEzEy0yi+gInWzJasKeWHJCZgXJHLz/h1RXZrTa7ntt6wzxihIzQVKf9eU8hh4GbPyOW8rweb90QZvYqC821KzFCW7Fkg4n1/PMPcGIWPbFS+BavestcPCx97Pu4jixgHe13wMql3lce6rbXMXgfHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769771630; c=relaxed/simple; bh=TCis+rQCC6z7XYAkYemlUIoHru5jgaTIrUqt6t+FWY4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oK47a/qjAJIsgzoGPIvpjvHt15r+nDHeVJaq85wbvg+Y1cww65uQ07gLyuBl7V2SjvZoGQvlUbgHGg2M/z+rBch6RLIEYrVOJq6yBIJNiCtmVu8dQBPdjBXNX93UgwGvQqyru7/YeJb0h9GfWHt5UcEZ3AYAwnWHVOQYUGy+9tk= 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=bijCiHCD; arc=none smtp.client-ip=209.85.221.48 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="bijCiHCD" Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-4327555464cso1546754f8f.1 for ; Fri, 30 Jan 2026 03:13:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769771627; x=1770376427; 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=w+yjYwZ7RDCJlqlGtt5ChUntZSWDd8aPFqDlY3AniEk=; b=bijCiHCDiDsrfYSkVIjAqtFdXK0pP3y5v8itW4VnLqZB29KGa2STuu35LNttVG3FeD 3c42LD0VN3OVZl0OwXHeg2zrB8V3YNvwyL0HXxsDzB1qcEZ+YwhJ7CMckfyeQ+x5xU72 s2CrtAtfxPINwcj5teHNx/VBE9F7lnSx4sGwHfirvj88paMTt7kmu14fQ0auD7MuVxvX 8DnEgXkyvEy22rxA+B3tXASXH4HcS+Nki6mWmlmUFHjtWbY57ac9OYUKL90KW9PJMiLN AunrO3J9F9L/zmEkvl+41y/JuzskrpStPTww79WkogBJh0QU+QarB0Sj1xg+1k9NaeNx ZBRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769771627; x=1770376427; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=w+yjYwZ7RDCJlqlGtt5ChUntZSWDd8aPFqDlY3AniEk=; b=gbku6D9Viossc/ntjvECg2PIxfY9+O79n6TLJ+hM0L97fdHrhH9ZIPEFfXo//pKZI/ RSzzXBMPv6tOs6qqDCP10w18Kd+r/3fq5/QhpIMYDtO32dfip8s/cUj5gSgsp+9KCLFF TrKohb4dGAnzfx8mDVgM8nKeyNHcer5y9sjvTFPMLIGDyHiPRk8PSgKtnC/SAUjy2C/o vwHo/Gev/2Z36f2/ovVwZLBEMtlVOPjRGZobeAkkDqUm50/oSnGQ4Xd16dvrcN+WpgK4 uKVtYeRDPwH3hqsosGA8by01VTIVglNEqChIBKTjQ60lXgOvRMcqP9t0tfaWTO6F/ii2 gggw== X-Forwarded-Encrypted: i=1; AJvYcCVgwisN8ShQDDBYnCFONKUrJxqsb/XLb/RA0NTnL3mWTrNh+AeCMHCgxTp4mHlFUMkheFyiI70=@vger.kernel.org X-Gm-Message-State: AOJu0YzrpmKx18XsDj6isk/AFX5XozFoepAX0oq2pNqTCdZRQuBz/5mI EMaZjFDgTDv4Vxb1nyxm238i7GKCrZ3VXL9X6NXX/cNpRGgjDNWt1kJh X-Gm-Gg: AZuq6aKbd+VAo7P8BBCIkfhFfswMh3izv5J156GP7FtNzbwZegX9IOnL/u9Bfn3awkP OkfS/5vJZ1LHHb9lX75fhcj5NN4OBw2NSft/nR9jrPWmv1cVB8SLtmkbg9i44nxeMscSohxt0kz QvL0NvMfgTWK7pGnaSzBqadxKg/jz6f6KA/b7KUvLfr00SyqZqKw5xtpxSHAiEJ0Z6vi9eqMmwn GJIB0E1blX5aPaSRT5gUKGGclcikaLcZvh68u+BAo6U3BNh1QP6PUpYlP6Uj+5cZGSc/0hXFObf cF42nUX8OXkZGZBCV/v0Q7VFXWCzxMyUv7m/N0xQs+oyDgEhJR31Y5t3o+CaqM0JAVm+Coxvds1 oFagRA3ihXceRW9RrsxRT8383wkywokgKIuFE+eD4XmNwroOBsBy7FYkon7+SYJb/jEJ3D48pk4 papVWaBtRBNgEMN6jUuW1afdZnsAJBZXtTSzaPEDRXlhd+ksovK0+R1wCQ18rgYl2VZZzA60TgG HX3s9fyblhtnzXQwwq+BQq4gSGPjwdQFE0jZHGgm4Io5N0= X-Received: by 2002:a05:6000:2905:b0:431:16d:63d1 with SMTP id ffacd0b85a97d-435f3aaf59dmr4092783f8f.44.1769771626677; Fri, 30 Jan 2026 03:13:46 -0800 (PST) Received: from ?IPV6:2620:10d:c096:325:77fd:1068:74c8:af87? ([2620:10d:c092:600::1:99eb]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435e131cfc9sm21437487f8f.21.2026.01.30.03.13.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 30 Jan 2026 03:13:46 -0800 (PST) Message-ID: Date: Fri, 30 Jan 2026 11:13:35 +0000 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next v10 0/5] net: devmem: improve cpu cost of RX token management To: Bobby Eshleman , Stanislav Fomichev Cc: Jakub Kicinski , Mina Almasry , "David S. Miller" , Eric Dumazet , Paolo Abeni , Simon Horman , Kuniyuki Iwashima , Willem de Bruijn , Neal Cardwell , David Ahern , Arnd Bergmann , Jonathan Corbet , Andrew Lunn , Shuah Khan , Donald Hunter , Stanislav Fomichev , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, matttbe@kernel.org, skhawaja@google.com, Bobby Eshleman References: <20260115-scratch-bobbyeshleman-devmem-tcp-token-upstream-v10-0-686d0af71978@meta.com> <20260120170749.101e8bcc@kernel.org> <20260126173124.1f0bb98e@kernel.org> Content-Language: en-US From: Pavel Begunkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/27/26 06:48, Bobby Eshleman wrote: > On Mon, Jan 26, 2026 at 10:00 PM Stanislav Fomichev > wrote: >> >> On 01/26, Jakub Kicinski wrote: >>> On Mon, 26 Jan 2026 10:45:22 -0800 Bobby Eshleman wrote: >>>> I'm onboard with improving what we have since it helps all of us >>>> currently using this API, though I'm not opposed to discussing a >>>> redesign in another thread/RFC. I do see the attraction to locating the >>>> core logic in one place and possibly reducing some complexity around >>>> socket/binding relationships. >>>> >>>> FWIW regarding nl, I do see it supports rtnl lock-free operations via >>>> '62256f98f244 rtnetlink: add RTNL_FLAG_DOIT_UNLOCKED' and routing was >>>> recently made lockless with that. I don't see / know of any fast path >>>> precedent. I'm aware there are some things I'm not sure about being >>>> relevant performance-wise, like hitting skb alloc an additional time >>>> every release batch. I'd want to do some minimal latency comparisons >>>> between that path and sockopt before diving head-first. >>> >>> FTR I'm not really pushing Netlink specifically, it may work it >>> may not. Perhaps some other ioctl-y thing exists. Just in general >>> setsockopt() on a specific socket feels increasingly awkward for >>> buffer flow. Maybe y'all disagree. >>> >>> I thought I'd clarify since I may be seen as "Mr Netlink Everywhere" :) >> >> From my side, if we do a completely new uapi, my preference would be on >> an af_xdp like mapped rings (presumably on a netlink socket?) to completely >> avoid the user-kernel copies. > > I second liking that approach. No put_cmsg() and or token alloc overhead (both > jump up in my profiling). Hmm, makes me wonder why not use zcrx instead of reinventing it? It doesn't bind net_iov to sockets just as you do in this series. And it also returns buffers back via a shared ring. Otherwise you'll be facing same issues, like rings running out of space, and so you will need to have a fallback path. And user space will need to synchronise the ring if it's shared with other threads, and there will be a question of how to scale it next, possibly by creating multiple rings as I'll likely to do soon for zcrx. -- Pavel Begunkov