All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>,
	John Fastabend <john.fastabend@gmail.com>
Cc: Willem de Bruijn <willemb@google.com>,
	Stanislav Fomichev <sdf@google.com>,
	Jamal Hadi Salim <hadi@mojatatu.com>,
	Jiri Pirko <jiri@resnulli.us>, Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, kernel@mojatatu.com,
	deb.chatterjee@intel.com, anjali.singhai@intel.com,
	namrata.limaye@intel.com, khalidm@nvidia.com, tom@sipanda.io,
	pratyush@sipanda.io, xiyou.wangcong@gmail.com,
	davem@davemloft.net, edumazet@google.com, pabeni@redhat.com,
	vladbu@nvidia.com, simon.horman@corigine.com,
	stefanc@marvell.com, seong.kim@amd.com, mattyk@nvidia.com,
	dan.daly@intel.com, john.andy.fingerhut@intel.com
Subject: Re: [PATCH net-next RFC 00/20] Introducing P4TC
Date: Sun, 29 Jan 2023 20:30:17 -0800	[thread overview]
Message-ID: <63d747d91add9_3367c208f1@john.notmuch> (raw)
In-Reply-To: <CAM0EoMmeYc7KxY=Sv=oynrvYMeb-GD001Zh4m5TMMVXYre=tXw@mail.gmail.com>

Jamal Hadi Salim wrote:
> On Sun, Jan 29, 2023 at 12:39 AM John Fastabend
> <john.fastabend@gmail.com> wrote:
> >
> > Willem de Bruijn wrote:
> > > On Sat, Jan 28, 2023 at 10:10 AM Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> > > >
> >
> > [...]
> >
> >
> > Also there already exists a P4 backend that targets BPF.
> >
> >  https://github.com/p4lang/p4c
> 
> There's also one based on rust - does that mean we should rewrite our
> code in rust?
> Joking aside - rust was a suggestion made at a talk i did. I ended up
> adding a slide for the next talk which read:
> 
> Title: So... how is this better than KDE?
>   Attributed to Rusty Russell
>      Who attributes it to Cort Dougan
>       s/KDE/[rust/ebpf/dpdk/vpp/ovs]/g
> 
> We have very specific goals - of which the most important is met by
> what works today and we are reusing that.

OK, I may have missed your goals I read the cover letter and merely
scanned the patches. But, seeing we've chatted about this before
let me put my critique here.

P4TC as a software datapath:

1. We can already run P4 in software with P4C which compiles into an
   existing BPF implementations, nothing new needed. If we object
   to p4c implementation there are others (VMWare has one for XDP)
   or feel free to write any other DSL or abstraction over BPF.

2. 'tc' layer is not going to be as fast as XDP so without an XDP
   implementation we can't get best possible implementation.

3. Happy to admit I don't have data, but I'm not convinced a match
   action pipeline is an ideal implementation for software. It is
   done specifically in HW to facilitate CAMs/TCAMs and other special
   logic blocks that do not map well to general purpose CPU. BPF or
   other insn are better abstraction for software.

So I struggle to find upside as a purely software implementation.
If you took an XDP P4 backend and then had this implementation
showing performance or some other vector where a XDP implementation
underperformed that would be interesting. Then either we would have
good reason to try another datapath or 

P4TC as a hardware datapath:

1. We don't have a hardware/driver implementation to review so its
   difficult to even judge if this is a good idea or not.

2. I imagine most hardware can not create TCAMs/CAMs out of
   nothing. So there is a hard problem that I believe is not
   addressed here around how user knows their software blob
   can ever be offloaded at all. How you move to new hw and
   the blob can continue to work so and an so forth.

3. FPGA P4 implementations as far as I recall can use P4 to build
   the pipeline up front. But, once its built its not like you
   would (re)build it or (re)configure it on the fly. But the workflow
   doesn't align with how I understand these patches.

4. Has any vendor with a linux driver (maybe not even in kernel yet)
   open sourced anything that resembles a P4 pipeline? Without
   this its again hard to understand what is possible and what
   vendors will let users do.

P4TC as SW/HW running same P4:

1. This doesn't need to be done in kernel. If one compiler runs
   P4 into XDP or TC-BPF that is good and another compiler runs
   it into hw specific backend. This satisifies having both
   software and hardware implementation.

Extra commentary: I agree we've been chatting about this for a long
time but until some vendor (Intel?) will OSS and support a linux
driver and hardware with open programmable parser and MAT. I'm not
sure how we get P4 for Linux users. Does it exist and I missed it?

Thanks,
John

> 
> cheers,
> jamal
> 
> > So as a SW object we can just do the P4 compilation step in user
> > space and run it in BPF as suggested. Then for hw offload we really
> > would need to see some hardware to have any concrete ideas on how
> > to make it work.
> >
> 
> 
> > Also P4 defines a runtime API so would be good to see how all that
> > works with any proposed offload.

Yep agree with your other comment not really important can be built
on top of Netlink or BPF today.

  parent reply	other threads:[~2023-01-30  4:30 UTC|newest]

