All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: "Thomas Graf" <tgraf@suug.ch>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Jakub Kicinski" <kubakici@wp.pl>,
	netdev@vger.kernel.org, davem@davemloft.net, jhs@mojatatu.com,
	roopa@cumulusnetworks.com, simon.horman@netronome.com,
	ast@kernel.org, daniel@iogearbox.net, prem@barefootnetworks.com,
	hannes@stressinduktion.org, jbenc@redhat.com,
	tom@herbertland.com, mattyk@mellanox.com, idosch@mellanox.com,
	eladr@mellanox.com, yotamg@mellanox.com, nogahf@mellanox.com,
	ogerlitz@mellanox.com, linville@tuxdriver.com,
	andy@greyhouse.net, f.fainelli@gmail.com,
	dsa@cumulusnetworks.com, vivien.didelot@savoirfairelinux.com,
	andrew@lunn.ch, ivecera@redhat.com,
	"Maciej Żenczykowski" <zenczykowski@gmail.com>
Subject: Re: Let's do P4
Date: Mon, 31 Oct 2016 10:39:22 +0100	[thread overview]
Message-ID: <20161031093922.GA2895@nanopsycho.orion> (raw)
In-Reply-To: <20161030223903.GA6658@ast-mbp.hil-sfehihf.abq.wayport.net>

Sun, Oct 30, 2016 at 11:39:05PM CET, alexei.starovoitov@gmail.com wrote:
>On Sun, Oct 30, 2016 at 05:38:36PM +0100, Jiri Pirko wrote:
>> Sun, Oct 30, 2016 at 11:26:49AM CET, tgraf@suug.ch wrote:
>> >On 10/30/16 at 08:44am, Jiri Pirko wrote:
>> >> Sat, Oct 29, 2016 at 06:46:21PM CEST, john.fastabend@gmail.com wrote:
>> >> >On 16-10-29 07:49 AM, Jakub Kicinski wrote:
>> >> >> On Sat, 29 Oct 2016 09:53:28 +0200, Jiri Pirko wrote:
>> >> >>> Hi all.
>> >> >>>
>
>sorry for delay. travelling to KS, so probably missed something in
>this thread and comments can be totally off...
>
>the subject "let's do P4" is imo misleading, since it reads like
>we don't do P4 at the moment, whereas the opposite is true.
>Several p4->bpf compilers is a proof.

We don't do p4 in kernel now, we don't do p4 offloading now. That is
the reason I started this discussion.


>
>> The network world is divided into 2 general types of hw:
>> 1) network ASICs - network specific silicon, containing things like TCAM
>>    These ASICs are suitable to be programmed by P4.
>
>i think the opposite is the case in case of P4.
>when hw asic has tcam it's still far far away from being usable with P4
>which requires fully programmable protocol parser, arbitrary tables and so on.
>P4 doesn't even define TCAM as a table type. The p4 program can declare
>a desired algorithm of search in the table and compiler has to figure out
>what HW resources to use to satisfy such p4 program.
>
>> 2) network processors - basically a general purpose CPUs
>>    These processors are suitable to be programmed by eBPF.
>
>I think this statement is also misleading, since it positions
>p4 and bpf as competitors whereas that's not the case.
>p4 is the language. bpf is an instruction set.

I wanted to say that we are having 2 approaches in silicon, 2 different
paradigms. Sure you can do p4>bpf. But hard to do it the opposite way.


>
>> Exactly. Following drawing shows p4 pipeline setup for SW and Hw:
>> 
>>                                  |
>>                                  |               +--> ebpf engine
>>                                  |               |
>>                                  |               |
>>                                  |           compilerB
>>                                  |               ^
>>                                  |               |
>> p4src --> compilerA --> p4ast --TCNL--> cls_p4 --+-> driver -> compilerC -> HW
>>                                  |
>>                        userspace | kernel
>>                                  |
>
>frankly this diagram smells very much like kernel bypass to me,

what? That is well defined kernel API, in-kernel sw consumer and offload
in driver. Same API for both.

Alex, you have very odd sense about what's bypassing kernel. That kind
of freaks me out...


>since I cannot see how one can put the whole p4 language compiler
>into the driver, so this last step of p4ast->hw, I presume, will be
>done by firmware, which will be running full compiler in an embedded cpu

In case of mlxsw, that compiler would be in driver.


>on the switch. To me that's precisely the kernel bypass, since we won't
>have a clue what HW capabilities actually are and won't be able to fine
>grain control them.
>Please correct me if I'm wrong.

You are wrong. By your definition, everything has to be figured out in
driver and FW does nothing. Otherwise it could do "something else" and
that would be a bypass? Does not make any sense to me whatsoever.


