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 3/7] devlink: Add a new trap for the trap_fwd action
Date: Thu, 8 Apr 2021 15:38:25 +0200 [thread overview]
Message-ID: <20210408133829.2135103-4-petrm@nvidia.com> (raw)
In-Reply-To: <20210408133829.2135103-1-petrm@nvidia.com>
Add a new trap so that drivers can report packets forwarded due to the
trap_fwd action correctly.
Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
---
Documentation/networking/devlink/devlink-trap.rst | 4 ++++
include/net/devlink.h | 3 +++
net/core/devlink.c | 1 +
3 files changed, 8 insertions(+)
diff --git a/Documentation/networking/devlink/devlink-trap.rst b/Documentation/networking/devlink/devlink-trap.rst
index 935b6397e8cf..3f1c0f89d284 100644
--- a/Documentation/networking/devlink/devlink-trap.rst
+++ b/Documentation/networking/devlink/devlink-trap.rst
@@ -405,6 +405,10 @@ be added to the following table:
- ``control``
- Traps packets logged during processing of flow action trap (e.g., via
tc's trap action)
+ * - ``flow_action_trap_fwd``
+ - ``control``
+ - Traps packets logged during processing of flow action trap_fwd (e.g., via
+ tc's trap_fwd action)
* - ``early_drop``
- ``drop``
- Traps packets dropped due to the RED (Random Early Detection) algorithm
diff --git a/include/net/devlink.h b/include/net/devlink.h
index 853420db5d32..967e70363ba9 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -845,6 +845,7 @@ enum devlink_trap_generic_id {
DEVLINK_TRAP_GENERIC_ID_PTP_GENERAL,
DEVLINK_TRAP_GENERIC_ID_FLOW_ACTION_SAMPLE,
DEVLINK_TRAP_GENERIC_ID_FLOW_ACTION_TRAP,
+ DEVLINK_TRAP_GENERIC_ID_FLOW_ACTION_TRAP_FWD,
DEVLINK_TRAP_GENERIC_ID_EARLY_DROP,
DEVLINK_TRAP_GENERIC_ID_VXLAN_PARSING,
DEVLINK_TRAP_GENERIC_ID_LLC_SNAP_PARSING,
@@ -1053,6 +1054,8 @@ enum devlink_trap_group_generic_id {
"flow_action_sample"
#define DEVLINK_TRAP_GENERIC_NAME_FLOW_ACTION_TRAP \
"flow_action_trap"
+#define DEVLINK_TRAP_GENERIC_NAME_FLOW_ACTION_TRAP_FWD \
+ "flow_action_trap_fwd"
#define DEVLINK_TRAP_GENERIC_NAME_EARLY_DROP \
"early_drop"
#define DEVLINK_TRAP_GENERIC_NAME_VXLAN_PARSING \
diff --git a/net/core/devlink.c b/net/core/devlink.c
index 737b61c2976e..478d4bc01a39 100644
--- a/net/core/devlink.c
+++ b/net/core/devlink.c
@@ -9744,6 +9744,7 @@ static const struct devlink_trap devlink_trap_generic[] = {
DEVLINK_TRAP(PTP_GENERAL, CONTROL),
DEVLINK_TRAP(FLOW_ACTION_SAMPLE, CONTROL),
DEVLINK_TRAP(FLOW_ACTION_TRAP, CONTROL),
+ DEVLINK_TRAP(FLOW_ACTION_TRAP_FWD, CONTROL),
DEVLINK_TRAP(EARLY_DROP, DROP),
DEVLINK_TRAP(VXLAN_PARSING, DROP),
DEVLINK_TRAP(LLC_SNAP_PARSING, DROP),
--
2.26.2
next prev 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 ` [PATCH net-next 2/7] net: sched: Make the action trap_fwd offloadable Petr Machata
2021-04-08 13:38 ` Petr Machata [this message]
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-4-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 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).