bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yonghong Song <yhs@fb.com>
To: Zvi Effron <zeffron@riotgames.com>, <bpf@vger.kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	Andrii Nakryiko <andrii.nakryiko@gmail.com>,
	Maciej Fijalkowski <maciej.fijalkowski@intel.com>,
	Martin KaFai Lau <kafai@fb.com>, Cody Haas <chaas@riotgames.com>,
	Lisa Watanabe <lwatanabe@riotgames.com>
Subject: Re: [PATCH bpf-next v6 2/4] bpf: support input xdp_md context in BPF_PROG_TEST_RUN
Date: Thu, 17 Jun 2021 17:57:12 -0700	[thread overview]
Message-ID: <0951275e-8104-9aee-5b96-c00e4b38ab5a@fb.com> (raw)
In-Reply-To: <20210617232904.1899-3-zeffron@riotgames.com>



On 6/17/21 4:29 PM, Zvi Effron wrote:
> Support passing a xdp_md via ctx_in/ctx_out in bpf_attr for
> BPF_PROG_TEST_RUN.
> 
> The intended use case is to pass some XDP meta data to the test runs of
> XDP programs that are used as tail calls.
> 
> For programs that use bpf_prog_test_run_xdp, support xdp_md input and
> output. Unlike with an actual xdp_md during a non-test run, data_meta must
> be 0 because it must point to the start of the provided user data. From
> the initial xdp_md, use data and data_end to adjust the pointers in the
> generated xdp_buff. All other non-zero fields are prohibited (with
> EINVAL). If the user has set ctx_out/ctx_size_out, copy the (potentially
> different) xdp_md back to the userspace.
> 
> We require all fields of input xdp_md except the ones we explicitly
> support to be set to zero. The expectation is that in the future we might
> add support for more fields and we want to fail explicitly if the user
> runs the program on the kernel where we don't yet support them.
> 
> Co-developed-by: Cody Haas <chaas@riotgames.com>
> Signed-off-by: Cody Haas <chaas@riotgames.com>
> Co-developed-by: Lisa Watanabe <lwatanabe@riotgames.com>
> Signed-off-by: Lisa Watanabe <lwatanabe@riotgames.com>
> Signed-off-by: Zvi Effron <zeffron@riotgames.com>

Acked-by: Yonghong Song <yhs@fb.com>

  reply	other threads:[~2021-06-18  0:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-17 23:29 [PATCH bpf-next v6 0/4] bpf: support input xdp_md context in BPF_PROG_TEST_RUN Zvi Effron
2021-06-17 23:29 ` [PATCH bpf-next v6 1/4] bpf: add function for XDP meta data length check Zvi Effron
2021-06-18  0:53   ` Yonghong Song
2021-06-17 23:29 ` [PATCH bpf-next v6 2/4] bpf: support input xdp_md context in BPF_PROG_TEST_RUN Zvi Effron
2021-06-18  0:57   ` Yonghong Song [this message]
2021-06-17 23:29 ` [PATCH bpf-next v6 3/4] bpf: support specifying ingress via " Zvi Effron
2021-06-18  0:58   ` Yonghong Song
2021-06-21 21:26   ` Daniel Borkmann
2021-06-21 22:46     ` Zvi Effron
2021-06-17 23:29 ` [PATCH bpf-next v6 4/4] selftests/bpf: Add test for " Zvi Effron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0951275e-8104-9aee-5b96-c00e4b38ab5a@fb.com \
    --to=yhs@fb.com \
    --cc=andrii.nakryiko@gmail.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=chaas@riotgames.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=hawk@kernel.org \
    --cc=kafai@fb.com \
    --cc=lwatanabe@riotgames.com \
    --cc=maciej.fijalkowski@intel.com \
    --cc=zeffron@riotgames.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).