> -----Original Message----- > From: Maxim Uvarov [mailto:[email protected]] > Sent: Wednesday, March 29, 2017 4:16 PM > To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolainen@nokia-bell- > labs.com> > Cc: lng-odp-forward <[email protected]> > Subject: Re: [lng-odp] [API-NEXT PATCH] api: packet: add per packet > checksum control > > On 03/29/17 13:10, Savolainen, Petri (Nokia - FI/Espoo) wrote: > > > > > > From: Maxim Uvarov [mailto:[email protected]] > > Sent: Wednesday, March 29, 2017 10:26 AM > > To: Savolainen, Petri (Nokia - FI/Espoo) <petri.savolainen@nokia-bell- > labs.com> > > Cc: Bill Fischofer <[email protected]>; lng-odp-forward <lng- > [email protected]> > > Subject: Re: [lng-odp] [API-NEXT PATCH] api: packet: add per packet > checksum control > > > > I have few questions for better understanding of usage: > > > > if check sum is 0 it will be updated or left as zero. > > if check sum is some wrong value (i.e. packet was modified), what is > expected? > > if check sum is valid and this feature supported only in software, what > is expected? > > Maxim. > > > > > > Current value of the checksum field does not matter. This API (and the > per interface config option) controls only checksum insertion. When > enabled, ODP (HW) calculates checksum (before sending packet out of the > interface) and overwrites the checksum field with the new value. When > disabled, ODP does not overwrite the field. > > > > -Petri > > > > I asked about that because of naming is a little bit confusing. How > about define it as: > > void odp_packet_out_l2_csum_update(odp_packet_t pkt, odp_bool_t enable); > void odp_packet_out_l3_csum_update(odp_packet_t pkt, odp_bool_t enable); > > Maxim.
Checksum update to me is: udp.chksum++; ... and insert is: udp.chksum = udp_chksum(pkt); -Petri
