[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220208201155.7cc582cf@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Tue, 8 Feb 2022 20:11:55 -0800
From: Jakub Kicinski <kuba@...nel.org>
To: Paul Blakey <paulb@...dia.com>
Cc: <dev@...nvswitch.org>, <netdev@...r.kernel.org>,
Jamal Hadi Salim <jhs@...atatu.com>,
"Pravin B Shelar" <pshelar@....org>, <davem@...emloft.net>,
Eelco Chaudron <echaudro@...hat.com>,
Oz Shlomo <ozsh@...dia.com>, Vlad Buslov <vladbu@...dia.com>,
Roi Dayan <roid@...dia.com>,
Ariel Levkovich <lariel@...dia.com>
Subject: Re: [PATCH net 1/1] openvswitch: Fix setting ipv6 fields causing hw
csum failure
On Mon, 7 Feb 2022 16:41:01 +0200 Paul Blakey wrote:
> Ipv6 ttl, label and tos fields are modified without first
> pulling/pushing the ipv6 header, which would have updated
> the hw csum (if available). This might cause csum validation
> when sending the packet to the stack, as can be seen in
> the trace below.
>
> Fix this by calling postpush/postpull checksum calculation
> which will update the hw csum if needed.
> -static void set_ipv6_fl(struct ipv6hdr *nh, u32 fl, u32 mask)
> +static void set_ipv6_dsfield(struct sk_buff *skb, struct ipv6hdr *nh, __u8 ipv6_tclass, __u8 mask)
> {
> + skb_postpull_rcsum(skb, nh, 4);
> +
> + ipv6_change_dsfield(nh, ~mask, ipv6_tclass);
> +
> + skb_postpush_rcsum(skb, nh, 4);
> +}
The calls seem a little heavy for single byte replacements.
Can you instead add a helper based on csum_replace4() maybe?
BTW doesn't pedit have the same problem?
Powered by blists - more mailing lists