All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Machata <petrm@mellanox.com>
To: netdev@vger.kernel.org
Cc: Pablo Neira Ayuso <pablo@netfilter.org>,
	davem@davemloft.net, kuba@kernel.org, jiri@mellanox.com,
	petrm@mellanox.com, mlxsw@mellanox.com,
	michael.chan@broadcom.com, saeedm@mellanox.com, leon@kernel.org,
	kadlec@netfilter.org, fw@strlen.de, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, simon.horman@netronome.com,
	Ido Schimmel <idosch@mellanox.com>,
	Amit Cohen <amitc@mellanox.com>
Subject: [PATCH net-next v2 02/13] mlxsw: reg: Add Monitoring Mirror Trigger Enable Register
Date: Sat, 11 Jul 2020 00:55:04 +0300	[thread overview]
Message-ID: <b2cb5330e28e56a629df5c19a0f0c35dd41ccbc1.1594416408.git.petrm@mellanox.com> (raw)
In-Reply-To: <cover.1594416408.git.petrm@mellanox.com>

From: Amit Cohen <amitc@mellanox.com>

This register is used to configure the mirror enable for different
mirror reasons.

Signed-off-by: Amit Cohen <amitc@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
Signed-off-by: Petr Machata <petrm@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/reg.h | 50 +++++++++++++++++++++++
 1 file changed, 50 insertions(+)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index b76c839223b5..aa2fd7debec2 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -9502,6 +9502,55 @@ MLXSW_ITEM32(reg, mogcr, ptp_iftc, 0x00, 1, 1);
  */
 MLXSW_ITEM32(reg, mogcr, ptp_eftc, 0x00, 0, 1);
 
+/* MOMTE - Monitoring Mirror Trigger Enable Register
+ * -------------------------------------------------
+ * This register is used to configure the mirror enable for different mirror
+ * reasons.
+ */
+#define MLXSW_REG_MOMTE_ID 0x908D
+#define MLXSW_REG_MOMTE_LEN 0x10
+
+MLXSW_REG_DEFINE(momte, MLXSW_REG_MOMTE_ID, MLXSW_REG_MOMTE_LEN);
+
+/* reg_momte_local_port
+ * Local port number.
+ * Access: Index
+ */
+MLXSW_ITEM32(reg, momte, local_port, 0x00, 16, 8);
+
+enum mlxsw_reg_momte_type {
+	MLXSW_REG_MOMTE_TYPE_WRED = 0x20,
+	MLXSW_REG_MOMTE_TYPE_SHARED_BUFFER_TCLASS = 0x31,
+	MLXSW_REG_MOMTE_TYPE_SHARED_BUFFER_TCLASS_DESCRIPTORS = 0x32,
+	MLXSW_REG_MOMTE_TYPE_SHARED_BUFFER_EGRESS_PORT = 0x33,
+	MLXSW_REG_MOMTE_TYPE_ING_CONG = 0x40,
+	MLXSW_REG_MOMTE_TYPE_EGR_CONG = 0x50,
+	MLXSW_REG_MOMTE_TYPE_ECN = 0x60,
+	MLXSW_REG_MOMTE_TYPE_HIGH_LATENCY = 0x70,
+};
+
+/* reg_momte_type
+ * Type of mirroring.
+ * Access: Index
+ */
+MLXSW_ITEM32(reg, momte, type, 0x04, 0, 8);
+
+/* reg_momte_tclass_en
+ * TClass/PG mirror enable. Each bit represents corresponding tclass.
+ * 0: disable (default)
+ * 1: enable
+ * Access: RW
+ */
+MLXSW_ITEM_BIT_ARRAY(reg, momte, tclass_en, 0x08, 0x08, 1);
+
+static inline void mlxsw_reg_momte_pack(char *payload, u8 local_port,
+					enum mlxsw_reg_momte_type type)
+{
+	MLXSW_REG_ZERO(momte, payload);
+	mlxsw_reg_momte_local_port_set(payload, local_port);
+	mlxsw_reg_momte_type_set(payload, type);
+}
+
 /* MTPPPC - Time Precision Packet Port Configuration
  * -------------------------------------------------
  * This register serves for configuration of which PTP messages should be
@@ -10853,6 +10902,7 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
 	MLXSW_REG(mgpc),
 	MLXSW_REG(mprs),
 	MLXSW_REG(mogcr),
+	MLXSW_REG(momte),
 	MLXSW_REG(mtpppc),
 	MLXSW_REG(mtpptr),
 	MLXSW_REG(mtptpt),
-- 
2.20.1


  parent reply	other threads:[~2020-07-10 21:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-10 21:55 [PATCH net-next v2 00/13] mlxsw: Add support for buffer drops mirroring Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 01/13] net: sched: Pass qdisc reference in struct flow_block_offload Petr Machata
2020-07-11 18:22   ` Jakub Kicinski
2020-07-13 11:46     ` Petr Machata
2020-07-10 21:55 ` Petr Machata [this message]
2020-07-10 21:55 ` [PATCH net-next v2 03/13] mlxsw: reg: Add Monitoring Port Analyzer Global Register Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 04/13] mlxsw: spectrum_span: Move SPAN operations out of global file Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 05/13] mlxsw: spectrum_span: Prepare for global mirroring triggers Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 06/13] mlxsw: spectrum_span: Add support " Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 07/13] mlxsw: spectrum_span: Add APIs to enable / disable " Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 08/13] mlxsw: spectrum_flow: Convert a goto to a return Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 09/13] mlxsw: spectrum_flow: Drop an unused field Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 10/13] mlxsw: spectrum_matchall: Publish matchall data structures Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 11/13] mlxsw: spectrum_flow: Promote binder-type dispatch to spectrum.c Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 12/13] mlxsw: spectrum_qdisc: Offload mirroring on RED qevent early_drop Petr Machata
2020-07-10 21:55 ` [PATCH net-next v2 13/13] selftests: mlxsw: RED: Test offload of mirror on RED early_drop qevent Petr Machata
2020-07-14  0:22 ` [PATCH net-next v2 00/13] mlxsw: Add support for buffer drops mirroring 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=b2cb5330e28e56a629df5c19a0f0c35dd41ccbc1.1594416408.git.petrm@mellanox.com \
    --to=petrm@mellanox.com \
    --cc=amitc@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=fw@strlen.de \
    --cc=idosch@mellanox.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@mellanox.com \
    --cc=kadlec@netfilter.org \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=pablo@netfilter.org \
    --cc=saeedm@mellanox.com \
    --cc=simon.horman@netronome.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.