mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-29 22:02:02 +00:00
net/mlx5e: Fix UDP GSO for encapsulated packets
[ Upstream commit83fea49f27
] When the skb is encapsulated, adjust the inner UDP header instead of the outer one, and account for UDP header (instead of TCP) in the inline header size calculation. Fixes:689adf0d48
("net/mlx5e: Add UDP GSO support") Reported-by: Jason Baron <jbaron@akamai.com> Closes: https://lore.kernel.org/netdev/c42961cb-50b9-4a9a-bd43-87fe48d88d29@akamai.com/ Signed-off-by: Gal Pressman <gal@nvidia.com> Reviewed-by: Dragos Tatulea <dtatulea@nvidia.com> Reviewed-by: Boris Pismenny <borisp@nvidia.com> Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
634e0e9f82
commit
e481b93803
2 changed files with 12 additions and 2 deletions
|
@ -102,8 +102,14 @@ static inline void
|
|||
mlx5e_udp_gso_handle_tx_skb(struct sk_buff *skb)
|
||||
{
|
||||
int payload_len = skb_shinfo(skb)->gso_size + sizeof(struct udphdr);
|
||||
struct udphdr *udphdr;
|
||||
|
||||
udp_hdr(skb)->len = htons(payload_len);
|
||||
if (skb->encapsulation)
|
||||
udphdr = (struct udphdr *)skb_inner_transport_header(skb);
|
||||
else
|
||||
udphdr = udp_hdr(skb);
|
||||
|
||||
udphdr->len = htons(payload_len);
|
||||
}
|
||||
|
||||
struct mlx5e_accel_tx_state {
|
||||
|
|
|
@ -153,7 +153,11 @@ mlx5e_tx_get_gso_ihs(struct mlx5e_txqsq *sq, struct sk_buff *skb, int *hopbyhop)
|
|||
|
||||
*hopbyhop = 0;
|
||||
if (skb->encapsulation) {
|
||||
ihs = skb_inner_tcp_all_headers(skb);
|
||||
if (skb_shinfo(skb)->gso_type & SKB_GSO_UDP_L4)
|
||||
ihs = skb_inner_transport_offset(skb) +
|
||||
sizeof(struct udphdr);
|
||||
else
|
||||
ihs = skb_inner_tcp_all_headers(skb);
|
||||
stats->tso_inner_packets++;
|
||||
stats->tso_inner_bytes += skb->len - ihs;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue