All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Machata <petrm@nvidia.com>
To: <netdev@vger.kernel.org>
Cc: Petr Machata <petrm@nvidia.com>, Jiri Pirko <jiri@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Ido Schimmel <idosch@nvidia.com>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jamal Hadi Salim <jhs@mojatatu.com>
Subject: [PATCH net-next 2/7] net: sched: Make the action trap_fwd offloadable
Date: Thu, 8 Apr 2021 15:38:24 +0200	[thread overview]
Message-ID: <20210408133829.2135103-3-petrm@nvidia.com> (raw)
In-Reply-To: <20210408133829.2135103-1-petrm@nvidia.com>

Add the new flow action and related support so that drivers can offload the
trap_fwd action.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
 include/net/flow_offload.h   | 1 +
 include/net/tc_act/tc_gact.h | 5 +++++
 net/sched/cls_api.c          | 2 ++
 3 files changed, 8 insertions(+)

diff --git a/include/net/flow_offload.h b/include/net/flow_offload.h
index dc5c1e69cd9f..5f35523f12b5 100644
--- a/include/net/flow_offload.h
+++ b/include/net/flow_offload.h
@@ -121,6 +121,7 @@ enum flow_action_id {
 	FLOW_ACTION_ACCEPT		= 0,
 	FLOW_ACTION_DROP,
 	FLOW_ACTION_TRAP,
+	FLOW_ACTION_TRAP_FWD,
 	FLOW_ACTION_GOTO,
 	FLOW_ACTION_REDIRECT,
 	FLOW_ACTION_MIRRED,
diff --git a/include/net/tc_act/tc_gact.h b/include/net/tc_act/tc_gact.h
index eb8f01c819e6..df9e0a19c826 100644
--- a/include/net/tc_act/tc_gact.h
+++ b/include/net/tc_act/tc_gact.h
@@ -49,6 +49,11 @@ static inline bool is_tcf_gact_trap(const struct tc_action *a)
 	return __is_tcf_gact_act(a, TC_ACT_TRAP, false);
 }
 
+static inline bool is_tcf_gact_trap_fwd(const struct tc_action *a)
+{
+	return __is_tcf_gact_act(a, TC_ACT_TRAP_FWD, false);
+}
+
 static inline bool is_tcf_gact_goto_chain(const struct tc_action *a)
 {
 	return __is_tcf_gact_act(a, TC_ACT_GOTO_CHAIN, true);
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
index d3db70865d66..95e37eb50173 100644
--- a/net/sched/cls_api.c
+++ b/net/sched/cls_api.c
@@ -3582,6 +3582,8 @@ int tc_setup_flow_action(struct flow_action *flow_action,
 			entry->id = FLOW_ACTION_DROP;
 		} else if (is_tcf_gact_trap(act)) {
 			entry->id = FLOW_ACTION_TRAP;
+		} else if (is_tcf_gact_trap_fwd(act)) {
+			entry->id = FLOW_ACTION_TRAP_FWD;
 		} else if (is_tcf_gact_goto_chain(act)) {
 			entry->id = FLOW_ACTION_GOTO;
 			entry->chain_index = tcf_gact_goto_chain_index(act);
-- 
2.26.2


  parent reply	other threads:[~2021-04-08 13:40 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
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 ` Petr Machata [this message]
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=20210408133829.2135103-3-petrm@nvidia.com \
    --to=petrm@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=idosch@nvidia.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --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.