>
>> Plus the thing I cannot imagine in the model you propose is table fillup.
>> For ebpf, you use maps. For p4 you would have to have a separate HW-only
>> API. This is very similar to the original John's Flow-API. And therefore
>> a kernel bypass.
>
>I think John's flow api is a better way to expose mellanox switch capabilities.

We are under impression that p4 suits us nicely. But it is not about
us, it is about finding the common way to do this.


>I also think it's not fair to call it 'bypass'. I see nothing in it
>that justify such 'swear word' ;)

John's Flow-API was a kernel bypass. Why? It was a API specifically
designed to directly work with HW tables, without kernel being involved.


>The goal of flow api was to expose HW features to user space, so that
>user space can program it. For something simple as mellanox switch
>asic it fits perfectly well.

Again, this is not mlx-asic-specific. And again, that is a kernel bypass.


>Unless I misunderstand the bigger goal of this discussion and it's
>about programming ezchip devices.

No. For network processors, I believe that BPF is nicely offloadable, no
need to do the excercise for that.


>
>If the goal is to model hw tcam in the linux kernel then just introduce
>tcam bpf map type. It will be dog slow in user space, but it will
>match exactly what is happnening in the HW and user space can make
>sensible trade-offs.

No, you got me completely wrong. This is not about the TCAM. This is
about differences in the 2 words (p4/bpf).
Again, for "p4-ish" devices, you have to translate BPF. And as you
noted, it's an instruction set. Very hard if not impossible to parse in
order to get back the original semantics.

  parent reply	other threads:[~2016-10-31  9:39 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-29  7:53 Let's do P4 Jiri Pirko
2016-10-29  9:39 ` Thomas Graf
2016-10-29 10:10   ` Jiri Pirko
2016-10-29 11:15     ` Thomas Graf
2016-10-29 11:28       ` Jiri Pirko
2016-10-29 12:09         ` Thomas Graf
2016-10-29 13:58           ` Jiri Pirko
2016-10-29 14:54             ` Jakub Kicinski
2016-10-29 14:58               ` Jiri Pirko
2016-10-29 14:49 ` Jakub Kicinski
2016-10-29 14:55   ` Jiri Pirko
2016-10-29 16:46   ` John Fastabend
2016-10-30  7:44     ` Jiri Pirko
2016-10-30 10:26       ` Thomas Graf
2016-10-30 16:38         ` Jiri Pirko
2016-10-30 17:45           ` Jakub Kicinski
2016-10-30 18:01             ` Jiri Pirko
2016-10-30 18:44               ` Jakub Kicinski
2016-10-30 19:56                 ` Jiri Pirko
2016-10-30 21:14                   ` John Fastabend
2016-10-30 22:39           ` Alexei Starovoitov
2016-10-31  6:03             ` Maciej Żenczykowski
2016-10-31  7:47               ` Jiri Pirko
2016-10-31  9:39             ` Jiri Pirko [this message]
2016-10-31 16:53               ` John Fastabend
2016-10-31 17:12                 ` Jiri Pirko
2016-10-31 18:32                   ` Hannes Frederic Sowa
2016-10-31 19:35                   ` John Fastabend
2016-11-01  8:46                     ` Jiri Pirko
2016-11-01 15:13                       ` John Fastabend
2016-11-02  8:07                         ` Jiri Pirko
2016-11-02 15:18                           ` John Fastabend
2016-11-02 15:23                             ` Jiri Pirko
2016-11-02  2:29               ` Daniel Borkmann
2016-11-02  5:06                 ` Maciej Żenczykowski
2016-11-02  8:14                 ` Jiri Pirko
2016-11-02 15:22                   ` John Fastabend
2016-11-02 15:27                     ` Jiri Pirko
2016-10-30 20:54       ` John Fastabend
2016-11-01 11:57 ` Jamal Hadi Salim
2016-11-01 15:03   ` John Fastabend

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=20161031093922.GA2895@nanopsycho.orion \
    --to=jiri@resnulli.us \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=andy@greyhouse.net \
    --cc=ast@kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=dsa@cumulusnetworks.com \
    --cc=eladr@mellanox.com \
    --cc=f.fainelli@gmail.com \
    --cc=hannes@stressinduktion.org \
    --cc=idosch@mellanox.com \
    --cc=ivecera@redhat.com \
    --cc=jbenc@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=john.fastabend@gmail.com \
    --cc=kubakici@wp.pl \
    --cc=linville@tuxdriver.com \
    --cc=mattyk@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=nogahf@mellanox.com \
    --cc=ogerlitz@mellanox.com \
    --cc=prem@barefootnetworks.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=simon.horman@netronome.com \
    --cc=tgraf@suug.ch \
    --cc=tom@herbertland.com \
    --cc=vivien.didelot@savoirfairelinux.com \
    --cc=yotamg@mellanox.com \
    --cc=zenczykowski@gmail.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 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.