netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, idosch@mellanox.com,
	mlxsw@mellanox.com
Subject: [patch net-next 09/16] mlxsw: acl_flex_actions: Trap all ACL dropped packets to DISCARD_*_ACL traps
Date: Mon, 24 Feb 2020 08:35:51 +0100	[thread overview]
Message-ID: <20200224073558.26500-10-jiri@resnulli.us> (raw)
In-Reply-To: <20200224073558.26500-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@mellanox.com>

Introduce a new set of traps:
DISCARD_INGRESS_ACL and DISCARD_EGRESS_ACL
Set the trap_action from NOP to TRAP which causes the packets dropped
by the TRAP action to be trapped under new trap IDs, depending on the
ingress/egress binding point.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c | 6 ++++--
 drivers/net/ethernet/mellanox/mlxsw/trap.h                  | 2 ++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
index b0e587583528..424ef26e6cca 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/core_acl_flex_actions.c
@@ -820,8 +820,10 @@ int mlxsw_afa_block_append_drop(struct mlxsw_afa_block *block, bool ingress)
 
 	if (IS_ERR(act))
 		return PTR_ERR(act);
-	mlxsw_afa_trap_pack(act, MLXSW_AFA_TRAP_TRAP_ACTION_NOP,
-			    MLXSW_AFA_TRAP_FORWARD_ACTION_DISCARD, 0);
+	mlxsw_afa_trap_pack(act, MLXSW_AFA_TRAP_TRAP_ACTION_TRAP,
+			    MLXSW_AFA_TRAP_FORWARD_ACTION_DISCARD,
+			    ingress ? MLXSW_TRAP_ID_DISCARD_INGRESS_ACL :
+				      MLXSW_TRAP_ID_DISCARD_EGRESS_ACL);
 	return 0;
 }
 EXPORT_SYMBOL(mlxsw_afa_block_append_drop);
diff --git a/drivers/net/ethernet/mellanox/mlxsw/trap.h b/drivers/net/ethernet/mellanox/mlxsw/trap.h
index 12e1fa998d42..eaa521b7561b 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/trap.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/trap.h
@@ -102,6 +102,8 @@ enum {
 	MLXSW_TRAP_ID_ACL1 = 0x1C1,
 	/* Multicast trap used for routes with trap-and-forward action */
 	MLXSW_TRAP_ID_ACL2 = 0x1C2,
+	MLXSW_TRAP_ID_DISCARD_INGRESS_ACL = 0x1C3,
+	MLXSW_TRAP_ID_DISCARD_EGRESS_ACL = 0x1C4,
 
 	MLXSW_TRAP_ID_MAX = 0x1FF
 };
-- 
2.21.1


  parent reply	other threads:[~2020-02-24  7:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-24  7:35 [patch net-next 00/16] mlxsw: Introduce ACL traps Jiri Pirko
2020-02-24  7:35 ` [patch net-next 01/16] mlxsw: spectrum_trap: Set unreg_action to be SET_FW_DEFAULT Jiri Pirko
2020-02-24  7:35 ` [patch net-next 02/16] mlxsw: core: Allow to register disabled traps using MLXSW_RXL_DIS Jiri Pirko
2020-02-24  7:35 ` [patch net-next 03/16] mlxsw: spectrum_trap: Use listener->en/dis_action instead of hard-coded values Jiri Pirko
2020-02-24  7:35 ` [patch net-next 04/16] mlxsw: spectrum_trap: Prepare mlxsw_core_trap_action_set() to handle not only action Jiri Pirko
2020-02-24  7:35 ` [patch net-next 05/16] devlink: add ACL generic packet traps Jiri Pirko
2020-02-24  7:35 ` [patch net-next 06/16] mlxsw: spectrum_acl: Track ingress and egress block bindings Jiri Pirko
2020-02-24  7:35 ` [patch net-next 07/16] mlxsw: spectrum_flower: Disable mixed bound blocks to contain action drop Jiri Pirko
2020-02-24  7:35 ` [patch net-next 08/16] mlxsw: spectrum_acl: Pass the ingress indication down to flex action Jiri Pirko
2020-02-24  7:35 ` Jiri Pirko [this message]
2020-02-24  7:35 ` [patch net-next 10/16] mlxsw: core: Allow to enable/disable rx_listener for trap Jiri Pirko
2020-02-24  7:35 ` [patch net-next 11/16] mlxsw: core: Extend MLXSW_RXL_DIS to register disabled trap group Jiri Pirko
2020-02-24  7:35 ` [patch net-next 12/16] mlxsw: spectrum_trap: Introduce dummy group with thin policer Jiri Pirko
2020-02-24  7:35 ` [patch net-next 13/16] mlxsw: spectrum_trap: Add ACL devlink-trap support Jiri Pirko
2020-02-24  7:35 ` [patch net-next 14/16] selftests: introduce test for mlxsw tc flower restrictions Jiri Pirko
2020-02-24  7:35 ` [patch net-next 15/16] selftests: pass pref and handle to devlink_trap_drop_* helpers Jiri Pirko
2020-02-24  7:35 ` [patch net-next 16/16] selftests: devlink_trap_acl_drops: Add ACL traps test Jiri Pirko
2020-02-24 19:55 ` [patch net-next 00/16] mlxsw: Introduce ACL traps David Miller

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=20200224073558.26500-10-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /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).