Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ba6c4c09 authored by Saeed Mahameed's avatar Saeed Mahameed Committed by David S. Miller
Browse files

net/mlx5e: Fix inline header size calculation



mlx5e_get_inline_hdr_size didn't take into account the vlan insertion
into the inline WQE segment.
This could lead to max inline violation in cases where
skb_headlen(skb) + VLAN_HLEN >= sq->max_inline.

Fixes: 3ea4891d ("net/mlx5e: Fix LSO vlan insertion")
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarAchiad Shochat <achiad@mellanox.com>
Signed-off-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 340c78e5
Loading
Loading
Loading
Loading
+9 −2
Original line number Original line Diff line number Diff line
@@ -118,8 +118,15 @@ static inline u16 mlx5e_get_inline_hdr_size(struct mlx5e_sq *sq,
	 */
	 */
#define MLX5E_MIN_INLINE ETH_HLEN
#define MLX5E_MIN_INLINE ETH_HLEN


	if (bf && (skb_headlen(skb) <= sq->max_inline))
	if (bf) {
		u16 ihs = skb_headlen(skb);

		if (skb_vlan_tag_present(skb))
			ihs += VLAN_HLEN;

		if (ihs <= sq->max_inline)
			return skb_headlen(skb);
			return skb_headlen(skb);
	}


	return MLX5E_MIN_INLINE;
	return MLX5E_MIN_INLINE;
}
}