From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-180.mta1.migadu.com (out-180.mta1.migadu.com [95.215.58.180]) (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 C20391114 for ; Wed, 6 Aug 2025 01:24:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754443483; cv=none; b=BKT0+cKLGsf/WntEQ4GKlJo7Wyu+OLR7izSwIPesDQ2fmcQijy0DQxxQ6cg3N+McMPTHOnWB4ba66grUdS7NIUeshpvNDUr+n9IyQdR416LGs5WrvcuDOwYFwFVMaSk7cNf6NtKafF1YGZV4pAwSEJgMrXyLxL/Wu6MbZhGvxe8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1754443483; c=relaxed/simple; bh=sfSvyWmOkBnR8370DrNvAJn70vWjKwUFlaCNyyoPdIU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AQlQVkYnnTJ9LazU9D717gZtowyV6IJgH5prec+w+JgtVfdn7hzWASV9toRX6wXeubZzgV21DZdwy5hfCCtS+xWUzoRMfzAOY0wEhFnY7MVu+XITq23CFeFN9e7Ip2pC1Y8QY8w7qNT7Vr9E8dTfg4FS7YD0Ge4qlmqhOssgcIk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=nUtsBIVy; arc=none smtp.client-ip=95.215.58.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="nUtsBIVy" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1754443469; 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=uAGMpisIdex9sFjMlYz87CxGsNXYPHq1X/TVZVKvP6M=; b=nUtsBIVydd2s9jJL4R2J8ImLxKViGWPDY1vRCu61zUoJv6Bz4eApXj5yrdv4mgRp7Hz13R MRosDlm6cBRHa/2drjHXvGRqsC7lKD113TPtMaF1RjvXzS96ASqPMNSR2I0h0iTyeKzfbC f6hKc/+RM7sDk+bnDtjkGhitKytwMqM= Date: Tue, 5 Aug 2025 18:24:18 -0700 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH bpf-next V2 0/7] xdp: Allow BPF to set RX hints for XDP_REDIRECTed packets To: Jesper Dangaard Brouer Cc: Jakub Kicinski , Lorenzo Bianconi , Stanislav Fomichev , bpf@vger.kernel.org, netdev@vger.kernel.org, Alexei Starovoitov , Daniel Borkmann , Eric Dumazet , "David S. Miller" , Paolo Abeni , sdf@fomichev.me, kernel-team@cloudflare.com, arthur@arthurfabre.com, jakub@cloudflare.com, Jesse Brandeburg , Andrew Rzeznik References: <20250716142015.0b309c71@kernel.org> <20250717182534.4f305f8a@kernel.org> <20250721181344.24d47fa3@kernel.org> <20250728092956.24a7d09b@kernel.org> <4eaf6d02-6b4e-4713-a8f8-6b00a031d255@linux.dev> <21f4ee22-84f0-4d5e-8630-9a889ca11e31@kernel.org> <20250801133803.7570a6fd@kernel.org> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Martin KaFai Lau In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On 8/4/25 6:18 AM, Jesper Dangaard Brouer wrote: > Do keep-in-mind that "moving skb allocation out of the driver" is not > part of this patchset and a moonshot goal that will take a long time > (but we are already "simulation" this via XDP-redirect for years now). The XDP_PASS was first done in the very early days of BPF in 2016. The XDP-redirect then followed a similar setup. A lot has improved since then. A moonshot in 2016 does not necessarily mean it is still hard to do now. e.g. Loop is feasible. Directly reading/writing skb is also easier. Let’s first quantify what the performance loss would be if the skb is allocated and field-set by the xdp prog (for the general XDP_PASS case and the redirect+cpumap case). If it’s really worth it, let’s see what it would take for the XDP program to achieve similar optimizations. > Drivers should obviously not unconditionally populate the xdp_frame's > rx_meta area.  It is first time to populate rx_meta, once driver reach afaict, the rx_meta is reserved regardless though. The xdp prog cannot use that space for data_meta. The rx_meta will grow in time. My preference is to allow xdp prog to decide what needs to write in data_meta and decides what needs to set in the skb directly. This is the general case it should support first and then optimize.