Re: RFC: Checksum offload and XDP

2017-04-11 Thread David Miller
From: Jakub Kicinski Date: Tue, 11 Apr 2017 11:34:25 -0700 > On Tue, 11 Apr 2017 18:43:47 +0200, Daniel Borkmann wrote: >> cls_bpf has a couple of helpers like bpf_l3_csum_replace(), >> bpf_l4_csum_replace() >> bpf_csum_diff(), bpf_csum_update(), where we (cilium at least) use checksum >> diffs

Re: RFC: Checksum offload and XDP

2017-04-11 Thread Jakub Kicinski
On Tue, 11 Apr 2017 18:13:37 +0100, Edward Cree wrote: > > Note that this only applies to > > checksum_complete, if we were to allow XDP program to return > > checksum_unnecessary for instance then it's more a leap of faith that > > things are always correct. > Speaking of checksum_unnecessary, i

Re: RFC: Checksum offload and XDP

2017-04-11 Thread Jakub Kicinski
On Tue, 11 Apr 2017 18:43:47 +0200, Daniel Borkmann wrote: > cls_bpf has a couple of helpers like bpf_l3_csum_replace(), > bpf_l4_csum_replace() > bpf_csum_diff(), bpf_csum_update(), where we (cilium at least) use checksum > diffs extensively. You can then also leave the option to the user to feed

Re: RFC: Checksum offload and XDP

2017-04-11 Thread Tom Herbert
On Tue, Apr 11, 2017 at 10:13 AM, Edward Cree wrote: > On 11/04/17 17:46, Tom Herbert wrote: >> On Tue, Apr 11, 2017 at 8:55 AM, Edward Cree wrote: >>> The counter-argument, of course, is that if the XDP program edits fields >>> that are protected by an Internet checksum (which in practice usual

Re: RFC: Checksum offload and XDP

2017-04-11 Thread Edward Cree
On 11/04/17 17:46, Tom Herbert wrote: > On Tue, Apr 11, 2017 at 8:55 AM, Edward Cree wrote: >> The counter-argument, of course, is that if the XDP program edits fields >> that are protected by an Internet checksum (which in practice usually >> means anything but the Ethernet header) and then fix

Re: RFC: Checksum offload and XDP

2017-04-11 Thread Tom Herbert
On Tue, Apr 11, 2017 at 8:55 AM, Edward Cree wrote: > On 10/04/17 19:26, Tom Herbert wrote: >> Not having checksum offload in XDP is going to get more painful once >> we start seeing a lot programs doing packet modifications. One nice >> thing we do for ILA router is pre-compute the checksum delta

Re: RFC: Checksum offload and XDP

2017-04-11 Thread Daniel Borkmann
On 04/11/2017 05:55 PM, Edward Cree wrote: On 10/04/17 19:26, Tom Herbert wrote: Not having checksum offload in XDP is going to get more painful once we start seeing a lot programs doing packet modifications. One nice thing we do for ILA router is pre-compute the checksum delta necessary to main

Re: RFC: Checksum offload and XDP

2017-04-11 Thread Edward Cree
On 10/04/17 19:26, Tom Herbert wrote: > Not having checksum offload in XDP is going to get more painful once > we start seeing a lot programs doing packet modifications. One nice > thing we do for ILA router is pre-compute the checksum delta necessary > to maintain checksum neutral property in the