From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (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 EF9971F7569 for ; Mon, 8 Sep 2025 17:41:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757353315; cv=none; b=nrbp4Lkw4Q7lLwZqXmjlRlYXp5GPHe1St0GMdHnTNHx//q1kEQz8Wt20VAfIcuWaTau3rhun7OXHmK5QlsPKM1KQF2aQH5SkNOW7RUmHvtKMvzCEcc2xhPODFU5n9GhsQ8lihOFiTgjjIaedERrX/w7HxaK+ws3ScX0Mq1t6MBU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757353315; c=relaxed/simple; bh=zHM1rVps4zTpnKeQHJEkJtIwWStr9Q0kzHUdWHMSi6o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qoKp1ZoTCVcqp5u6znTUsaVubRvmfTZNkZ+JI3WpujS7eW2f3zjXtAA6NyBV6K1F9IThIiWvMgSCGV0+Hvwvw01p1hc7wdaYzLCsgqJ5IWTvf9YhePyF2B/yu2qs80ivtFok5BACvpcpRBXMID01etHKuuZYLwaa6606PvJ+vQE= 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=BUhqFkq1; arc=none smtp.client-ip=209.85.221.41 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="BUhqFkq1" Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3e4aeaa57b9so2231586f8f.1 for ; Mon, 08 Sep 2025 10:41:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757353312; x=1757958112; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=JUHvSMxY4LDfvlZDBq22Lh12fisKERtTUBvL8p6/HkQ=; b=BUhqFkq1C377xo2PAY0uwrGBT9qYjmNIMmbqP4X1aEcnPf6W7r6DrK0HXxu+KZw4kh IqTb81lFO5TNfXDB2gcUv1yef2C9LLzgXQSHLOZdRbs2nQgrbRc6BhqRb367xAzlFfns GgUyGzt1R2B4sliiP96rh1gI2NoAMaFqaCLZVaF0mO4JuetO0U52wqp6Cgwk8c7/Tf2R 0e4ympct0j25CErrXPTrH6nBH4tLeNDplF8hmv8O+NL69WWpHAveAW7KCR1nJqYr2pQk /+DP1PJ+RxdTyZiLTdcQYeA9hbgyT0kk1ninG6xiGLsJ4q+MzAc62JRs0B5WdiAzQhs2 sw/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757353312; x=1757958112; 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=JUHvSMxY4LDfvlZDBq22Lh12fisKERtTUBvL8p6/HkQ=; b=TuXVWWDxsoxF/CV4rTn8Gxz78wP/3uSnxj+OYHBxqQSHOfj6AeGpCiFucHsozfYTF7 N1wcvFschUSBADh4fvOcJR9+2HdVId7KdljV5Usr6cWXA9vEQi9Lx+PjQ/PJsP0/1TdO zf565M79lZXUwZm2Jra991klmFBsAmHtjvxr3PSfQ7RxfpnIBF6he1R4Ud3bBrgS9Djp McwrijfNh+m4CuR206YFPlKti4d2LY27ibERnU5hj2X7PkeaYwousIyWOrkxDZr+cs+J D1x4y1sY2HKjILUlVaoYpGtldcT0WYd2CujnjwbK7Q597G4FRwQ63HshGkSwRdnPl5Gq w/tQ== X-Forwarded-Encrypted: i=1; AJvYcCWKWKefXYgWsnf49OVTYHqHn3slnN2Td7Ih4aRTfXMZ7QYYyEZVSrCmj7Nap/3xcxGSOZ0=@vger.kernel.org X-Gm-Message-State: AOJu0YxTMIviJTtkLFFdSGAZZY2yMGH8G4wl/z2+3O7kTMYSisC9fjsd c6wDSpMVQWWFp/vfI1IXDaHa7FFaAiGEZgCjKGm9grr+N3WzrtpFWxHP X-Gm-Gg: ASbGncu275F4iega1lBJ5lZbXPUM7fmnsBLiWXQsIUqiR+G7I+r2ayDlWzDY1TyCq8n DjCAv3Np1mg1Z5BscOCiWGwsJlFaGgfQ/pKLlNFIdviLdzw+wfSMRqlK15gcpgectn5FAuvpCGx yjKeXitxoHhpIWGHf2NEJobIQIcscpSIu50nshWfNR2CNtN05HuZ7fJdR73zmASBFekxu8fYWgG 3n+DddcYhISbay2ju393SiHsZ+SlXq5CsC8WM8CSvDtmeHnxFTHV1Opui6OjtX+y2FV2MpkrByT kpTFQP+VN5sq19qmIPcwwCxNgTy5KDvfEtusCC8hmlhze8IgCjqsG9V2theY20nebsAZp2DjKqk lBkWqAvUguzy513fJmSCTpJjQtJo3jA== X-Google-Smtp-Source: AGHT+IEhIN7kP7AAu4AaZJ+Bt9rl7HyQ0dxeT+NrwJdFqKpGJ8D+9ObNDHJZPLWI7U5lS/Xpj/QIDQ== X-Received: by 2002:a05:6000:1acd:b0:3d1:e1b1:9640 with SMTP id ffacd0b85a97d-3e643ff6d7emr7373979f8f.30.1757353312066; Mon, 08 Sep 2025 10:41:52 -0700 (PDT) Received: from Tunnel ([194.65.32.126]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3d9f3c36a78sm26879015f8f.48.2025.09.08.10.41.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Sep 2025 10:41:50 -0700 (PDT) Date: Mon, 8 Sep 2025 19:41:48 +0200 From: Paul Chaignon To: Amery Hung Cc: Daniel Borkmann , Alexei Starovoitov , bpf , Alexei Starovoitov , Andrii Nakryiko , Eduard Zingerman Subject: Re: [PATCH bpf-next 2/4] bpf: Craft non-linear skbs in BPF_PROG_TEST_RUN Message-ID: References: Precedence: bulk X-Mailing-List: bpf@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 Fri, Sep 05, 2025 at 09:34:54AM -0700, Amery Hung wrote: > On Fri, Sep 5, 2025 at 6:24 AM Paul Chaignon wrote: > > > > On Thu, Sep 04, 2025 at 09:27:58AM -0700, Amery Hung wrote: [...] > > > How about letting users specify the linear size through ctx->data_end? I am > > > working on a set that introduces a kfunc, bpf_xdp_pull_data(). A part of is > > > to support non-linear xdp_buff in test_run_xdp, and I am doing it through > > > ctx->data_end. Is it something reasonable for test_run_skb? > > > > Oh, nice! That was next on my list :) > > > > Why use data_end though? I guess it'd work for skb, but can't we just > > add a new field to the anonymous struct for BPF_PROG_TEST_RUN? > > > > I choose to use ctx_in because it doesn't change the interface and > feels natural. kattr->test.ctx_in is already copied from users and > shows users' expectation about the input ctx. I think we should honor > that (as long as the value makes sense). WDYT? Ok, I think I see your point of view. To me, test.ctx_in *is* the context and not metadata about it. I'm worried it would be weird to users if we overload that field. I'm not against using that though if it's the consensus. > > Thanks for working on this. It would be great if there is some > consistency between test_run_skb and test_run_xdp. Definitely agree! Do you have a prototype anywhere I could check? If not, you can always flag any inconsistency when I send the v2. [...]