From 3fc3e3e8cfde051cbdcab755c303604136732f0f Mon Sep 17 00:00:00 2001 From: Keming Yang Date: Sat, 24 Oct 2026 09:41:31 +0800 Subject: [PATCH] net: yusur: yk3: match the UDP destination for Geneve offload The Geneve branch in yk3_tunnel_features_check() tests only whether the default Geneve port is registered. Once that entry is present, every UDP-encapsulated skb retains checksum and GSO features, regardless of its destination port. This also bypasses the subsequent VXLAN port lookup. For example, adding a default-port Geneve interface changes the offload decision for VXLAN traffic on an unregistered port. The core then leaves the skb with CHECKSUM_PARTIAL and, for GSO traffic, without software segmentation, even though that port has no corresponding parser entry. Require the packet destination to match the default Geneve port as well as the registered entry. Other UDP destinations continue through the existing VXLAN lookup and unsupported-tunnel software fallback. Keep the restriction to default-port Geneve and leave port programming alone. Validated using the target kernel's netif_skb_features() and validate_xmit_skb_list(), the complete production callbacks and VXLAN lookup, and normal constructed IPv4 UDP tunnel skbs. Of 32 cases per version, the baseline wrongly retains offload in ten cases; the fixed version has no mismatches and preserves the other 22 controls, including registered Geneve and VXLAN. Software-generated TCP checksums are checked. The port table is modeled; this is not physical NIC or firmware testing. Upstream status: downstream-only Fixes: b3fe1bfec4e2 ("net: ethernet: yusur: add YK3 Ethernet driver") Signed-off-by: Keming Yang --- drivers/net/ethernet/yusur/yk3/yk3_ndev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/yusur/yk3/yk3_ndev.c b/drivers/net/ethernet/yusur/yk3/yk3_ndev.c index e1ef57fde689..8cabe6c7b880 100644 --- a/drivers/net/ethernet/yusur/yk3/yk3_ndev.c +++ b/drivers/net/ethernet/yusur/yk3/yk3_ndev.c @@ -757,7 +757,8 @@ static netdev_features_t yk3_tunnel_features_check(struct yk3_ndev_priv *ndev_pr port = be16_to_cpu(udph->dest); /* Support Geneve offload for default UDP port */ - if (ndev_priv->udp_tnl_port->geneve_entry[0].port == YK3_GENEVE_DEFAULT_PORT) + if (port == YK3_GENEVE_DEFAULT_PORT && + ndev_priv->udp_tnl_port->geneve_entry[0].port == port) return features; if (yk3_vxlan_lookup_port(ndev_priv, port)) -- Gitee