netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Tushar Vyavahare <tushar.vyavahare@intel.com>
Cc: <bpf@vger.kernel.org>, <netdev@vger.kernel.org>,
	<bjorn@kernel.org>, <magnus.karlsson@intel.com>,
	<jonathan.lemon@gmail.com>, <davem@davemloft.net>,
	<kuba@kernel.org>, <pabeni@redhat.com>, <ast@kernel.org>,
	<daniel@iogearbox.net>, <tirthendu.sarkar@intel.com>
Subject: Re: [PATCH bpf-next v4 1/2] selftests/xsk: Add packet stream replacement function
Date: Sat, 22 Mar 2025 14:02:26 +0100	[thread overview]
Message-ID: <Z9604qRXSb2eCwSg@boxer> (raw)
In-Reply-To: <20250321005419.684036-2-tushar.vyavahare@intel.com>

On Fri, Mar 21, 2025 at 12:54:18AM +0000, Tushar Vyavahare wrote:
> Add pkt_stream_replace_ifobject function to replace the packet stream for
> a given ifobject.
> 
> Enable separate TX and RX packet replacement, allowing RX side packet
> length adjustments using bpf_xdp_adjust_tail() in the upcoming patch.
> Currently, pkt_stream_replace() works on both TX and RX packet streams,
> and this new function provides the ability to modify one of them.
> 
> Signed-off-by: Tushar Vyavahare <tushar.vyavahare@intel.com>
> ---
>  tools/testing/selftests/bpf/xskxceiver.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)

Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

> 
> diff --git a/tools/testing/selftests/bpf/xskxceiver.c b/tools/testing/selftests/bpf/xskxceiver.c
> index 11f047b8af75..d60ee6a31c09 100644
> --- a/tools/testing/selftests/bpf/xskxceiver.c
> +++ b/tools/testing/selftests/bpf/xskxceiver.c
> @@ -757,14 +757,15 @@ static struct pkt_stream *pkt_stream_clone(struct pkt_stream *pkt_stream)
>  	return pkt_stream_generate(pkt_stream->nb_pkts, pkt_stream->pkts[0].len);
>  }
>  
> -static void pkt_stream_replace(struct test_spec *test, u32 nb_pkts, u32 pkt_len)
> +static void pkt_stream_replace_ifobject(struct ifobject *ifobj, u32 nb_pkts, u32 pkt_len)
>  {
> -	struct pkt_stream *pkt_stream;
> +	ifobj->xsk->pkt_stream = pkt_stream_generate(nb_pkts, pkt_len);
> +}
>  
> -	pkt_stream = pkt_stream_generate(nb_pkts, pkt_len);
> -	test->ifobj_tx->xsk->pkt_stream = pkt_stream;
> -	pkt_stream = pkt_stream_generate(nb_pkts, pkt_len);
> -	test->ifobj_rx->xsk->pkt_stream = pkt_stream;
> +static void pkt_stream_replace(struct test_spec *test, u32 nb_pkts, u32 pkt_len)
> +{
> +	pkt_stream_replace_ifobject(test->ifobj_tx, nb_pkts, pkt_len);
> +	pkt_stream_replace_ifobject(test->ifobj_rx, nb_pkts, pkt_len);
>  }
>  
>  static void __pkt_stream_replace_half(struct ifobject *ifobj, u32 pkt_len,
> -- 
> 2.34.1
> 

  reply	other threads:[~2025-03-22 13:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-21  0:54 [PATCH bpf-next v4 0/2] selftests/xsk: Add tests for XDP tail adjustment in AF_XDP Tushar Vyavahare
2025-03-21  0:54 ` [PATCH bpf-next v4 1/2] selftests/xsk: Add packet stream replacement function Tushar Vyavahare
2025-03-22 13:02   ` Maciej Fijalkowski [this message]
2025-03-21  0:54 ` [PATCH bpf-next v4 2/2] selftests/xsk: Add tail adjustment tests and support check Tushar Vyavahare
2025-03-22 13:14   ` Maciej Fijalkowski
2025-03-24 12:32     ` Bastien Curutchet
2025-04-08 16:54 ` [PATCH bpf-next v4 0/2] selftests/xsk: Add tests for XDP tail adjustment in AF_XDP Maciej Fijalkowski
2025-04-09 15:37   ` Alexei Starovoitov
  -- strict thread matches above, loose matches on Subject: below --
2025-04-10  3:31 Tushar Vyavahare
2025-04-10  3:31 ` [PATCH bpf-next v4 1/2] selftests/xsk: Add packet stream replacement function Tushar Vyavahare

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=Z9604qRXSb2eCwSg@boxer \
    --to=maciej.fijalkowski@intel.com \
    --cc=ast@kernel.org \
    --cc=bjorn@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=jonathan.lemon@gmail.com \
    --cc=kuba@kernel.org \
    --cc=magnus.karlsson@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=tirthendu.sarkar@intel.com \
    --cc=tushar.vyavahare@intel.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).