From: Jakub Kicinski <kubakici@wp.pl>
To: Jiri Pirko <jiri@resnulli.us>
Cc: "Thomas Graf" <tgraf@suug.ch>,
"John Fastabend" <john.fastabend@gmail.com>,
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: Sun, 30 Oct 2016 18:44:43 +0000 [thread overview]
Message-ID: <20161030184443.21b8a3d4@laptop> (raw)
In-Reply-To: <20161030180103.GD1686@nanopsycho.orion>
On Sun, 30 Oct 2016 19:01:03 +0100, Jiri Pirko wrote:
> Sun, Oct 30, 2016 at 06:45:26PM CET, kubakici@wp.pl wrote:
> >On Sun, 30 Oct 2016 17:38:36 +0100, Jiri Pirko wrote:
> >> Sun, Oct 30, 2016 at 11:26:49AM CET, tgraf@suug.ch wrote:
> [...]
> [...]
> >> [...]
> >> [...]
> >> [...]
> >> [...]
> [...]
> >>
> >> Agreed.
> >
> >Just to clarify my intention here was not to suggest the use of eBPF as
> >the IR. I was merely cautioning against bundling the new API with P4,
> >for multiple reasons. As John mentioned P4 spec was evolving in the
> >past. The spec is designed for HW more capable than the switch ASICs we
> >have today. As vendors move to provide more configurability we may need
> >to extend the API beyond P4. We may want to extend this API to for SW
> >hand-offs (as suggested by Thomas) which are not part of P4 spec. Also
> >John showed examples of matchd software which already uses P4 at the
> >frontend today and translates it to different targets (eBPF, u32, HW).
> >It may just be about the naming but I feel like calling the new API
> >more generically, switch AST or some such may help to avoid unnecessary
> >ties and confusion.
>
> Well, that basically means to create "something" that could be be used
> to translate p4 source to. Not sure how exactly this "something" should
> look like and how different would it be from p4. I thought it might
> be good to benefit from the p4 definition and use it directly. Not sure.
We have to translate the P4 into "something" already, that something
is the AST we will load into the kernel. Or were you planning to use
some official P4 AST? I'm not suggesting we add our own high level
language. I agree that P4 is a good starting point, and perhaps a good
high level language. I'm just cautious of creating an equivalency
between high level language (P4) and the kernel ABI.
Perhaps I'm just wasting everyone's time with this.
> >>
> >> 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
> >> |
> >>
> >> Now please consider runtime API for rule insertion/removal/stats/etc.
> >> Also, the single API is cls_p4 here:
> >>
> >> |
> >> |
> >> |
> >> |
> >> | ebpf map fillup
> >> | ^
> >> | |
> >> p4 rule --TCNL--> cls_p4 --+-> driver -> HW table fillup
> >> |
> >> userspace | kernel
> >>
> >
> >My understanding was that the main purpose of SW eBPF translation would
> >be to piggy back on eBPF userspace map API. This seems not to be the
> >case here? Is "P4 rule" being added via some new API? From performance
>
> cls_p4 TC classifier.
Oh, so the cls_p4 is just a proxy forwarding the requests to drivers
or eBPF backend. Got it. Sorry for being slow. And the requests
come down via change() op or something new? I wonder how such scheme
compares to eBPF maps performance-wise (updates/sec).
> >perspective the SW AST implementation would probably not be any slower
> >than u32, so I don't think we need eBPF for performance. I must be
> >misreading this, if we want eBPF fallback we must extend eBPF with all
> >the map types anyway... so we could just use eBPF map API? I believe
> >John has already done some work in this space (see his GitHub :))
>
> I don't think you can use existing BPF maps kernel API. You would still
> have to have another API just for the offloaded datapath. And that is
> a bypass. I strongly believe we need a single kernel API for both
> SW and HW datapath setup and runtime configuration.
Agreed, single API is a must. What is the HW characteristic which
doesn't fit with eBPF map API, though? For eBPF offload I was planning
on adding offload hooks on eBPF map lookup/update paths and a way of
associating the map with a netdev. This should be enough to forward
updates to the driver and intercept reads to return the right
statistics.
next prev parent reply other threads:[~2016-10-30 18:44 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 [this message]
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
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=20161030184443.21b8a3d4@laptop \
--to=kubakici@wp.pl \
--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=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--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 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).