From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 3945E369960 for ; Tue, 11 Nov 2025 17:35:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762882511; cv=none; b=MCpwBxEuxgsBwO2hMy3AwS4Da95sqiuU528yXD7TPzamzYjYKe7waVQolFksj7LQgexW/4XRXmSWNx6vhkU8ciR0+JsYXA7AXNgjowz+aT6DL8ESzc8wDg7pX9Im4XFxsbcq4KVVNXu598Ol6C2PcFv05Xv/gcRW7btQel09kY8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762882511; c=relaxed/simple; bh=EE+WvBsWH1KNgw2W8XtWypIxgQcREqPyb1uWJ2mPK4E=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Fd9VZFQaf4QSvBabUIaa9nsz/l7/t7/HQABRLbrPAeXDRKs9DdxIKVDUqzETvciI67tD48OeMK3UdMiPgvuJvAA124k+1lYL0dkeXBMwl9LKLos7vjadlfaUX20xeKvzvmMOXo5/eGSqqNXxPQyD9js9efpyV9LK81FUFiXvr5s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=iLsp+OB0; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="iLsp+OB0" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-7a59ec9bef4so4897758b3a.2 for ; Tue, 11 Nov 2025 09:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1762882509; x=1763487309; 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=fn7wodOlLmLsT5jl+y7mwvvOyNWafbKyZT24/lhSKsU=; b=iLsp+OB028yaFvcgC1JvtYs5K3+FA7KMpMnCPeqJ8I4B5f7HQeHllb/9dBCMMe7bpw GfhucaD6wvy851iS/b8d22UI+lm54YCIbLPvrw9DaKRuMa43l/IjojTZOXZnCpdlWiXc OajUZPoPmh0EmEIqexG7b2H4IUspfqpJsDpGKJAnq7AT6zp66gNtECU96TVjcE3oZYQv ceVyLXjWcKtJQjhc+HMrUsbVbt9RKP0rpIRLb1grK+Jn8IZ4abPNdaPcMoo/8yuwZHVd KKNQT+icGsXhOaAn7nIfD35L8ZUxlHTgx7hvxiRkyKX0itPOkPqCraaKbWdfqHCboMZv 3zrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1762882509; x=1763487309; 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=fn7wodOlLmLsT5jl+y7mwvvOyNWafbKyZT24/lhSKsU=; b=UJDG2vU0Sr6sZekfOk+9n7MtJqFPulzG5pJmfyJIY7SNw7IZAZ6egk1InYSu2qF3Ow HoyzNUd/KDgWMO9QRSoe2BvlLaSQ3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N4X5gKRr8bhaxc3JVEmkbc6B2QQ== X-Received: by 2002:a05:6a00:a0e:b0:7ab:995a:46af with SMTP id d2e1a72fcca58-7b225ac9db4mr16166106b3a.4.1762882509376; Tue, 11 Nov 2025 09:35:09 -0800 (PST) Received: from ?IPV6:2a03:83e0:1156:1:c8f:b917:4342:fa09? ([2620:10d:c090:500::7:7ef1]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7b783087c08sm131191b3a.3.2025.11.11.09.35.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 11 Nov 2025 09:35:09 -0800 (PST) Message-ID: <17aaebdb-aee4-4a00-926b-847943aea14c@davidwei.uk> Date: Tue, 11 Nov 2025 09:35:07 -0800 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 v6 0/5] io_uring zcrx ifq sharing To: Pavel Begunkov , io-uring@vger.kernel.org, netdev@vger.kernel.org Cc: Jens Axboe References: <20251108181423.3518005-1-dw@davidwei.uk> Content-Language: en-US From: David Wei In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025-11-11 06:40, Pavel Begunkov wrote: > On 11/8/25 18:14, David Wei wrote: >> Each ifq is bound to a HW RX queue with no way to share this across >> multiple rings. It is possible that one ring will not be able to fully >> saturate an entire HW RX queue due to userspace work. There are two ways >> to handle more work: >> >> 1. Move work to other threads, but have to pay context switch overhead >> and cold caches. >> 2. Add more rings with ifqs, but HW RX queues are a limited resource. >> >> This patchset add a way for multiple rings to share the same underlying >> src ifq that is bound to a HW RX queue. Rings with shared ifqs can issue >> io_recvzc on zero copy sockets, just like the src ring. >> >> Userspace are expected to create rings in separate threads and not >> processes, such that all rings share the same address space. This is >> because the sharing and synchronisation of refill rings is purely done >> in userspace with no kernel involvement e.g. dst rings do not mmap the >> refill ring. Also, userspace must distribute zero copy sockets steered >> into the same HW RX queue across rings sharing the ifq. > > I agree it's the simplest way to use it, but cross process sharing > is a valid use case. I'm sure you can mmap it by guessing offset > and you can place it into some shared memory otherwise. > > The implementation lgtm. I need to give it a run, but let me > queue it up with other dependencies. > Yeah there's no reason why shm + mmap wouldn't work cross process with the right offsets, but I do suspect that it'll be niche with most users running iou across threads in the same process. We can add cross process support in the future.