Skip to content

Commit 829448e

Browse files
author
Izabela Bakollari
committed
vmxnet3: correctly report gso type for UDP tunnels
JIRA: https://issues.redhat.com/browse/RHEL-96969 commit 982d30c Author: Ronak Doshi <ronak.doshi@broadcom.com> Date: Fri May 30 15:27:00 2025 +0000 vmxnet3: correctly report gso type for UDP tunnels Commit 3d010c8 ("udp: do not accept non-tunnel GSO skbs landing in a tunnel") added checks in linux stack to not accept non-tunnel GRO packets landing in a tunnel. This exposed an issue in vmxnet3 which was not correctly reporting GRO packets for tunnel packets. This patch fixes this issue by setting correct GSO type for the tunnel packets. Currently, vmxnet3 does not support reporting inner fields for LRO tunnel packets. The issue is not seen for egress drivers that do not use skb inner fields. The workaround is to enable tnl-segmentation offload on the egress interfaces if the driver supports it. This problem pre-exists this patch fix and can be addressed as a separate future patch. Fixes: dacce2b ("vmxnet3: add geneve and vxlan tunnel offload support") Signed-off-by: Ronak Doshi <ronak.doshi@broadcom.com> Acked-by: Guolin Yang <guolin.yang@broadcom.com> Link: https://patch.msgid.link/20250530152701.70354-1-ronak.doshi@broadcom.com [pabeni@redhat.com: dropped the changelog] Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: Izabela Bakollari <ibakolla@redhat.com>
1 parent 720e846 commit 829448e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

drivers/net/vmxnet3/vmxnet3_drv.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1568,6 +1568,30 @@ vmxnet3_get_hdr_len(struct vmxnet3_adapter *adapter, struct sk_buff *skb,
15681568
return (hlen + (hdr.tcp->doff << 2));
15691569
}
15701570

1571+
static void
1572+
vmxnet3_lro_tunnel(struct sk_buff *skb, __be16 ip_proto)
1573+
{
1574+
struct udphdr *uh = NULL;
1575+
1576+
if (ip_proto == htons(ETH_P_IP)) {
1577+
struct iphdr *iph = (struct iphdr *)skb->data;
1578+
1579+
if (iph->protocol == IPPROTO_UDP)
1580+
uh = (struct udphdr *)(iph + 1);
1581+
} else {
1582+
struct ipv6hdr *iph = (struct ipv6hdr *)skb->data;
1583+
1584+
if (iph->nexthdr == IPPROTO_UDP)
1585+
uh = (struct udphdr *)(iph + 1);
1586+
}
1587+
if (uh) {
1588+
if (uh->check)
1589+
skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL_CSUM;
1590+
else
1591+
skb_shinfo(skb)->gso_type |= SKB_GSO_UDP_TUNNEL;
1592+
}
1593+
}
1594+
15711595
static int
15721596
vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
15731597
struct vmxnet3_adapter *adapter, int quota)
@@ -1881,6 +1905,8 @@ vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq,
18811905
if (segCnt != 0 && mss != 0) {
18821906
skb_shinfo(skb)->gso_type = rcd->v4 ?
18831907
SKB_GSO_TCPV4 : SKB_GSO_TCPV6;
1908+
if (encap_lro)
1909+
vmxnet3_lro_tunnel(skb, skb->protocol);
18841910
skb_shinfo(skb)->gso_size = mss;
18851911
skb_shinfo(skb)->gso_segs = segCnt;
18861912
} else if ((segCnt != 0 || skb->len > mtu) && !encap_lro) {

0 commit comments

Comments
 (0)