netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Petr Machata <petrm@nvidia.com>,
	netdev@vger.kernel.org, Jiri Pirko <jiri@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Ido Schimmel <idosch@nvidia.com>,
	Cong Wang <xiyou.wangcong@gmail.com>
Subject: Re: [PATCH net-next 1/7] net: sched: Add a trap-and-forward action
Date: Thu, 8 Apr 2021 14:25:45 -0700	[thread overview]
Message-ID: <20210408142545.1a6424e6@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <b60df78a-1aba-ba27-6508-4c67b0496020@mojatatu.com>

On Thu, 8 Apr 2021 10:05:07 -0400 Jamal Hadi Salim wrote:
> On 2021-04-08 9:38 a.m., Petr Machata wrote:
> > The TC action "trap" is used to instruct the HW datapath to drop the
> > matched packet and transfer it for processing in the SW pipeline. If
> > instead it is desirable to forward the packet and transferring a _copy_ to
> > the SW pipeline, there is no practical way to achieve that.
> > 
> > To that end add a new generic action, trap_fwd. In the software pipeline,
> > it is equivalent to an OK. When offloading, it should forward the packet to
> > the host, but unlike trap it should not drop the packet.
> 
> I am concerned about adding new opcodes which only make sense if you
> offload (or make sense only if you are running in s/w).
> 
> Those opcodes are intended to be generic abstractions so the dispatcher
> can decide what to do next. Adding things that are specific only
> to scenarios of hardware offload removes that opaqueness.
> I must have missed the discussion on ACT_TRAP because it is the
> same issue there i.e shouldnt be an opcode. For details see:
> https://people.netfilter.org/pablo/netdev0.1/papers/Linux-Traffic-Control-Classifier-Action-Subsystem-Architecture.pdf
> 
> IMO:
> It seems to me there are two actions here encapsulated in one.
> The first is to "trap" and the second is to "drop".
> This is no different semantically than say "mirror and drop"
> offload being enunciated by "skip_sw".
> 
> Does the spectrum not support multiple actions?
> e.g with a policy like:
>   match blah action trap action drop skip_sw

To make sure I understand - are you saying that trap should become 
more general and support both "and then drop" as well as "and then 
pass" semantics?

Seems like that ship has sailed, but also - how does it make it any
better WRT not having HW only opcodes? Or are you saying one is better
than two?

  reply	other threads:[~2021-04-08 21:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 13:38 [PATCH net-next 0/7] tc: Introduce a trap-and-forward action Petr Machata
2021-04-08 13:38 ` [PATCH net-next 1/7] net: sched: Add " Petr Machata
2021-04-08 14:05   ` Jamal Hadi Salim
2021-04-08 21:25     ` Jakub Kicinski [this message]
2021-04-09 11:13       ` Jamal Hadi Salim
2021-04-09 11:03     ` Petr Machata
2021-04-09 11:44       ` Jamal Hadi Salim
2021-04-09 13:43         ` Petr Machata
2021-04-11 19:23           ` Jamal Hadi Salim
2021-04-08 13:38 ` [PATCH net-next 2/7] net: sched: Make the action trap_fwd offloadable Petr Machata
2021-04-08 13:38 ` [PATCH net-next 3/7] devlink: Add a new trap for the trap_fwd action Petr Machata
2021-04-08 13:38 ` [PATCH net-next 4/7] mlxsw: Propagate extack to mlxsw_afa_block_commit() Petr Machata
2021-04-08 13:38 ` [PATCH net-next 5/7] mlxsw: Offload trap_fwd Petr Machata
2021-04-08 13:38 ` [PATCH net-next 6/7] selftests: forwarding: Add a test for TC trapping behavior Petr Machata
2021-04-08 13:38 ` [PATCH net-next 7/7] selftests: mlxsw: Add a trap_fwd test to devlink_trap_control Petr Machata

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=20210408142545.1a6424e6@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=petrm@nvidia.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 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).