[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6dad3593d88d4afcae331b1225888884@AcuMS.aculab.com>
Date: Sun, 20 Feb 2022 18:38:32 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Paul Blakey' <paulb@...dia.com>,
"dev@...nvswitch.org" <dev@...nvswitch.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Jamal Hadi Salim <jhs@...atatu.com>,
Pravin B Shelar <pshelar@....org>,
"davem@...emloft.net" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>,
Eelco Chaudron <echaudro@...hat.com>
CC: Oz Shlomo <ozsh@...dia.com>, Vlad Buslov <vladbu@...dia.com>,
Roi Dayan <roid@...dia.com>,
Ariel Levkovich <lariel@...dia.com>
Subject: RE: [PATCH net v4 1/1] openvswitch: Fix setting ipv6 fields causing
hw csum failure
From: Paul Blakey
> Sent: 20 February 2022 13:21
>
> 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 updating skb->csum if available.
...
> +static inline __wsum
> +csum_block_replace(__wsum csum, __wsum old, __wsum new, int offset)
> +{
> + return csum_block_add(csum_block_sub(csum, old, offset), new, offset);
> +}
That look computationally OTT for sub 32bit adjustments.
It ought to be enough to do:
return csum_add(old_csum, 0xf0000fff + new - old);
Although it will need 'tweaking' for odd aligned 24bit values.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists