netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [Q/RFC] BPF use in broader scope
@ 2012-03-29  7:44 Jiri Pirko
  2012-03-29  7:49 ` David Miller
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Jiri Pirko @ 2012-03-29  7:44 UTC (permalink / raw)
  To: netdev; +Cc: eric.dumazet, davem, bhutchings, shemminger

Hi all.

I came to an idea of using BPF infrastructure currently used in kernel,
for computing hashes selecting TX ports in team device. Since the same
data (skb) are alalyzed/used as for socket filtering, BPF seems so be quite
suitable for this. It would allow userspace daemon to specify various
kinds of TX selection algorithms.

Here are proposed things to be done:
1) introduce in-kernel api for creating sk-unattached filters (I have
   the patch cooked up already)

2) extend current BPF machine to allow XOR operation. Not sure if this
   is doable or what the best of doing this is.

3) add possibility to pass some data to the machine via
   pre-filling "Scratch Memory Store". I think this can be done easily
   moving "u32 mem[BPF_MEMWORDS];" to bpf_func caller and pass it as the
   second function parameter. That should not break anything.

Then the computed hash can be either stored into Scratch memory or returned
directly (where ordinary sk filters return len).

Does this seems reasonable? Thoughts, comments?

Thanks!

Jirka

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-05-11  8:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-29  7:44 [Q/RFC] BPF use in broader scope Jiri Pirko
2012-03-29  7:49 ` David Miller
2012-03-29  7:54   ` Jiri Pirko
2012-03-29  8:02     ` Eric Dumazet
2012-03-29  8:31       ` Jiri Pirko
2012-03-29  8:43         ` David Miller
2012-03-29  8:45         ` Eric Dumazet
2012-03-29  9:31           ` Jiri Pirko
2012-05-11  2:41             ` Li Yu
2012-05-11  6:22               ` Jiri Pirko
2012-05-11  7:06                 ` Li Yu
2012-05-11  8:45                   ` Jiri Pirko
2012-03-29  7:58 ` Eric Dumazet
2012-03-29  9:49 ` Li Yu
2012-03-29 14:04 ` Nuno Martins

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).