From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Lorenzo Bianconi <lorenzo@kernel.org>
Cc: netdev@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net,
ast@kernel.org, daniel@iogearbox.net, toke@redhat.com,
lorenzo.bianconi@redhat.com, dsahern@kernel.org,
andrii.nakryiko@gmail.com, brouer@redhat.com
Subject: Re: [PATCH v4 bpf-next 6/9] bpf: cpumap: implement XDP_REDIRECT for eBPF programs attached to map entries
Date: Fri, 26 Jun 2020 12:06:32 +0200 [thread overview]
Message-ID: <20200626120632.6ef16b5c@carbon> (raw)
In-Reply-To: <ef1a456ba3b76a61b7dc6302974f248a21d906dd.1593012598.git.lorenzo@kernel.org>
On Wed, 24 Jun 2020 17:33:55 +0200
Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> diff --git a/include/net/xdp.h b/include/net/xdp.h
> index 83b9e0142b52..5be0d4d65b94 100644
> --- a/include/net/xdp.h
> +++ b/include/net/xdp.h
> @@ -99,6 +99,7 @@ struct xdp_frame {
> };
>
> struct xdp_cpumap_stats {
> + unsigned int redirect;
> unsigned int pass;
> unsigned int drop;
> };
> diff --git a/include/trace/events/xdp.h b/include/trace/events/xdp.h
> index e2c99f5bee39..cd24e8a59529 100644
> --- a/include/trace/events/xdp.h
> +++ b/include/trace/events/xdp.h
> @@ -190,6 +190,7 @@ TRACE_EVENT(xdp_cpumap_kthread,
> __field(int, sched)
> __field(unsigned int, xdp_pass)
> __field(unsigned int, xdp_drop)
> + __field(unsigned int, xdp_redirect)
> ),
>
> TP_fast_assign(
> @@ -201,18 +202,19 @@ TRACE_EVENT(xdp_cpumap_kthread,
> __entry->sched = sched;
> __entry->xdp_pass = xdp_stats->pass;
> __entry->xdp_drop = xdp_stats->drop;
> + __entry->xdp_redirect = xdp_stats->redirect;
> ),
Let me stress, that I think can do this in a followup patch (but before
a release).
I'm considering that we should store/give a pointer to xdp_stats
(struct xdp_cpumap_stats) and let the BPF tracing program do the
"decoding"/struct access to get these values. (We will go from storing
12 bytes to 8 bytes (on 64-bit), so I don't expect much gain).
> TP_printk("kthread"
> " cpu=%d map_id=%d action=%s"
> " processed=%u drops=%u"
> " sched=%d"
> - " xdp_pass=%u xdp_drop=%u",
> + " xdp_pass=%u xdp_drop=%u xdp_redirect=%u",
> __entry->cpu, __entry->map_id,
> __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB),
> __entry->processed, __entry->drops,
> __entry->sched,
> - __entry->xdp_pass, __entry->xdp_drop)
> + __entry->xdp_pass, __entry->xdp_drop, __entry->xdp_redirect)
> );
>
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2020-06-26 10:06 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-24 15:33 [PATCH v4 bpf-next 0/9] introduce support for XDP programs in CPUMAP Lorenzo Bianconi
2020-06-24 15:33 ` [PATCH v4 bpf-next 1/9] cpumap: use non-locked version __ptr_ring_consume_batched Lorenzo Bianconi
2020-06-24 15:33 ` [PATCH v4 bpf-next 2/9] net: Refactor xdp_convert_buff_to_frame Lorenzo Bianconi
2020-06-24 15:33 ` [PATCH v4 bpf-next 3/9] samples/bpf: xdp_redirect_cpu_user: do not update bpf maps in option loop Lorenzo Bianconi
2020-06-24 15:33 ` [PATCH v4 bpf-next 4/9] cpumap: formalize map value as a named struct Lorenzo Bianconi
2020-06-24 15:33 ` [PATCH v4 bpf-next 5/9] bpf: cpumap: add the possibility to attach an eBPF program to cpumap Lorenzo Bianconi
2020-06-24 15:33 ` [PATCH v4 bpf-next 6/9] bpf: cpumap: implement XDP_REDIRECT for eBPF programs attached to map entries Lorenzo Bianconi
2020-06-25 21:28 ` Daniel Borkmann
2020-06-26 7:49 ` Jesper Dangaard Brouer
2020-06-26 7:59 ` Lorenzo Bianconi
2020-06-26 9:18 ` Jesper Dangaard Brouer
2020-06-26 10:06 ` Jesper Dangaard Brouer [this message]
2020-06-24 15:33 ` [PATCH v4 bpf-next 7/9] libbpf: add SEC name for xdp programs attached to CPUMAP Lorenzo Bianconi
2020-06-24 15:33 ` [PATCH v4 bpf-next 8/9] samples/bpf: xdp_redirect_cpu: load a eBPF program on cpumap Lorenzo Bianconi
2020-06-24 15:33 ` [PATCH v4 bpf-next 9/9] selftest: add tests for XDP programs in CPUMAP entries Lorenzo Bianconi
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=20200626120632.6ef16b5c@carbon \
--to=brouer@redhat.com \
--cc=andrii.nakryiko@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=toke@redhat.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).