aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShmulik Ladkani <shmulik.ladkani@gmail.com>2016-05-06 13:27:43 -0400
committerDavid S. Miller <davem@davemloft.net>2016-05-08 23:50:31 -0400
commitc81aa7979432aa10f23656ef6fa113764eab5e5c (patch)
tree3a84798987a1af89d548740219d42ea21a75c966
parentbe0bd3160165e42783d8215f426e41c07179c08a (diff)
Documentation/networking: more accurate LCO explanation
In few places the term "ones-complement sum" was used but the actual meaning is "the complement of the ones-complement sum". Also, avoid enclosing long statements with underscore, to ease readability. Signed-off-by: Shmulik Ladkani <shmulik.ladkani@gmail.com> Acked-by: Edward Cree <ecree@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--Documentation/networking/checksum-offloads.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/Documentation/networking/checksum-offloads.txt b/Documentation/networking/checksum-offloads.txt
index de2a327766a7..56e36861245f 100644
--- a/Documentation/networking/checksum-offloads.txt
+++ b/Documentation/networking/checksum-offloads.txt
@@ -69,18 +69,18 @@ LCO: Local Checksum Offload
69LCO is a technique for efficiently computing the outer checksum of an 69LCO is a technique for efficiently computing the outer checksum of an
70 encapsulated datagram when the inner checksum is due to be offloaded. 70 encapsulated datagram when the inner checksum is due to be offloaded.
71The ones-complement sum of a correctly checksummed TCP or UDP packet is 71The ones-complement sum of a correctly checksummed TCP or UDP packet is
72 equal to the sum of the pseudo header, because everything else gets 72 equal to the complement of the sum of the pseudo header, because everything
73 'cancelled out' by the checksum field. This is because the sum was 73 else gets 'cancelled out' by the checksum field. This is because the sum was
74 complemented before being written to the checksum field. 74 complemented before being written to the checksum field.
75More generally, this holds in any case where the 'IP-style' ones complement 75More generally, this holds in any case where the 'IP-style' ones complement
76 checksum is used, and thus any checksum that TX Checksum Offload supports. 76 checksum is used, and thus any checksum that TX Checksum Offload supports.
77That is, if we have set up TX Checksum Offload with a start/offset pair, we 77That is, if we have set up TX Checksum Offload with a start/offset pair, we
78 know that _after the device has filled in that checksum_, the ones 78 know that after the device has filled in that checksum, the ones
79 complement sum from csum_start to the end of the packet will be equal to 79 complement sum from csum_start to the end of the packet will be equal to
80 _whatever value we put in the checksum field beforehand_. This allows us 80 the complement of whatever value we put in the checksum field beforehand.
81 to compute the outer checksum without looking at the payload: we simply 81 This allows us to compute the outer checksum without looking at the payload:
82 stop summing when we get to csum_start, then add the 16-bit word at 82 we simply stop summing when we get to csum_start, then add the complement of
83 (csum_start + csum_offset). 83 the 16-bit word at (csum_start + csum_offset).
84Then, when the true inner checksum is filled in (either by hardware or by 84Then, when the true inner checksum is filled in (either by hardware or by
85 skb_checksum_help()), the outer checksum will become correct by virtue of 85 skb_checksum_help()), the outer checksum will become correct by virtue of
86 the arithmetic. 86 the arithmetic.