mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-23 14:13:49 +07:00
net/mlx5: Use exact encap header size for the FW input buffer
The current code is allocating the max encap size supported by the firmware and not the size requested by the caller, fix that. Also, spare a warning when the size of the encapsulation headers is bigger from what is supported by the firmware. Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com> Reviewed-by: Hadar Hen Zion <hadarh@mellanox.com> Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
This commit is contained in:
parent
4548b683b7
commit
073ff3c8e6
@ -473,10 +473,13 @@ int mlx5_encap_alloc(struct mlx5_core_dev *dev,
|
|||||||
int err;
|
int err;
|
||||||
u32 *in;
|
u32 *in;
|
||||||
|
|
||||||
if (size > MLX5_CAP_ESW(dev, max_encap_header_size))
|
if (size > max_encap_size) {
|
||||||
|
mlx5_core_warn(dev, "encap size %zd too big, max supported is %d\n",
|
||||||
|
size, max_encap_size);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
in = kzalloc(MLX5_ST_SZ_BYTES(alloc_encap_header_in) + max_encap_size,
|
in = kzalloc(MLX5_ST_SZ_BYTES(alloc_encap_header_in) + size,
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (!in)
|
if (!in)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
Loading…
Reference in New Issue
Block a user