Thread overview: 66+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-24 17:03 [PATCH net-next RFC 00/20] Introducing P4TC Jamal Hadi Salim
2023-01-26 23:30 ` Jakub Kicinski
2023-01-27 13:33   ` Jamal Hadi Salim
2023-01-27 17:18     ` Jakub Kicinski
2023-01-27 19:42       ` Jamal Hadi Salim
2023-01-28  1:34         ` Singhai, Anjali
2023-01-28 21:17           ` Tom Herbert
2023-01-29  2:09             ` Stephen Hemminger
2023-01-30  3:09             ` Singhai, Anjali
2023-01-30 17:05               ` Tom Herbert
2023-01-27 18:26   ` Jiri Pirko
2023-01-27 20:04     ` Jamal Hadi Salim
2023-01-27 22:26       ` sdf
2023-01-27 23:06         ` Tom Herbert
2023-01-28  0:47           ` Stanislav Fomichev
2023-01-28  1:32             ` Tom Herbert
2023-01-27 23:27         ` Jamal Hadi Salim
2023-01-28  0:47           ` Stanislav Fomichev
2023-01-28 13:37             ` Willem de Bruijn
2023-01-28 15:10               ` Jamal Hadi Salim
2023-01-28 15:33                 ` Willem de Bruijn
2023-01-29  5:39                   ` John Fastabend
2023-01-29 11:11                     ` Jamal Hadi Salim
2023-01-29 11:19                       ` Jamal Hadi Salim
2023-01-30  4:30                       ` John Fastabend [this message]
2023-01-30 10:13                         ` Jiri Pirko
2023-01-30 11:26                           ` Toke Høiland-Jørgensen
2023-01-30 14:06                             ` Jamal Hadi Salim
2023-01-30 14:42                               ` Andrew Lunn
2023-01-30 15:31                                 ` Jamal Hadi Salim
2023-01-30 17:04                               ` Toke Høiland-Jørgensen
2023-01-30 19:02                                 ` Jamal Hadi Salim
2023-01-30 20:21                                   ` Toke Høiland-Jørgensen
2023-01-30 21:10                                     ` John Fastabend
2023-01-30 21:20                                       ` Toke Høiland-Jørgensen
2023-01-30 22:53                                         ` Jamal Hadi Salim
2023-01-30 23:24                                           ` Singhai, Anjali
2023-01-31  0:06                                             ` John Fastabend
2023-01-31  0:26                                               ` Jamal Hadi Salim
2023-01-31  4:12                                                 ` Jakub Kicinski
2023-01-31 10:27                                                   ` Jamal Hadi Salim
2023-01-31 10:30                                                     ` Jamal Hadi Salim
2023-01-31 19:10                                                       ` Jakub Kicinski
2023-01-31 22:32                                                         ` Jamal Hadi Salim
2023-01-31 22:36                                                           ` Jakub Kicinski
2023-01-31 22:50                                                             ` Jamal Hadi Salim
2023-01-30 23:32                                           ` John Fastabend
2023-01-31 12:17                                           ` Toke Høiland-Jørgensen
2023-01-31 12:37                                             ` Jiri Pirko
2023-01-31 14:38                                             ` Jiri Pirko
2023-01-31 17:01                                               ` Toke Høiland-Jørgensen
2023-01-31 22:23                                                 ` Jamal Hadi Salim
2023-01-31 22:53                                                   ` Toke Høiland-Jørgensen
2023-01-31 23:31                                                     ` Jamal Hadi Salim
2023-02-01 18:08                                                       ` Toke Høiland-Jørgensen
2023-02-02 18:50                                                         ` Jamal Hadi Salim
2023-02-02 23:34                                                           ` Tom Herbert
2023-01-30 22:41                                       ` Tom Herbert
2023-02-14 17:07                               ` Edward Cree
2023-02-14 20:44                                 ` Jamal Hadi Salim
2023-02-16 20:24                                   ` Jamal Hadi Salim
2023-01-29 11:02                   ` Jamal Hadi Salim
2023-01-29 22:14                     ` Toke Høiland-Jørgensen
2023-01-28 13:41             ` Jamal Hadi Salim
2023-01-27 23:02       ` Daniel Borkmann
2023-01-27 23:57         ` Jamal Hadi Salim

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=63d747d91add9_3367c208f1@john.notmuch \
    --to=john.fastabend@gmail.com \
    --cc=anjali.singhai@intel.com \
    --cc=dan.daly@intel.com \
    --cc=davem@davemloft.net \
    --cc=deb.chatterjee@intel.com \
    --cc=edumazet@google.com \
    --cc=hadi@mojatatu.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=john.andy.fingerhut@intel.com \
    --cc=kernel@mojatatu.com \
    --cc=khalidm@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=mattyk@nvidia.com \
    --cc=namrata.limaye@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=pratyush@sipanda.io \
    --cc=sdf@google.com \
    --cc=seong.kim@amd.com \
    --cc=simon.horman@corigine.com \
    --cc=stefanc@marvell.com \
    --cc=tom@sipanda.io \
    --cc=vladbu@nvidia.com \
    --cc=willemb@google.com \
    --cc=xiyou.wangcong@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.