All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create()
@ 2022-11-10 13:43 YueHaibing
  2022-11-10 15:01 ` Tariq Toukan
  0 siblings, 1 reply; 4+ messages in thread
From: YueHaibing @ 2022-11-10 13:43 UTC (permalink / raw)
  To: borisp, saeedm, leon, davem, edumazet, kuba, pabeni, lkayal,
	tariqt, ttoukan.linux
  Cc: netdev, linux-rdma, linux-kernel, YueHaibing

'accel_tcp' is allocted by kvzalloc() now, which is a small chunk.
Use kzalloc() directly instead of kvzalloc(), fix the mismatch free.

Fixes: f52f2faee581 ("net/mlx5e: Introduce flow steering API")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
v3: use kzalloc() instead of kvzalloc()
v2: fix the same issue in mlx5e_accel_fs_tcp_destroy() and a commit log typo
---
 drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
index 285d32d2fd08..88a5aed9d678 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
@@ -377,7 +377,7 @@ int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs)
 	if (!MLX5_CAP_FLOWTABLE_NIC_RX(mlx5e_fs_get_mdev(fs), ft_field_support.outer_ip_version))
 		return -EOPNOTSUPP;
 
-	accel_tcp = kvzalloc(sizeof(*accel_tcp), GFP_KERNEL);
+	accel_tcp = kzalloc(sizeof(*accel_tcp), GFP_KERNEL);
 	if (!accel_tcp)
 		return -ENOMEM;
 	mlx5e_fs_set_accel_tcp(fs, accel_tcp);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create()
  2022-11-10 13:43 [PATCH v3] net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create() YueHaibing
@ 2022-11-10 15:01 ` Tariq Toukan
  2022-11-11 22:17   ` Saeed Mahameed
  0 siblings, 1 reply; 4+ messages in thread
From: Tariq Toukan @ 2022-11-10 15:01 UTC (permalink / raw)
  To: YueHaibing, borisp, saeedm, leon, davem, edumazet, kuba, pabeni,
	lkayal, tariqt
  Cc: netdev, linux-rdma, linux-kernel



On 11/10/2022 3:43 PM, YueHaibing wrote:
> 'accel_tcp' is allocted by kvzalloc() now, which is a small chunk.
> Use kzalloc() directly instead of kvzalloc(), fix the mismatch free.
> 
> Fixes: f52f2faee581 ("net/mlx5e: Introduce flow steering API")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
> v3: use kzalloc() instead of kvzalloc()
> v2: fix the same issue in mlx5e_accel_fs_tcp_destroy() and a commit log typo
> ---
>   drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
> index 285d32d2fd08..88a5aed9d678 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
> @@ -377,7 +377,7 @@ int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs)
>   	if (!MLX5_CAP_FLOWTABLE_NIC_RX(mlx5e_fs_get_mdev(fs), ft_field_support.outer_ip_version))
>   		return -EOPNOTSUPP;
>   
> -	accel_tcp = kvzalloc(sizeof(*accel_tcp), GFP_KERNEL);
> +	accel_tcp = kzalloc(sizeof(*accel_tcp), GFP_KERNEL);
>   	if (!accel_tcp)
>   		return -ENOMEM;
>   	mlx5e_fs_set_accel_tcp(fs, accel_tcp);

Reviewed-by: Tariq Toukan <tariqt@nvidia.com>

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create()
  2022-11-10 15:01 ` Tariq Toukan
@ 2022-11-11 22:17   ` Saeed Mahameed
  2022-11-11 23:33     ` Saeed Mahameed
  0 siblings, 1 reply; 4+ messages in thread
From: Saeed Mahameed @ 2022-11-11 22:17 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: YueHaibing, borisp, saeedm, leon, davem, edumazet, kuba, pabeni,
	lkayal, tariqt, netdev, linux-rdma, linux-kernel

On 10 Nov 17:01, Tariq Toukan wrote:
>
>
>On 11/10/2022 3:43 PM, YueHaibing wrote:
>>'accel_tcp' is allocted by kvzalloc() now, which is a small chunk.
>>Use kzalloc() directly instead of kvzalloc(), fix the mismatch free.
>>
>>Fixes: f52f2faee581 ("net/mlx5e: Introduce flow steering API")
>>Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>>---
>>v3: use kzalloc() instead of kvzalloc()
>>v2: fix the same issue in mlx5e_accel_fs_tcp_destroy() and a commit log typo
>>---
>>  drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
>>index 285d32d2fd08..88a5aed9d678 100644
>>--- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
>>+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/fs_tcp.c
>>@@ -377,7 +377,7 @@ int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs)
>>  	if (!MLX5_CAP_FLOWTABLE_NIC_RX(mlx5e_fs_get_mdev(fs), ft_field_support.outer_ip_version))
>>  		return -EOPNOTSUPP;
>>-	accel_tcp = kvzalloc(sizeof(*accel_tcp), GFP_KERNEL);
>>+	accel_tcp = kzalloc(sizeof(*accel_tcp), GFP_KERNEL);
>>  	if (!accel_tcp)
>>  		return -ENOMEM;
>>  	mlx5e_fs_set_accel_tcp(fs, accel_tcp);
>
>Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
>
>Thanks.

applied to net-next-mlx5, Thanks !

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create()
  2022-11-11 22:17   ` Saeed Mahameed
@ 2022-11-11 23:33     ` Saeed Mahameed
  0 siblings, 0 replies; 4+ messages in thread
From: Saeed Mahameed @ 2022-11-11 23:33 UTC (permalink / raw)
  To: Tariq Toukan
  Cc: YueHaibing, borisp, saeedm, leon, davem, edumazet, kuba, pabeni,
	lkayal, tariqt, netdev, linux-rdma, linux-kernel

On 11 Nov 14:17, Saeed Mahameed wrote:
>On 10 Nov 17:01, Tariq Toukan wrote:
>>
>>
>>On 11/10/2022 3:43 PM, YueHaibing wrote:
>>>'accel_tcp' is allocted by kvzalloc() now, which is a small chunk.
            typo: ^allocated

I will fix this prior to submission to net-next.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-11 23:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10 13:43 [PATCH v3] net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create() YueHaibing
2022-11-10 15:01 ` Tariq Toukan
2022-11-11 22:17   ` Saeed Mahameed
2022-11-11 23:33     ` Saeed Mahameed

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.