On Tue, 09 Jun 2026 16:44:26 +0200, Paolo Abeni <[email protected]> wrote:
> [...]
> 
> Fixes: 56a06bd40fab ("virtio_net: enable gso over UDP tunnel support.")
> Reported-by: Fiona Ebner <[email protected]>
> Closes: https://bugzilla.proxmox.com/show_bug.cgi?id=7627
> Tested-by: Fiona Ebner <[email protected]>
> Signed-off-by: Paolo Abeni <[email protected]>

Gave it a spin and it works alright, so consider:

>
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index f4adcfee7a80..07b8710639f9 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -6222,6 +6222,18 @@ static void virtnet_free_irq_moder(struct virtnet_info 
> *vi)
>       rtnl_unlock();
>  }
>  
> +static netdev_features_t virtnet_features_check(struct sk_buff *skb,
> +                                             struct net_device *dev,
> +                                             netdev_features_t features)
> +{
> +     /* Inner csum offload is only available for GSO packets. */
> +     if (skb->encapsulation && !skb_is_gso(skb))

A small question -- should we maybe check for skb_gso_ok here as well?
So add:

        (!skb_is_gso(skb) || !skb_gso_ok(skb, features)))

Because skb_is_gso alone doesn't guarantee that the packets leaving virtio will
be gso'd, they could be software gso'd at validate_xmit_skb, which is called
after ndo_feature_check.
leaving the virtio device.

Not sure if this can happen though.

> @@ -6235,7 +6247,7 @@ static const struct net_device_ops virtnet_netdev = {
>       .ndo_bpf                = virtnet_xdp,
>       .ndo_xdp_xmit           = virtnet_xdp_xmit,
>       .ndo_xsk_wakeup         = virtnet_xsk_wakeup,
> -     .ndo_features_check     = passthru_features_check,
> +     .ndo_features_check     = virtnet_features_check,
>       .ndo_get_phys_port_name = virtnet_get_phys_port_name,
>       .ndo_set_features       = virtnet_set_features,
>       .ndo_tx_timeout         = virtnet_tx_timeout,

Thanks,
Gabriel

Tested-by: Gabriel Goller <[email protected]>
So: packet is a GSO packet but will be segmented by validate_xmit_skb before

So: packet is a GSO packet but will be segmented by validate_xmit_skb before

-- 
Gabriel Goller <[email protected]>


Reply via email to