LVS
lvs-devel
Google
 
Web LinuxVirtualServer.org

Re: [PATCH v3] ipvs: add checksum support for gue encapsulation

To: Jacky Hu <hengqing.hu@xxxxxxxxx>
Subject: Re: [PATCH v3] ipvs: add checksum support for gue encapsulation
Cc: jacky.hu@xxxxxxxxxxx, jason.niesz@xxxxxxxxxxx, "David S. Miller" <davem@xxxxxxxxxxxxx>, Alexey Kuznetsov <kuznet@xxxxxxxxxxxxx>, Hideaki YOSHIFUJI <yoshfuji@xxxxxxxxxxxxxx>, Wensong Zhang <wensong@xxxxxxxxxxxx>, Simon Horman <horms@xxxxxxxxxxxx>, Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx>, Jozsef Kadlecsik <kadlec@xxxxxxxxxxxxxxxxx>, Florian Westphal <fw@xxxxxxxxx>, netdev@xxxxxxxxxxxxxxx, lvs-devel@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, netfilter-devel@xxxxxxxxxxxxxxx, coreteam@xxxxxxxxxxxxx
From: Julian Anastasov <ja@xxxxxx>
Date: Thu, 30 May 2019 01:22:06 +0300 (EEST)
        Hello,

On Wed, 29 May 2019, Jacky Hu wrote:

>       gueh = (struct guehdr *)skb->data;
>  
>       gueh->control = 0;
>       gueh->version = 0;
> -     gueh->hlen = 0;
> +     gueh->hlen = optlen >> 2;
>       gueh->flags = 0;
>       gueh->proto_ctype = *next_protocol;
>  
> +     data = &gueh[1];
> +
> +     if (need_priv) {
> +             __be32 *flags = data;
> +             u16 csum_start = skb_checksum_start_offset(skb);
> +             __be16 *pd = data;

        Packet tests show another problem. Fix is to defer
pd assignment after data += GUE_LEN_PRIV:

                __be16 *pd;

> +
> +             gueh->flags |= GUE_FLAG_PRIV;
> +             *flags = 0;
> +             data += GUE_LEN_PRIV;
> +
> +             if (csum_start < hdrlen)
> +                     return -EINVAL;
> +
> +             csum_start -= hdrlen;

                pd = data;

> +             pd[0] = htons(csum_start);
> +             pd[1] = htons(csum_start + skb->csum_offset);
> +
> +             if (!skb_is_gso(skb)) {
> +                     skb->ip_summed = CHECKSUM_NONE;
> +                     skb->encapsulation = 0;
> +             }
> +
> +             *flags |= GUE_PFLAG_REMCSUM;
> +             data += GUE_PLEN_REMCSUM;
> +     }
> +

Regards

--
Julian Anastasov <ja@xxxxxx>

<Prev in Thread] Current Thread [Next in Thread>