On Thu, Jun 16, 2011 at 1:38 PM, Ben Pfaff <[email protected]> wrote: > On Wed, Jun 15, 2011 at 11:00:09AM -0700, Jesse Gross wrote: >> Older kernels (those before 2.6.22) rely on implicit assumptions >> to determine checksum offloading status. These assumptions tend >> to break down when doing switching because it sits in the middle >> of the transmit and receive path. Newer kernels deal with this >> problem by adding more explicit information about how to checksum. >> This replicates that behavior by mirroring the state from newer >> kernels in private OVS storage on the kernels that lack it. On >> ingress and egress we then map that state onto the appropriate >> location for the given kernel and can consistently manipulate it >> within OVS. Some of this was already done for the checksum type >> but this makes it more robust and expands it to the checksum start >> and offset as well. >> >> Signed-off-by: Jesse Gross <[email protected]> > > I didn't see any problems, but I don't understand this code very well. > I think that it would help my understanding if compute_ip_summed() and > forward_ip_summed() had comments that explained why one would call > them and what they do. compute_ip_summed() does have a large comment > already, but it explains only the details, not the "big picture" > rationale behind what it does.
I added the following comments: /* * compute_ip_summed - map external checksum state onto OVS representation * * @skb: Packet to manipulate. * @xmit: Whether we were on transmit path of network stack. For example, * this is true for the internal dev vport because it receives skbs * that passed through dev_queue_xmit() but false for the netdev vport * because its packets come from netif_receive_skb(). * * Older kernels (and various versions of Xen) were not explicit enough about * checksum offload parameters and rely on a combination of context and * non standard fields. This deals with all those variations so that we * can internally manipulate checksum offloads without worrying about kernel * version. */ /* * forward_ip_summed - map internal checksum state back onto native kernel fields * * @skb: Packet to manipulate. * @xmit: Whether we are about send on the transmit path the network stack. This * follows the same logic as the @xmit field in compute_ip_summed(). * Generally, a given vport will have opposite values for @xmit passed to these * two functions. * * When a packet is about to egress from OVS take our internal fields (including * any modifications we have made) and recreate the correct representation for * this kernel. This may do things like change the transport header offset. */ Does that help? _______________________________________________ dev mailing list [email protected] http://openvswitch.org/mailman/listinfo/dev
