From: "Björn Töpel" <bjorn.topel@gmail.com>
To: Eric Leblond <eric@regit.org>
Cc: Netdev <netdev@vger.kernel.org>, bpf <bpf@vger.kernel.org>,
"Karlsson, Magnus" <magnus.karlsson@intel.com>
Subject: Re: [PATCH] xsk: sample kernel code is now in libbpf
Date: Mon, 24 Jun 2019 12:01:54 +0200 [thread overview]
Message-ID: <CAJ+HfNhwq1xHFZJHf3iVPZHsb76ay5_XeVnyTeCjTABFQoSdAQ@mail.gmail.com> (raw)
In-Reply-To: <20190621201310.12791-1-eric@regit.org>
On Fri, 21 Jun 2019 at 22:55, Eric Leblond <eric@regit.org> wrote:
>
> Fix documentation that mention xdpsock_kern.c which has been
> replaced by code embedded in libbpf.
>
> Signed-off-by: Eric Leblond <eric@regit.org>
Thanks Eric!
Acked-by: Björn Töpel <bjorn.topel@intel.com>
> ---
> Documentation/networking/af_xdp.rst | 16 +++++++++++++++-
> 1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/networking/af_xdp.rst b/Documentation/networking/af_xdp.rst
> index e14d7d40fc75..83dddc20f5d6 100644
> --- a/Documentation/networking/af_xdp.rst
> +++ b/Documentation/networking/af_xdp.rst
> @@ -220,7 +220,21 @@ Usage
> In order to use AF_XDP sockets there are two parts needed. The
> user-space application and the XDP program. For a complete setup and
> usage example, please refer to the sample application. The user-space
> -side is xdpsock_user.c and the XDP side xdpsock_kern.c.
> +side is xdpsock_user.c and the XDP side is part of libbpf.
> +
> +The XDP code sample included in tools/lib/bpf/xsk.c is the following::
> +
> + SEC("xdp_sock") int xdp_sock_prog(struct xdp_md *ctx)
> + {
> + int index = ctx->rx_queue_index;
> +
> + // A set entry here means that the correspnding queue_id
> + // has an active AF_XDP socket bound to it.
> + if (bpf_map_lookup_elem(&xsks_map, &index))
> + return bpf_redirect_map(&xsks_map, index, 0);
> +
> + return XDP_PASS;
> + }
>
> Naive ring dequeue and enqueue could look like this::
>
> --
> 2.20.1
>
next prev parent reply other threads:[~2019-06-24 10:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-21 20:13 [PATCH] xsk: sample kernel code is now in libbpf Eric Leblond
2019-06-24 10:01 ` Björn Töpel [this message]
2019-06-24 15:00 ` Daniel Borkmann
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=CAJ+HfNhwq1xHFZJHf3iVPZHsb76ay5_XeVnyTeCjTABFQoSdAQ@mail.gmail.com \
--to=bjorn.topel@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=eric@regit.org \
--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).