From: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
To: Magnus Karlsson <magnus.karlsson@gmail.com>
Cc: magnus.karlsson@intel.com, bjorn@kernel.org, ast@kernel.org,
daniel@iogearbox.net, netdev@vger.kernel.org,
jonathan.lemon@gmail.com, bpf@vger.kernel.org
Subject: Re: [PATCH bpf] samples/bpf: consider frame size in tx_only of xdpsock sample
Date: Thu, 6 May 2021 15:09:07 +0200 [thread overview]
Message-ID: <20210506130907.GA5728@ranger.igk.intel.com> (raw)
In-Reply-To: <20210506124349.6666-1-magnus.karlsson@gmail.com>
On Thu, May 06, 2021 at 02:43:49PM +0200, Magnus Karlsson wrote:
> From: Magnus Karlsson <magnus.karlsson@intel.com>
>
> Fix the tx_only micro-benchmark in xdpsock to take frame size into
> consideration. It was hardcoded to the default value of frame_size
> which is 4K. Changing this on the command line to 2K made half of the
> packets illegal as they were outside the umem and were therefore
> discarded by the kernel.
>
> Fixes: 46738f73ea4f ("samples/bpf: add use of need_wakeup flag in xdpsock")
> Signed-off-by: Magnus Karlsson <magnus.karlsson@intel.com>
Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
> ---
> samples/bpf/xdpsock_user.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/samples/bpf/xdpsock_user.c b/samples/bpf/xdpsock_user.c
> index aa696854be78..53e300f860bb 100644
> --- a/samples/bpf/xdpsock_user.c
> +++ b/samples/bpf/xdpsock_user.c
> @@ -1255,7 +1255,7 @@ static void tx_only(struct xsk_socket_info *xsk, u32 *frame_nb, int batch_size)
> for (i = 0; i < batch_size; i++) {
> struct xdp_desc *tx_desc = xsk_ring_prod__tx_desc(&xsk->tx,
> idx + i);
> - tx_desc->addr = (*frame_nb + i) << XSK_UMEM__DEFAULT_FRAME_SHIFT;
> + tx_desc->addr = (*frame_nb + i) * opt_xsk_frame_size;
> tx_desc->len = PKT_SIZE;
> }
>
>
> base-commit: 9683e5775c75097c46bd24e65411b16ac6c6cbb3
> --
> 2.29.0
>
next prev parent reply other threads:[~2021-05-06 13:21 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-06 12:43 [PATCH bpf] samples/bpf: consider frame size in tx_only of xdpsock sample Magnus Karlsson
2021-05-06 13:09 ` Maciej Fijalkowski [this message]
2021-05-06 23:29 ` Daniel Borkmann
2021-05-06 23:30 ` patchwork-bot+netdevbpf
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=20210506130907.GA5728@ranger.igk.intel.com \
--to=maciej.fijalkowski@intel.com \
--cc=ast@kernel.org \
--cc=bjorn@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=jonathan.lemon@gmail.com \
--cc=magnus.karlsson@gmail.com \
--cc=magnus.karlsson@intel.com \
--cc=netdev@vger.kernel.org \
/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).