History

skbuff.h: Improve the checksum related comments

Fixed the punctuation and some typos. Improved some sentences with minor changes. No change of semantics or code.

Dexuan Cui committed 6 years ago

Commit db1f00f1 parent afa3b591 file · +19 −19Browse files

Unified · Split

include/linux/skbuff.h+19−19
@@ -47,8 +47,8 @@ · 46 unmodified lines
4747 * A. IP checksum related features
4848 *
4949 * Drivers advertise checksum offload capabilities in the features of a device.
50− * From the stack's point of view these are capabilities offered by the driver,
51− * a driver typically only advertises features that it is capable of offloading
50+ * From the stack's point of view these are capabilities offered by the driver.
51+ * A driver typically only advertises features that it is capable of offloading
5252 * to its device.
5353 *
5454 * The checksum related features are:
@@ -63,7 +63,7 @@ · 8 unmodified lines
6363 * TCP or UDP packets over IPv4. These are specifically
6464 * unencapsulated packets of the form IPv4|TCP or
6565 * IPv4|UDP where the Protocol field in the IPv4 header
66− * is TCP or UDP. The IPv4 header may contain IP options
66+ * is TCP or UDP. The IPv4 header may contain IP options.
6767 * This feature cannot be set in features for a device
6868 * with NETIF_F_HW_CSUM also set. This feature is being
6969 * DEPRECATED (see below).
@@ -79,13 +79,13 @@ · 9 unmodified lines
7979 * DEPRECATED (see below).
8080 *
8181 * NETIF_F_RXCSUM - Driver (device) performs receive checksum offload.
82− * This flag is used only used to disable the RX checksum
82+ * This flag is only used to disable the RX checksum
8383 * feature for a device. The stack will accept receive
8484 * checksum indication in packets received on a device
8585 * regardless of whether NETIF_F_RXCSUM is set.
8686 *
8787 * B. Checksumming of received packets by device. Indication of checksum
88− * verification is in set skb->ip_summed. Possible values are:
88+ * verification is set in skb->ip_summed. Possible values are:
8989 *
9090 * CHECKSUM_NONE:
9191 *
@@ -115,16 +115,16 @@ · 23 unmodified lines
115115 * the packet minus one that have been verified as CHECKSUM_UNNECESSARY.
116116 * For instance if a device receives an IPv6->UDP->GRE->IPv4->TCP packet
117117 * and a device is able to verify the checksums for UDP (possibly zero),
118− * GRE (checksum flag is set), and TCP-- skb->csum_level would be set to
118+ * GRE (checksum flag is set) and TCP, skb->csum_level would be set to
119119 * two. If the device were only able to verify the UDP checksum and not
120− * GRE, either because it doesn't support GRE checksum of because GRE
120+ * GRE, either because it doesn't support GRE checksum or because GRE
121121 * checksum is bad, skb->csum_level would be set to zero (TCP checksum is
122122 * not considered in this case).
123123 *
124124 * CHECKSUM_COMPLETE:
125125 *
126126 * This is the most generic way. The device supplied checksum of the _whole_
127− * packet as seen by netif_rx() and fills out in skb->csum. Meaning, the
127+ * packet as seen by netif_rx() and fills in skb->csum. This means the
128128 * hardware doesn't need to parse L3/L4 headers to implement this.
129129 *
130130 * Notes:
@@ -153,8 +153,8 @@ · 22 unmodified lines
153153 * from skb->csum_start up to the end, and to record/write the checksum at
154154 * offset skb->csum_start + skb->csum_offset. A driver may verify that the
155155 * csum_start and csum_offset values are valid values given the length and
156− * offset of the packet, however they should not attempt to validate that the
157− * checksum refers to a legitimate transport layer checksum-- it is the
156+ * offset of the packet, but it should not attempt to validate that the
157+ * checksum refers to a legitimate transport layer checksum -- it is the
158158 * purview of the stack to validate that csum_start and csum_offset are set
159159 * correctly.
160160 *
@@ -178,18 +178,18 @@ · 17 unmodified lines
178178 *
179179 * CHECKSUM_UNNECESSARY:
180180 *
181− * This has the same meaning on as CHECKSUM_NONE for checksum offload on
181+ * This has the same meaning as CHECKSUM_NONE for checksum offload on
182182 * output.
183183 *
184184 * CHECKSUM_COMPLETE:
185185 * Not used in checksum output. If a driver observes a packet with this value
186− * set in skbuff, if should treat as CHECKSUM_NONE being set.
186+ * set in skbuff, it should treat the packet as if CHECKSUM_NONE were set.
187187 *
188188 * D. Non-IP checksum (CRC) offloads
189189 *
190190 * NETIF_F_SCTP_CRC - This feature indicates that a device is capable of
191191 * offloading the SCTP CRC in a packet. To perform this offload the stack
192− * will set set csum_start and csum_offset accordingly, set ip_summed to
192+ * will set csum_start and csum_offset accordingly, set ip_summed to
193193 * CHECKSUM_PARTIAL and set csum_not_inet to 1, to provide an indication in
194194 * the skbuff that the CHECKSUM_PARTIAL refers to CRC32c.
195195 * A driver that supports both IP checksum offload and SCTP CRC32c offload
@@ -200,10 +200,10 @@ · 4 unmodified lines
200200 * NETIF_F_FCOE_CRC - This feature indicates that a device is capable of
201201 * offloading the FCOE CRC in a packet. To perform this offload the stack
202202 * will set ip_summed to CHECKSUM_PARTIAL and set csum_start and csum_offset
203− * accordingly. Note the there is no indication in the skbuff that the
204− * CHECKSUM_PARTIAL refers to an FCOE checksum, a driver that supports
203+ * accordingly. Note that there is no indication in the skbuff that the
204+ * CHECKSUM_PARTIAL refers to an FCOE checksum, so a driver that supports
205205 * both IP checksum offload and FCOE CRC offload must verify which offload
206− * is configured for a packet presumably by inspecting packet headers.
206+ * is configured for a packet, presumably by inspecting packet headers.
207207 *
208208 * E. Checksumming on output with GSO.
209209 *
@@ -211,9 +211,9 @@ · 1 unmodified line
211211 * is implied by the SKB_GSO_* flags in gso_type. Most obviously, if the
212212 * gso_type is SKB_GSO_TCPV4 or SKB_GSO_TCPV6, TCP checksum offload as
213213 * part of the GSO operation is implied. If a checksum is being offloaded
214− * with GSO then ip_summed is CHECKSUM_PARTIAL, csum_start and csum_offset
215− * are set to refer to the outermost checksum being offload (two offloaded
216− * checksums are possible with UDP encapsulation).
214+ * with GSO then ip_summed is CHECKSUM_PARTIAL, and both csum_start and
215+ * csum_offset are set to refer to the outermost checksum being offloaded
216+ * (two offloaded checksums are possible with UDP encapsulation).
217217 */
218218
219219 /* Don't change this without changing skb_csum_unnecessary! */