Commit 190d4eff authored by Matthew Finlay's avatar Matthew Finlay Committed by Kleber Sacilotto de Souza

net/mlx5e: Copy all L2 headers into inline segment

BugLink: https://bugs.launchpad.net/bugs/1878232

commit e3a19b53 upstream.

ConnectX4-Lx uses an inline wqe mode that currently defaults to
requiring the entire L2 header be included in the wqe.
This patch fixes mlx5e_get_inline_hdr_size() to account for
all L2 headers (VLAN, QinQ, etc) using skb_network_offset(skb).

Fixes: e586b3b0 ("net/mlx5: Ethernet Datapath files")
Signed-off-by: default avatarMatthew Finlay <matt@mellanox.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarIan May <ian.may@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent 68e70b06
...@@ -124,7 +124,7 @@ static inline u16 mlx5e_get_inline_hdr_size(struct mlx5e_sq *sq, ...@@ -124,7 +124,7 @@ static inline u16 mlx5e_get_inline_hdr_size(struct mlx5e_sq *sq,
* headers and occur before the data gather. * headers and occur before the data gather.
* Therefore these headers must be copied into the WQE * Therefore these headers must be copied into the WQE
*/ */
#define MLX5E_MIN_INLINE ETH_HLEN #define MLX5E_MIN_INLINE (ETH_HLEN + VLAN_HLEN)
if (bf) { if (bf) {
u16 ihs = skb_headlen(skb); u16 ihs = skb_headlen(skb);
...@@ -136,7 +136,7 @@ static inline u16 mlx5e_get_inline_hdr_size(struct mlx5e_sq *sq, ...@@ -136,7 +136,7 @@ static inline u16 mlx5e_get_inline_hdr_size(struct mlx5e_sq *sq,
return skb_headlen(skb); return skb_headlen(skb);
} }
return MLX5E_MIN_INLINE; return max(skb_network_offset(skb), MLX5E_MIN_INLINE);
} }
static inline void mlx5e_insert_vlan(void *start, struct sk_buff *skb, u16 ihs) static inline void mlx5e_insert_vlan(void *start, struct sk_buff *skb, u16 ihs)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment