diff mbox series

[v3] net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create()

Message ID 20221110134319.47076-1-yuehaibing@huawei.com (mailing list archive)
State Awaiting Upstream
Delegated to: Netdev Maintainers
Headers show
Series [v3] net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create() | expand

Checks

Context Check Description
netdev/tree_selection success Guessed tree name to be net-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix warning Target tree name not specified in the subject
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/cc_maintainers success CCed 11 of 11 maintainers
netdev/build_clang success Errors and warnings before: 0 this patch: 0
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success Fixes tag looks correct
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/checkpatch warning WARNING: 'allocted' may be misspelled - perhaps 'allocated'?
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0

Commit Message

Yue Haibing Nov. 10, 2022, 1:43 p.m. UTC
'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(-)

Comments

Tariq Toukan Nov. 10, 2022, 3:01 p.m. UTC | #1
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.
Saeed Mahameed Nov. 11, 2022, 10:17 p.m. UTC | #2
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 !
Saeed Mahameed Nov. 11, 2022, 11:33 p.m. UTC | #3
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.
diff mbox series

Patch

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);