diff mbox series

[1/5] mlxsw: reg: Remove unused inline function mlxsw_reg_sftr2_pack()

Message ID 20220921090455.752011-2-cuigaosheng1@huawei.com (mailing list archive)
State Not Applicable
Delegated to: Johannes Berg
Headers show
Series Remove useless inline functions from net | expand

Commit Message

cuigaosheng Sept. 21, 2022, 9:04 a.m. UTC
All uses of mlxsw_reg_sftr2_pack() have
been removed since commit 77b7f83d5c25 ("mlxsw: Enable unified
bridge model"), so remove it.

Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
---
 drivers/net/ethernet/mellanox/mlxsw/reg.h | 16 ----------------
 1 file changed, 16 deletions(-)

Comments

Ido Schimmel Sept. 21, 2022, 10:34 a.m. UTC | #1
On Wed, Sep 21, 2022 at 05:04:51PM +0800, Gaosheng Cui wrote:
> All uses of mlxsw_reg_sftr2_pack() have
> been removed since commit 77b7f83d5c25 ("mlxsw: Enable unified
> bridge model"), so remove it.

Please rather remove the entire register in v2 [1].

Subject prefix should be "PATCH net-next":
https://docs.kernel.org/process/maintainer-netdev.html#how-do-i-indicate-which-tree-net-vs-net-next-my-patch-should-be-in

Thanks

[1]
diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index b293a154e49f..1cc117c8f230 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -2251,76 +2251,6 @@ static inline void mlxsw_reg_smpe_pack(char *payload, u16 local_port,
 	mlxsw_reg_smpe_evid_set(payload, evid);
 }
 
-/* SFTR-V2 - Switch Flooding Table Version 2 Register
- * --------------------------------------------------
- * The switch flooding table is used for flooding packet replication. The table
- * defines a bit mask of ports for packet replication.
- */
-#define MLXSW_REG_SFTR2_ID 0x202F
-#define MLXSW_REG_SFTR2_LEN 0x120
-
-MLXSW_REG_DEFINE(sftr2, MLXSW_REG_SFTR2_ID, MLXSW_REG_SFTR2_LEN);
-
-/* reg_sftr2_swid
- * Switch partition ID with which to associate the port.
- * Access: Index
- */
-MLXSW_ITEM32(reg, sftr2, swid, 0x00, 24, 8);
-
-/* reg_sftr2_flood_table
- * Flooding table index to associate with the specific type on the specific
- * switch partition.
- * Access: Index
- */
-MLXSW_ITEM32(reg, sftr2, flood_table, 0x00, 16, 6);
-
-/* reg_sftr2_index
- * Index. Used as an index into the Flooding Table in case the table is
- * configured to use VID / FID or FID Offset.
- * Access: Index
- */
-MLXSW_ITEM32(reg, sftr2, index, 0x00, 0, 16);
-
-/* reg_sftr2_table_type
- * See mlxsw_flood_table_type
- * Access: RW
- */
-MLXSW_ITEM32(reg, sftr2, table_type, 0x04, 16, 3);
-
-/* reg_sftr2_range
- * Range of entries to update
- * Access: Index
- */
-MLXSW_ITEM32(reg, sftr2, range, 0x04, 0, 16);
-
-/* reg_sftr2_port
- * Local port membership (1 bit per port).
- * Access: RW
- */
-MLXSW_ITEM_BIT_ARRAY(reg, sftr2, port, 0x20, 0x80, 1);
-
-/* reg_sftr2_port_mask
- * Local port mask (1 bit per port).
- * Access: WO
- */
-MLXSW_ITEM_BIT_ARRAY(reg, sftr2, port_mask, 0xA0, 0x80, 1);
-
-static inline void mlxsw_reg_sftr2_pack(char *payload,
-					unsigned int flood_table,
-					unsigned int index,
-					enum mlxsw_flood_table_type table_type,
-					unsigned int range, u16 port, bool set)
-{
-	MLXSW_REG_ZERO(sftr2, payload);
-	mlxsw_reg_sftr2_swid_set(payload, 0);
-	mlxsw_reg_sftr2_flood_table_set(payload, flood_table);
-	mlxsw_reg_sftr2_index_set(payload, index);
-	mlxsw_reg_sftr2_table_type_set(payload, table_type);
-	mlxsw_reg_sftr2_range_set(payload, range);
-	mlxsw_reg_sftr2_port_set(payload, port, set);
-	mlxsw_reg_sftr2_port_mask_set(payload, port, 1);
-}
-
 /* SMID-V2 - Switch Multicast ID Version 2 Register
  * ------------------------------------------------
  * The MID record maps from a MID (Multicast ID), which is a unique identifier
@@ -12876,7 +12806,6 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
 	MLXSW_REG(spvc),
 	MLXSW_REG(spevet),
 	MLXSW_REG(smpe),
-	MLXSW_REG(sftr2),
 	MLXSW_REG(smid2),
 	MLXSW_REG(cwtp),
 	MLXSW_REG(cwtpm),
Petr Machata Sept. 21, 2022, 1:15 p.m. UTC | #2
Gaosheng Cui <cuigaosheng1@huawei.com> writes:

> All uses of mlxsw_reg_sftr2_pack() have
> been removed since commit 77b7f83d5c25 ("mlxsw: Enable unified
> bridge model"), so remove it.
>
> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>

Reviewed-by: Petr Machata <petrm@nvidia.com>
Petr Machata Sept. 21, 2022, 1:17 p.m. UTC | #3
Petr Machata <petrm@nvidia.com> writes:

> Gaosheng Cui <cuigaosheng1@huawei.com> writes:
>
>> All uses of mlxsw_reg_sftr2_pack() have
>> been removed since commit 77b7f83d5c25 ("mlxsw: Enable unified
>> bridge model"), so remove it.
>>
>> Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
>
> Reviewed-by: Petr Machata <petrm@nvidia.com>

I missed Ido's reply.
cuigaosheng Sept. 22, 2022, 9:03 a.m. UTC | #4
> Please rather remove the entire register in v2 [1].
>
> Subject prefix should be "PATCH net-next":
> https://docs.kernel.org/process/maintainer-netdev.html#how-do-i-indicate-which-tree-net-vs-net-next-my-patch-should-be-in
>
> Thanks

Thanks for taking the time to review this patch, I have made a patch v2 and submitted it.

Link: https://patchwork.kernel.org/project/netdevbpf/list/?series=679311

> On Wed, Sep 21, 2022 at 05:04:51PM +0800, Gaosheng Cui wrote:
>> All uses of mlxsw_reg_sftr2_pack() have
>> been removed since commit 77b7f83d5c25 ("mlxsw: Enable unified
>> bridge model"), so remove it.
> Please rather remove the entire register in v2 [1].
>
> Subject prefix should be "PATCH net-next":
> https://docs.kernel.org/process/maintainer-netdev.html#how-do-i-indicate-which-tree-net-vs-net-next-my-patch-should-be-in
>
> Thanks
>
> [1]
> diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
> index b293a154e49f..1cc117c8f230 100644
> --- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
> +++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
> @@ -2251,76 +2251,6 @@ static inline void mlxsw_reg_smpe_pack(char *payload, u16 local_port,
>   	mlxsw_reg_smpe_evid_set(payload, evid);
>   }
>   
> -/* SFTR-V2 - Switch Flooding Table Version 2 Register
> - * --------------------------------------------------
> - * The switch flooding table is used for flooding packet replication. The table
> - * defines a bit mask of ports for packet replication.
> - */
> -#define MLXSW_REG_SFTR2_ID 0x202F
> -#define MLXSW_REG_SFTR2_LEN 0x120
> -
> -MLXSW_REG_DEFINE(sftr2, MLXSW_REG_SFTR2_ID, MLXSW_REG_SFTR2_LEN);
> -
> -/* reg_sftr2_swid
> - * Switch partition ID with which to associate the port.
> - * Access: Index
> - */
> -MLXSW_ITEM32(reg, sftr2, swid, 0x00, 24, 8);
> -
> -/* reg_sftr2_flood_table
> - * Flooding table index to associate with the specific type on the specific
> - * switch partition.
> - * Access: Index
> - */
> -MLXSW_ITEM32(reg, sftr2, flood_table, 0x00, 16, 6);
> -
> -/* reg_sftr2_index
> - * Index. Used as an index into the Flooding Table in case the table is
> - * configured to use VID / FID or FID Offset.
> - * Access: Index
> - */
> -MLXSW_ITEM32(reg, sftr2, index, 0x00, 0, 16);
> -
> -/* reg_sftr2_table_type
> - * See mlxsw_flood_table_type
> - * Access: RW
> - */
> -MLXSW_ITEM32(reg, sftr2, table_type, 0x04, 16, 3);
> -
> -/* reg_sftr2_range
> - * Range of entries to update
> - * Access: Index
> - */
> -MLXSW_ITEM32(reg, sftr2, range, 0x04, 0, 16);
> -
> -/* reg_sftr2_port
> - * Local port membership (1 bit per port).
> - * Access: RW
> - */
> -MLXSW_ITEM_BIT_ARRAY(reg, sftr2, port, 0x20, 0x80, 1);
> -
> -/* reg_sftr2_port_mask
> - * Local port mask (1 bit per port).
> - * Access: WO
> - */
> -MLXSW_ITEM_BIT_ARRAY(reg, sftr2, port_mask, 0xA0, 0x80, 1);
> -
> -static inline void mlxsw_reg_sftr2_pack(char *payload,
> -					unsigned int flood_table,
> -					unsigned int index,
> -					enum mlxsw_flood_table_type table_type,
> -					unsigned int range, u16 port, bool set)
> -{
> -	MLXSW_REG_ZERO(sftr2, payload);
> -	mlxsw_reg_sftr2_swid_set(payload, 0);
> -	mlxsw_reg_sftr2_flood_table_set(payload, flood_table);
> -	mlxsw_reg_sftr2_index_set(payload, index);
> -	mlxsw_reg_sftr2_table_type_set(payload, table_type);
> -	mlxsw_reg_sftr2_range_set(payload, range);
> -	mlxsw_reg_sftr2_port_set(payload, port, set);
> -	mlxsw_reg_sftr2_port_mask_set(payload, port, 1);
> -}
> -
>   /* SMID-V2 - Switch Multicast ID Version 2 Register
>    * ------------------------------------------------
>    * The MID record maps from a MID (Multicast ID), which is a unique identifier
> @@ -12876,7 +12806,6 @@ static const struct mlxsw_reg_info *mlxsw_reg_infos[] = {
>   	MLXSW_REG(spvc),
>   	MLXSW_REG(spevet),
>   	MLXSW_REG(smpe),
> -	MLXSW_REG(sftr2),
>   	MLXSW_REG(smid2),
>   	MLXSW_REG(cwtp),
>   	MLXSW_REG(cwtpm),
> .
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxsw/reg.h b/drivers/net/ethernet/mellanox/mlxsw/reg.h
index d71d7f9a20f1..e188497c1b3e 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/reg.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/reg.h
@@ -2272,22 +2272,6 @@  MLXSW_ITEM_BIT_ARRAY(reg, sftr2, port, 0x20, 0x80, 1);
  */
 MLXSW_ITEM_BIT_ARRAY(reg, sftr2, port_mask, 0xA0, 0x80, 1);
 
-static inline void mlxsw_reg_sftr2_pack(char *payload,
-					unsigned int flood_table,
-					unsigned int index,
-					enum mlxsw_flood_table_type table_type,
-					unsigned int range, u16 port, bool set)
-{
-	MLXSW_REG_ZERO(sftr2, payload);
-	mlxsw_reg_sftr2_swid_set(payload, 0);
-	mlxsw_reg_sftr2_flood_table_set(payload, flood_table);
-	mlxsw_reg_sftr2_index_set(payload, index);
-	mlxsw_reg_sftr2_table_type_set(payload, table_type);
-	mlxsw_reg_sftr2_range_set(payload, range);
-	mlxsw_reg_sftr2_port_set(payload, port, set);
-	mlxsw_reg_sftr2_port_mask_set(payload, port, 1);
-}
-
 /* SMID-V2 - Switch Multicast ID Version 2 Register
  * ------------------------------------------------
  * The MID record maps from a MID (Multicast ID), which is a unique identifier