> -----Original Message-----
> From: Wang, Haiyue
> Sent: Tuesday, February 2, 2021 20:57
> To: David Marchand <[email protected]>
> Cc: dev <[email protected]>; [email protected]; Aaron Conole
> <[email protected]>; Zhang, Qi Z
> <[email protected]>; Rong, Leyi <[email protected]>; Tu, Lijuan
> <[email protected]>; dpdk
> stable <[email protected]>; Guo, Jia <[email protected]>; Richardson, Bruce
> <[email protected]>;
> Ananyev, Konstantin <[email protected]>; Jerin Jacob Kollanukkaran
> <[email protected]>;
> Ruifeng Wang (Arm Technology China) <[email protected]>
> Subject: RE: [PATCH v1] net/ixgbe: adjust error for UDP with zero checksum
>
> > -----Original Message-----
> > From: David Marchand <[email protected]>
> > Sent: Tuesday, February 2, 2021 20:54
> > To: Wang, Haiyue <[email protected]>
> > Cc: dev <[email protected]>; [email protected]; Aaron Conole
> > <[email protected]>; Zhang, Qi Z
> > <[email protected]>; Rong, Leyi <[email protected]>; Tu, Lijuan
> > <[email protected]>; dpdk
> > stable <[email protected]>; Guo, Jia <[email protected]>; Richardson, Bruce
> <[email protected]>;
> > Ananyev, Konstantin <[email protected]>; Jerin Jacob
> > Kollanukkaran <[email protected]>;
> > Ruifeng Wang (Arm Technology China) <[email protected]>
> > Subject: Re: [PATCH v1] net/ixgbe: adjust error for UDP with zero checksum
> >
> > On Tue, Feb 2, 2021 at 1:42 PM Wang, Haiyue <[email protected]> wrote:
> > > > If the driver/hw can't report a valid checksum hint, it should
> > > > announce it does not know if the checksum is valid (neither bad, nor
> > > > good).
> > > >
> > > > So the workaround for udp packets (on this hw model) would be to
> > > > report PKT_RX_L4_CKSUM_UNKNOWN.
> > > > The sw application will then have to recompute the checksum itself if
> > > > needed.
> > > >
> > >
> > > Make sense, but not sure the vector path can handle this more easily.
> > > Will try.
> >
> > Refining this a bit.
> > It looks like hw correctly reports "good" checksums, so maybe instead
> > report PKT_RX_L4_CKSUM_UNKNOWN only for reports of "bad" checksums
> > from the hw?
>
> I guess Paolo will complain about the performance drop for zero checksum
> UDP. ;-)
>
Deep into OVS for detail, 'PKT_RX_L4_CKSUM_UNKNOWN' is a graceful way. ;-)
Will work for this target.
/* Validation must be skipped if checksum is 0 on IPv4 packets */
return (udp->udp_csum == 0 && key->dl_type == htons(ETH_TYPE_IP))
|| (validate_checksum ? checksum_valid(key, data, size, l3) : true);
> >
> > --
> > David Marchand