Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, jiri@mellanox.com,
petrm@mellanox.com, mlxsw@mellanox.com,
Ido Schimmel <idosch@mellanox.com>
Subject: [PATCH net-next 01/11] mlxsw: reg: Add policer bandwidth limits
Date: Wed, 15 Jul 2020 11:27:23 +0300 [thread overview]
Message-ID: <20200715082733.429610-2-idosch@idosch.org> (raw)
In-Reply-To: <20200715082733.429610-1-idosch@idosch.org>
From: Ido Schimmel <idosch@mellanox.com>
Add policer bandwidth limits for both rate and burst size so that they
could be enforced by a later patch.
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Petr Machata <petrm@mellanox.com>
---
drivers/net/ethernet/mellanox/mlxsw/reg.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index 408003520602..3c5b25495751 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -3405,11 +3405,20 @@ MLXSW_ITEM32(reg, qpcr, violate_action, 0x18, 0, 4);
*/
MLXSW_ITEM64(reg, qpcr, violate_count, 0x20, 0, 64);
+/* Packets */
#define MLXSW_REG_QPCR_LOWEST_CIR 1
#define MLXSW_REG_QPCR_HIGHEST_CIR (2 * 1000 * 1000 * 1000) /* 2Gpps */
#define MLXSW_REG_QPCR_LOWEST_CBS 4
#define MLXSW_REG_QPCR_HIGHEST_CBS 24
+/* Bandwidth */
+#define MLXSW_REG_QPCR_LOWEST_CIR_BITS 1024 /* bps */
+#define MLXSW_REG_QPCR_HIGHEST_CIR_BITS 2000000000000ULL /* 2Tbps */
+#define MLXSW_REG_QPCR_LOWEST_CBS_BITS_SP1 4
+#define MLXSW_REG_QPCR_LOWEST_CBS_BITS_SP2 4
+#define MLXSW_REG_QPCR_HIGHEST_CBS_BITS_SP1 25
+#define MLXSW_REG_QPCR_HIGHEST_CBS_BITS_SP2 31
+
static inline void mlxsw_reg_qpcr_pack(char *payload, u16 pid,
enum mlxsw_reg_qpcr_ir_units ir_units,
bool bytes, u32 cir, u16 cbs)
--
2.26.2
next prev parent reply other threads:[~2020-07-15 8:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-15 8:27 [PATCH net-next 00/11] mlxsw: Offload tc police action Ido Schimmel
2020-07-15 8:27 ` Ido Schimmel [this message]
2020-07-15 8:27 ` [PATCH net-next 02/11] mlxsw: resources: Add resource identifier for global policers Ido Schimmel
2020-07-15 8:27 ` [PATCH net-next 03/11] mlxsw: spectrum_policer: Add policer core Ido Schimmel
2020-08-17 15:38 ` Bjorn Helgaas
2020-08-18 6:41 ` Ido Schimmel
2020-08-18 9:37 ` Petr Machata
2020-08-18 12:10 ` Bjorn Helgaas
2020-07-15 8:27 ` [PATCH net-next 04/11] mlxsw: spectrum_policer: Add devlink resource support Ido Schimmel
2020-07-15 8:27 ` [PATCH net-next 05/11] mlxsw: core_acl_flex_actions: Work around hardware limitation Ido Schimmel
2020-07-15 8:27 ` [PATCH net-next 06/11] mlxsw: core_acl_flex_actions: Add police action Ido Schimmel
2020-07-15 8:27 ` [PATCH net-next 07/11] mlxsw: spectrum_acl: Offload FLOW_ACTION_POLICE Ido Schimmel
2020-07-15 8:27 ` [PATCH net-next 08/11] selftests: forwarding: Add tc-police tests Ido Schimmel
2020-07-15 8:27 ` [PATCH net-next 09/11] selftests: mlxsw: tc_restrictions: Test tc-police restrictions Ido Schimmel
2020-07-15 8:27 ` [PATCH net-next 10/11] selftests: mlxsw: Add scale test for tc-police Ido Schimmel
2020-07-15 8:27 ` [PATCH net-next 11/11] selftests: mlxsw: Test policers' occupancy Ido Schimmel
2020-07-16 1:13 ` [PATCH net-next 00/11] mlxsw: Offload tc police action Jakub Kicinski
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=20200715082733.429610-2-idosch@idosch.org \
--to=idosch@idosch.org \
--cc=davem@davemloft.net \
--cc=idosch@mellanox.com \
--cc=jiri@mellanox.com \
--cc=kuba@kernel.org \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=petrm@mellanox.com \
--subject='Re: [PATCH net-next 01/11] mlxsw: reg: Add policer bandwidth limits' \
/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
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).