All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexei Starovoitov <ast@plumgrid.com>
To: Daniel Borkmann <daniel@iogearbox.net>, davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] ebpf: add helper for obtaining current processor id
Date: Fri, 13 Mar 2015 10:06:59 -0700	[thread overview]
Message-ID: <55031933.6010507@plumgrid.com> (raw)
In-Reply-To: <870dce5d9b480d267c8b3de77bad1875adc6016c.1426249641.git.daniel@iogearbox.net>

On 3/13/15 6:22 AM, Daniel Borkmann wrote:
> This patch adds the possibility to obtain raw_smp_processor_id() in
> eBPF. Currently, this is only possible in classic BPF where commit
> da2033c28226 ("filter: add SKF_AD_RXHASH and SKF_AD_CPU") has added
> facilities for this.
>
> Single threaded packet socket applications (f.e. tcpdump, netsniff-ng)
> e.g. writing to pcap files and making use of eBPF can use this helper
> function to spread flows after RPS dispatch to several instances. It
> would also allow to track per CPU statistics (or data) with eBPF maps.

I'm not sure whether classic extension is still used by Eric as it was
envisioned in that old commit, but I do like addition of it for eBPF,
since it allows a poor men's per-cpu data structures via maps :)

> diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> index 4efc41f..9080cf5 100644
> --- a/include/uapi/linux/bpf.h
> +++ b/include/uapi/linux/bpf.h
> @@ -166,6 +166,7 @@ enum bpf_func_id {
>   	BPF_FUNC_map_update_elem, /* int map_update_elem(&map, &key, &value, flags) */
>   	BPF_FUNC_map_delete_elem, /* int map_delete_elem(&map, &key) */
>   	BPF_FUNC_random,	  /* prandom() as u32 or u64 */
> +	BPF_FUNC_cpu_id,	  /* raw_smp_processor_id() */

same comment as in other patch:
could you rename it to BPF_FUNC_get_smp_processor_id ?

  reply	other threads:[~2015-03-13 17:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 13:22 [PATCH net-next 0/2] eBPF updates Daniel Borkmann
2015-03-13 13:22 ` [PATCH net-next 1/2] ebpf: add prandom helper for packet sampling Daniel Borkmann
2015-03-13 16:58   ` Alexei Starovoitov
2015-03-13 17:03     ` Daniel Borkmann
2015-03-13 22:44       ` Daniel Borkmann
2015-03-13 22:53         ` Alexei Starovoitov
2015-03-14  0:11           ` Daniel Borkmann
2015-03-13 13:22 ` [PATCH net-next 2/2] ebpf: add helper for obtaining current processor id Daniel Borkmann
2015-03-13 17:06   ` Alexei Starovoitov [this message]
2015-03-13 17:08     ` Daniel Borkmann
2015-03-16  1:57 ` [PATCH net-next 0/2] eBPF updates David Miller

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=55031933.6010507@plumgrid.com \
    --to=ast@plumgrid.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.