Commit 96c31b5b authored by YueHaibing's avatar YueHaibing Committed by Saeed Mahameed
Browse files

net/mlx5e: Use kzalloc() in mlx5e_accel_fs_tcp_create()



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

Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
parent 4238654c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -365,7 +365,7 @@ void mlx5e_accel_fs_tcp_destroy(struct mlx5e_flow_steering *fs)
	for (i = 0; i < ACCEL_FS_TCP_NUM_TYPES; i++)
		accel_fs_tcp_destroy_table(fs, i);

	kvfree(accel_tcp);
	kfree(accel_tcp);
	mlx5e_fs_set_accel_tcp(fs, NULL);
}

@@ -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);
@@ -397,7 +397,7 @@ int mlx5e_accel_fs_tcp_create(struct mlx5e_flow_steering *fs)
err_destroy_tables:
	while (--i >= 0)
		accel_fs_tcp_destroy_table(fs, i);
	kvfree(accel_tcp);
	kfree(accel_tcp);
	mlx5e_fs_set_accel_tcp(fs, NULL);
	return err;
}