All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, idosch@mellanox.com, eladr@mellanox.com,
	yotamg@mellanox.com, ogerlitz@mellanox.com,
	roopa@cumulusnetworks.com, gospo@cumulusnetworks.com
Subject: [patch net-next 4/5] mlxsw: reg: Share direction enum between SBPR, SBCM, SBPM
Date: Fri,  8 Apr 2016 17:45:24 +0200	[thread overview]
Message-ID: <1460130325-14931-5-git-send-email-jiri@resnulli.us> (raw)
In-Reply-To: <1460130325-14931-1-git-send-email-jiri@resnulli.us>

From: Jiri Pirko <jiri@mellanox.com>

Same field, same values, so share the same enum.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/reg.h          | 23 +++++++---------------
 .../net/ethernet/mellanox/mlxsw/spectrum_buffers.c | 20 +++++++++----------
 2 files changed, 17 insertions(+), 26 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index 28f5b99..19bdc82 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -3476,9 +3476,10 @@ static const struct mlxsw_reg_info mlxsw_reg_sbpr = {
 	.len = MLXSW_REG_SBPR_LEN,
 };
 
-enum mlxsw_reg_sbpr_dir {
-	MLXSW_REG_SBPR_DIR_INGRESS,
-	MLXSW_REG_SBPR_DIR_EGRESS,
+/* shared direstion enum for SBPR, SBCM, SBPM */
+enum mlxsw_reg_sbxx_dir {
+	MLXSW_REG_SBXX_DIR_INGRESS,
+	MLXSW_REG_SBXX_DIR_EGRESS,
 };
 
 /* reg_sbpr_dir
@@ -3511,7 +3512,7 @@ enum mlxsw_reg_sbpr_mode {
 MLXSW_ITEM32(reg, sbpr, mode, 0x08, 0, 4);
 
 static inline void mlxsw_reg_sbpr_pack(char *payload, u8 pool,
-				       enum mlxsw_reg_sbpr_dir dir,
+				       enum mlxsw_reg_sbxx_dir dir,
 				       enum mlxsw_reg_sbpr_mode mode, u32 size)
 {
 	MLXSW_REG_ZERO(sbpr, payload);
@@ -3553,11 +3554,6 @@ MLXSW_ITEM32(reg, sbcm, local_port, 0x00, 16, 8);
  */
 MLXSW_ITEM32(reg, sbcm, pg_buff, 0x00, 8, 6);
 
-enum mlxsw_reg_sbcm_dir {
-	MLXSW_REG_SBCM_DIR_INGRESS,
-	MLXSW_REG_SBCM_DIR_EGRESS,
-};
-
 /* reg_sbcm_dir
  * Direction.
  * Access: Index
@@ -3590,7 +3586,7 @@ MLXSW_ITEM32(reg, sbcm, max_buff, 0x1C, 0, 24);
 MLXSW_ITEM32(reg, sbcm, pool, 0x24, 0, 4);
 
 static inline void mlxsw_reg_sbcm_pack(char *payload, u8 local_port, u8 pg_buff,
-				       enum mlxsw_reg_sbcm_dir dir,
+				       enum mlxsw_reg_sbxx_dir dir,
 				       u32 min_buff, u32 max_buff, u8 pool)
 {
 	MLXSW_REG_ZERO(sbcm, payload);
@@ -3630,11 +3626,6 @@ MLXSW_ITEM32(reg, sbpm, local_port, 0x00, 16, 8);
  */
 MLXSW_ITEM32(reg, sbpm, pool, 0x00, 8, 4);
 
-enum mlxsw_reg_sbpm_dir {
-	MLXSW_REG_SBPM_DIR_INGRESS,
-	MLXSW_REG_SBPM_DIR_EGRESS,
-};
-
 /* reg_sbpm_dir
  * Direction.
  * Access: Index
@@ -3661,7 +3652,7 @@ MLXSW_ITEM32(reg, sbpm, min_buff, 0x18, 0, 24);
 MLXSW_ITEM32(reg, sbpm, max_buff, 0x1C, 0, 24);
 
 static inline void mlxsw_reg_sbpm_pack(char *payload, u8 local_port, u8 pool,
-				       enum mlxsw_reg_sbpm_dir dir,
+				       enum mlxsw_reg_sbxx_dir dir,
 				       u32 min_buff, u32 max_buff)
 {
 	MLXSW_REG_ZERO(sbpm, payload);
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
index 97c8d53..f58b1d3 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_buffers.c
@@ -110,7 +110,7 @@ static int mlxsw_sp_port_headroom_init(struct mlxsw_sp_port *mlxsw_sp_port)
 
 struct mlxsw_sp_sb_pool {
 	u8 pool;
-	enum mlxsw_reg_sbpr_dir dir;
+	enum mlxsw_reg_sbxx_dir dir;
 	enum mlxsw_reg_sbpr_mode mode;
 	u32 size;
 };
@@ -129,11 +129,11 @@ struct mlxsw_sp_sb_pool {
 	}
 
 #define MLXSW_SP_SB_POOL_INGRESS(_pool, _size)			\
-	MLXSW_SP_SB_POOL(_pool, MLXSW_REG_SBPR_DIR_INGRESS,	\
+	MLXSW_SP_SB_POOL(_pool, MLXSW_REG_SBXX_DIR_INGRESS,	\
 			 MLXSW_REG_SBPR_MODE_DYNAMIC, _size)
 
 #define MLXSW_SP_SB_POOL_EGRESS(_pool, _size)			\
-	MLXSW_SP_SB_POOL(_pool, MLXSW_REG_SBPR_DIR_EGRESS,	\
+	MLXSW_SP_SB_POOL(_pool, MLXSW_REG_SBXX_DIR_EGRESS,	\
 			 MLXSW_REG_SBPR_MODE_DYNAMIC, _size)
 
 static const struct mlxsw_sp_sb_pool mlxsw_sp_sb_pools[] = {
@@ -173,7 +173,7 @@ struct mlxsw_sp_sb_cm {
 		u8 pg;
 		u8 tc;
 	} u;
-	enum mlxsw_reg_sbcm_dir dir;
+	enum mlxsw_reg_sbxx_dir dir;
 	u32 min_buff;
 	u32 max_buff;
 	u8 pool;
@@ -189,15 +189,15 @@ struct mlxsw_sp_sb_cm {
 	}
 
 #define MLXSW_SP_SB_CM_INGRESS(_pg, _min_buff, _max_buff)		\
-	MLXSW_SP_SB_CM(_pg, MLXSW_REG_SBCM_DIR_INGRESS,			\
+	MLXSW_SP_SB_CM(_pg, MLXSW_REG_SBXX_DIR_INGRESS,			\
 		       _min_buff, _max_buff, 0)
 
 #define MLXSW_SP_SB_CM_EGRESS(_tc, _min_buff, _max_buff)		\
-	MLXSW_SP_SB_CM(_tc, MLXSW_REG_SBCM_DIR_EGRESS,			\
+	MLXSW_SP_SB_CM(_tc, MLXSW_REG_SBXX_DIR_EGRESS,			\
 		       _min_buff, _max_buff, 0)
 
 #define MLXSW_SP_CPU_PORT_SB_CM_EGRESS(_tc)				\
-	MLXSW_SP_SB_CM(_tc, MLXSW_REG_SBCM_DIR_EGRESS, 104, 2, 3)
+	MLXSW_SP_SB_CM(_tc, MLXSW_REG_SBXX_DIR_EGRESS, 104, 2, 3)
 
 static const struct mlxsw_sp_sb_cm mlxsw_sp_sb_cms[] = {
 	MLXSW_SP_SB_CM_INGRESS(0, MLXSW_SP_BYTES_TO_CELLS(10000), 8),
@@ -304,7 +304,7 @@ static int mlxsw_sp_cpu_port_sb_cms_init(struct mlxsw_sp *mlxsw_sp)
 
 struct mlxsw_sp_sb_pm {
 	u8 pool;
-	enum mlxsw_reg_sbpm_dir dir;
+	enum mlxsw_reg_sbxx_dir dir;
 	u32 min_buff;
 	u32 max_buff;
 };
@@ -318,11 +318,11 @@ struct mlxsw_sp_sb_pm {
 	}
 
 #define MLXSW_SP_SB_PM_INGRESS(_pool, _min_buff, _max_buff)	\
-	MLXSW_SP_SB_PM(_pool, MLXSW_REG_SBPM_DIR_INGRESS,	\
+	MLXSW_SP_SB_PM(_pool, MLXSW_REG_SBXX_DIR_INGRESS,	\
 		       _min_buff, _max_buff)
 
 #define MLXSW_SP_SB_PM_EGRESS(_pool, _min_buff, _max_buff)	\
-	MLXSW_SP_SB_PM(_pool, MLXSW_REG_SBPM_DIR_EGRESS,	\
+	MLXSW_SP_SB_PM(_pool, MLXSW_REG_SBXX_DIR_EGRESS,	\
 		       _min_buff, _max_buff)
 
 static const struct mlxsw_sp_sb_pm mlxsw_sp_sb_pms[] = {
-- 
2.5.5

  parent reply	other threads:[~2016-04-08 15:45 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-08 15:45 [patch net-next 0/5] mlxsw: small driver update Jiri Pirko
2016-04-08 15:45 ` [patch net-next 1/5] mlxsw: Move devlink port registration into common core code Jiri Pirko
2016-04-08 15:45 ` [patch net-next 2/5] mlxsw: Pass mlxsw_core as a param of mlxsw_core_skb_transmit* Jiri Pirko
2016-04-08 15:45 ` [patch net-next 3/5] mlxsw: Do not pass around driver_priv directly Jiri Pirko
2016-04-08 15:45 ` Jiri Pirko [this message]
2016-04-08 15:45 ` [patch net-next 5/5] mlxsw: reg: Fix SBPM register name Jiri Pirko
2016-04-08 15:51 ` [patch net-next 0/5] mlxsw: small driver update Jiri Pirko
2016-04-08 17:07   ` David Miller
2016-04-08 17:11     ` Jiri Pirko
  -- strict thread matches above, loose matches on Subject: below --
2016-04-26 16:53 [PATCH v2 0/5] mmc: tmio: make CTL_STATUS handling consistent Wolfram Sang
2016-04-26 16:53 ` [PATCH v2 1/5] mmc: tmio: give read32/write32 functions more descriptive names Wolfram Sang
2016-04-26 16:53 ` [PATCH v2 2/5] mmc: tmio: use BIT() within defines Wolfram Sang
2016-04-26 16:53 ` [PATCH v2 3/5] mmc: tmio: use CTL_STATUS consistently Wolfram Sang
2016-04-26 16:53 ` [PATCH v2 4/5] mmc: tmio/sdhi: distinguish between SCLKDIVEN and ILL_FUNC Wolfram Sang
2016-04-26 16:53 ` [PATCH v2 5/5] mmc: tmio: document CTL_STATUS handling Wolfram Sang
2016-04-27  8:31 ` [PATCH v2 0/5] mmc: tmio: make CTL_STATUS handling consistent Ulf Hansson
2016-04-18 19:01 [PATCH net-next v2 0/2] BPF updates Daniel Borkmann
2016-04-18 19:01 ` [PATCH net-next v2 1/2] bpf, trace: add BPF_F_CURRENT_CPU flag for bpf_perf_event_output Daniel Borkmann
2016-04-18 19:01 ` [PATCH net-next v2 2/2] bpf: add event output helper for notifications/sampling/logging Daniel Borkmann
2016-04-20  0:26 ` [PATCH net-next v2 0/2] BPF updates David Miller
2016-04-07 22:31 [RFC PATCH 00/11] GSO partial and TSO FIXEDID support Alexander Duyck
2016-04-07 22:31 ` [RFC PATCH 01/11] GRE: Disable segmentation offloads w/ CSUM and we are encapsulated via FOU Alexander Duyck
2016-04-07 22:32 ` [RFC PATCH 02/11] ethtool: Add support for toggling any of the GSO offloads Alexander Duyck
2016-04-07 22:32 ` [RFC PATCH 03/11] GSO: Add GSO type for fixed IPv4 ID Alexander Duyck
2016-04-07 22:32 ` [RFC PATCH 04/11] GRO: Add support for TCP with fixed IPv4 ID field, limit tunnel IP ID values Alexander Duyck
2016-04-07 22:32 ` [RFC PATCH 05/11] GSO: Support partial segmentation offload Alexander Duyck
2016-04-07 22:32 ` [RFC PATCH 06/11] VXLAN: Add option to mangle IP IDs on inner headers when using TSO Alexander Duyck
2016-04-07 22:32 ` [RFC PATCH 07/11] GENEVE: " Alexander Duyck
2016-04-07 23:22   ` Jesse Gross
2016-04-07 23:52     ` Alexander Duyck
2016-04-08 21:40       ` Jesse Gross
2016-04-08 22:04         ` Alexander Duyck
2016-04-09 15:52           ` Jesse Gross
2016-04-09 17:36             ` Alexander Duyck
2016-04-09 18:02               ` Eric Dumazet
2016-04-09 18:32                 ` Alexander Duyck
2016-04-07 22:32 ` [RFC PATCH 08/11] Documentation: Add documentation for TSO and GSO features Alexander Duyck
2016-04-07 22:32 ` [RFC PATCH 09/11] i40e/i40evf: Add support for GSO partial with UDP_TUNNEL_CSUM and GRE_CSUM Alexander Duyck
2016-04-07 22:32 ` [RFC PATCH 10/11] ixgbe/ixgbevf: Add support for GSO partial Alexander Duyck
2016-04-07 22:33 ` [RFC PATCH 11/11] igb/igbvf: " Alexander Duyck
2016-04-07 18:39 [PATCH v5 net-next 00/15] MTU/buffer reconfig changes Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 01/15] nfp: correct RX buffer length calculation Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 02/15] nfp: move link state interrupt request/free calls Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 03/15] nfp: break up nfp_net_{alloc|free}_rings Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 04/15] nfp: make *x_ring_init do all the init Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 05/15] nfp: allocate ring SW structs dynamically Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 06/15] nfp: cleanup tx ring flush and rename to reset Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 07/15] nfp: reorganize initial filling of RX rings Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 08/15] nfp: preallocate RX buffers early in .ndo_open Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 09/15] nfp: move filling ring information to FW config Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 10/15] nfp: slice .ndo_open() and .ndo_stop() up Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 11/15] nfp: sync ring state during FW reconfiguration Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 12/15] nfp: propagate list buffer size in struct rx_ring Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 13/15] nfp: convert .ndo_change_mtu() to prepare/commit paradigm Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 14/15] nfp: pass ring count as function parameter Jakub Kicinski
2016-04-07 18:39 ` [PATCH v5 net-next 15/15] nfp: allow ring size reconfiguration at runtime Jakub Kicinski
2016-04-08 19:34 ` [PATCH v5 net-next 00/15] MTU/buffer reconfig changes David Miller
2016-04-08 19:34   ` [PATCH v5 net-next 00/15] MTU/buffer reconfig changes, [PATCH net-next v2 1/2] bpf, trace: add BPF_F_CURRENT_CPU flag for bpf_perf_event_output, [PATCH v2 1/5] mmc: tmio: give read32/write32 functions more descriptive names, Re: [patch net-next 0/5] mlxsw: small driver update, Re: [RFC PATCH 07/11] GENEVE: Add option to mangle IP IDs on inner headers when using TSO, Re: [PATCH/RFC v2] gpio: rcar: Add Runtime PM handling for interrupts, [v3,4/6] arm64: dts: salvator-x: enable PWM David Miller, Daniel Borkmann, Wolfram Sang, David Miller, Jesse Gross, Laurent Pinchart, Ulrich Hecht
2016-03-31 11:39 [v3,6/6] clk: shmobile: r8a7795: add PWM clock Ulrich Hecht
2016-03-31 11:39 ` [PATCH v3 6/6] " Ulrich Hecht
2016-03-31 11:39 [v3,2/6] arm64: defconfig : add PWM driver support Ulrich Hecht
2016-03-31 11:39 ` [PATCH v3 2/6] " Ulrich Hecht
2016-03-31 11:39 [PATCH v3 0/6] R8A7795/Salvator-X PWM support Ulrich Hecht
2016-03-31 11:39 ` [PATCH v3 1/6] pwm: rcar: Use ARCH_RENESAS Ulrich Hecht
2016-04-06  1:18   ` [v3,1/6] " Simon Horman
2016-07-11  9:44   ` [PATCH v3 1/6] " Thierry Reding
2016-03-31 11:39 ` [PATCH v3 3/6] arm64: dts: r8a7795: Add PWM device nodes Ulrich Hecht
2016-03-31 11:39 ` [PATCH v3 4/6] arm64: dts: salvator-x: enable PWM Ulrich Hecht
2016-03-31 11:39 ` [PATCH v3 5/6] pwm: add R-Car H3 device tree bindings Ulrich Hecht
2016-04-06  1:23   ` [v3,5/6] " Simon Horman
2016-07-11  9:45   ` [PATCH v3 5/6] " Thierry Reding
2016-02-18 16:06 [PATCH/RFC v2] gpio: rcar: Add Runtime PM handling for interrupts Geert Uytterhoeven
2016-02-19  9:18 ` Linus Walleij
2016-02-19 11:59   ` Marc Zyngier
2016-04-11 16:26     ` Laurent Pinchart
2016-04-11 16:55       ` Marc Zyngier
2016-04-11 17:18         ` Geert Uytterhoeven
2016-04-12  8:06           ` Linus Walleij
2016-02-25  9:07 ` Linus Walleij
2016-02-25  9:37   ` Geert Uytterhoeven
2016-02-25 14:19     ` Linus Walleij
2016-02-25 14:26       ` Geert Uytterhoeven

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=1460130325-14931-5-git-send-email-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=eladr@mellanox.com \
    --cc=gospo@cumulusnetworks.com \
    --cc=idosch@mellanox.com \
    --cc=netdev@vger.kernel.org \
    --cc=ogerlitz@mellanox.com \
    --cc=roopa@cumulusnetworks.com \
    --cc=yotamg@mellanox.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.