🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
3 messages
3 total messages Started by Sang-Heon Jeon Mon, 12 Oct 2026 15:03
[PATCH net-next] net/mlx5: Remove redundant memset after kvzalloc
#2388
Author: Sang-Heon Jeon
Date: Mon, 12 Oct 2026 15:03
43 lines
9548 bytes
kvzalloc() returns zeroed memory, so the memset after the allocation in
mlx5e_post_meter_create_mtu_table() and macsec_fs_tx_create() is
redundant.

So remove the memset.

No functional change.

Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c | 1 -
 drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c    | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c
index d03376d7bb31..fcbd464c5539 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_meter.c
@@ -310,7 +310,6 @@ mlx5e_post_meter_create_mtu_table(struct mlx5e_priv *priv,
 	}
 
 	/* create miss group */
-	memset(flow_group_in, 0, inlen);
 	MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, 1);
 	MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, 1);
 	fg = mlx5_create_flow_group(table->ft, flow_group_in);
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
index efc5167493c1..12af812a1e19 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/lib/macsec_fs.c
@@ -476,7 +476,6 @@ static int macsec_fs_tx_create(struct mlx5_macsec_fs *macsec_fs)
 	tx_tables->ft_check = flow_table;
 
 	/* Tx check table Default miss group/rule */
-	memset(flow_group_in, 0, inlen);
 	MLX5_SET(create_flow_group_in, flow_group_in, start_flow_index, flow_table->max_fte - 1);
 	MLX5_SET(create_flow_group_in, flow_group_in, end_flow_index, flow_table->max_fte - 1);
 	flow_group = mlx5_create_flow_group(tx_tables->ft_check, flow_group_in);

base-commit: d8674294aefef02266c4d47ad10131f1bffbe534
-- 
2.43.0
Re: [PATCH net-next] net/mlx5: Remove redundant memset after kvzalloc
#4578
Author: Simon Horman
Date: Sun, 18 Oct 2026 15:13
18 lines
6073 bytes
On Tue, Oct 13, 2026 at 12:03:10AM +0900, Sang-Heon Jeon wrote:
> kvzalloc() returns zeroed memory, so the memset after the allocation in
> mlx5e_post_meter_create_mtu_table() and macsec_fs_tx_create() is
> redundant.
> 
> So remove the memset.
> 
> No functional change.
> 
> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>

Hi Sang-Heon,

I'm not sure if the value this cleanup brings is worth the churn.
But I do believe it is correct.

Reviewed-by: Simon Horman <horms@kernel.org>
Re: [PATCH net-next] net/mlx5: Remove redundant memset after kvzalloc
#5472
Author: Sang-Heon Jeon
Date: Tue, 20 Oct 2026 11:28
44 lines
13377 bytes
Hi, Simon and Tariq

2026년 10월 20일 (화) 오전 3:44, Tariq Toukan <tariqt@nvidia.com>님이 작성:
>
>
>
> On 18/10/2026 18:13, Simon Horman wrote:
> > On Tue, Oct 13, 2026 at 12:03:10AM +0900, Sang-Heon Jeon wrote:
> >> kvzalloc() returns zeroed memory, so the memset after the allocation in
> >> mlx5e_post_meter_create_mtu_table() and macsec_fs_tx_create() is
> >> redundant.
> >>
> >> So remove the memset.
> >>
> >> No functional change.
> >>
> >> Signed-off-by: Sang-Heon Jeon <ekffu200098@gmail.com>
> >
> > Hi Sang-Heon,
> >
> > I'm not sure if the value this cleanup brings is worth the churn.
>
> Exactly!

Fair enough. I do believe this patch can be helpful to future readers.
But I fully respect the community and other people's resources. So
just let me know if you don't want to see this kind of patch later.
I'll keep that in my mind.

> > But I do believe it is correct.
> >
> > Reviewed-by: Simon Horman <horms@kernel.org>
>
> Anyway,
>
> Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

Thanks for the review :)

Best regards
Sang-Heon Jeon
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads