]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5e: Verify inline header size do not exceed SKB linear size
authorEran Ben Elisha <eranbe@mellanox.com>
Thu, 25 Jan 2018 09:18:09 +0000 (11:18 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 20 Feb 2018 20:52:55 +0000 (12:52 -0800)
commit2c55fb08a5516c8f9deaca1fa2a918d980c18769
tree61fa4492223e318d34a6929bbc94e45a81c761fc
parent28bb0c00920fadb737a4f17e75a226936e937e47
net/mlx5e: Verify inline header size do not exceed SKB linear size

Driver tries to copy at least MLX5E_MIN_INLINE bytes into the control
segment of the WQE. It assumes that the linear part contains at least
MLX5E_MIN_INLINE bytes, which can be wrong.

Cited commit verified that driver will not copy more bytes into the
inline header part that the actual size of the packet. Re-factor this
check to make sure we do not exceed the linear part as well.

This fix is aligned with the current driver's assumption that the entire
L2 will be present in the linear part of the SKB.

Fixes: 9db26806936f ("net/mlx5e: Fix inline header size for small packets")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c