[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.21.1905300115590.2934@ja.home.ssi.bg>
Date: Thu, 30 May 2019 01:22:06 +0300 (EEST)
From: Julian Anastasov <ja@....bg>
To: Jacky Hu <hengqing.hu@...il.com>
cc: jacky.hu@...mart.com, jason.niesz@...mart.com,
"David S. Miller" <davem@...emloft.net>,
Alexey Kuznetsov <kuznet@....inr.ac.ru>,
Hideaki YOSHIFUJI <yoshfuji@...ux-ipv6.org>,
Wensong Zhang <wensong@...ux-vs.org>,
Simon Horman <horms@...ge.net.au>,
Pablo Neira Ayuso <pablo@...filter.org>,
Jozsef Kadlecsik <kadlec@...ckhole.kfki.hu>,
Florian Westphal <fw@...len.de>, netdev@...r.kernel.org,
lvs-devel@...r.kernel.org, linux-kernel@...r.kernel.org,
netfilter-devel@...r.kernel.org, coreteam@...filter.org
Subject: Re: [PATCH v3] ipvs: add checksum support for gue encapsulation
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@....bg>
Powered by blists - more mailing lists