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
47 * A. IP checksum related features47 * A. IP checksum related features
48 *48 *
49 * Drivers advertise checksum offload capabilities in the features of a device.49 * 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,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 offloading51 * A driver typically only advertises features that it is capable of offloading
52 * to its device.52 * to its device.
53 *53 *
54 * The checksum related features are:54 * The checksum related features are:
@@ -63,7 +63,7 @@ · 8 unmodified lines
63 * TCP or UDP packets over IPv4. These are specifically63 * TCP or UDP packets over IPv4. These are specifically
64 * unencapsulated packets of the form IPv4|TCP or64 * unencapsulated packets of the form IPv4|TCP or
65 * IPv4|UDP where the Protocol field in the IPv4 header65 * IPv4|UDP where the Protocol field in the IPv4 header
66 * is TCP or UDP. The IPv4 header may contain IP options66 * is TCP or UDP. The IPv4 header may contain IP options.
67 * This feature cannot be set in features for a device67 * This feature cannot be set in features for a device
68 * with NETIF_F_HW_CSUM also set. This feature is being68 * with NETIF_F_HW_CSUM also set. This feature is being
69 * DEPRECATED (see below).69 * DEPRECATED (see below).
@@ -79,13 +79,13 @@ · 9 unmodified lines
79 * DEPRECATED (see below).79 * DEPRECATED (see below).
80 *80 *
81 * NETIF_F_RXCSUM - Driver (device) performs receive checksum offload.81 * NETIF_F_RXCSUM - Driver (device) performs receive checksum offload.
82 * This flag is used only used to disable the RX checksum82 * This flag is only used to disable the RX checksum
83 * feature for a device. The stack will accept receive83 * feature for a device. The stack will accept receive
84 * checksum indication in packets received on a device84 * checksum indication in packets received on a device
85 * regardless of whether NETIF_F_RXCSUM is set.85 * regardless of whether NETIF_F_RXCSUM is set.
86 *86 *
87 * B. Checksumming of received packets by device. Indication of checksum87 * 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:
89 *89 *
90 * CHECKSUM_NONE:90 * CHECKSUM_NONE:
91 *91 *
@@ -115,16 +115,16 @@ · 23 unmodified lines
115 * the packet minus one that have been verified as CHECKSUM_UNNECESSARY.115 * the packet minus one that have been verified as CHECKSUM_UNNECESSARY.
116 * For instance if a device receives an IPv6->UDP->GRE->IPv4->TCP packet116 * For instance if a device receives an IPv6->UDP->GRE->IPv4->TCP packet
117 * and a device is able to verify the checksums for UDP (possibly zero),117 * 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 to118 * GRE (checksum flag is set) and TCP, skb->csum_level would be set to
119 * two. If the device were only able to verify the UDP checksum and not119 * 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 GRE120 * GRE, either because it doesn't support GRE checksum or because GRE
121 * checksum is bad, skb->csum_level would be set to zero (TCP checksum is121 * checksum is bad, skb->csum_level would be set to zero (TCP checksum is
122 * not considered in this case).122 * not considered in this case).
123 *123 *
124 * CHECKSUM_COMPLETE:124 * CHECKSUM_COMPLETE:
125 *125 *
126 * This is the most generic way. The device supplied checksum of the _whole_126 * 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, the127 * packet as seen by netif_rx() and fills in skb->csum. This means the
128 * hardware doesn't need to parse L3/L4 headers to implement this.128 * hardware doesn't need to parse L3/L4 headers to implement this.
129 *129 *
130 * Notes:130 * Notes:
@@ -153,8 +153,8 @@ · 22 unmodified lines
153 * from skb->csum_start up to the end, and to record/write the checksum at153 * from skb->csum_start up to the end, and to record/write the checksum at
154 * offset skb->csum_start + skb->csum_offset. A driver may verify that the154 * offset skb->csum_start + skb->csum_offset. A driver may verify that the
155 * csum_start and csum_offset values are valid values given the length and155 * 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 the156 * offset of the packet, but it should not attempt to validate that the
157 * checksum refers to a legitimate transport layer checksum-- it is the157 * checksum refers to a legitimate transport layer checksum -- it is the
158 * purview of the stack to validate that csum_start and csum_offset are set158 * purview of the stack to validate that csum_start and csum_offset are set
159 * correctly.159 * correctly.
160 *160 *
@@ -178,18 +178,18 @@ · 17 unmodified lines
178 *178 *
179 * CHECKSUM_UNNECESSARY:179 * CHECKSUM_UNNECESSARY:
180 *180 *
181 * This has the same meaning on as CHECKSUM_NONE for checksum offload on181 * This has the same meaning as CHECKSUM_NONE for checksum offload on
182 * output.182 * output.
183 *183 *
184 * CHECKSUM_COMPLETE:184 * CHECKSUM_COMPLETE:
185 * Not used in checksum output. If a driver observes a packet with this value185 * 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.
187 *187 *
188 * D. Non-IP checksum (CRC) offloads188 * D. Non-IP checksum (CRC) offloads
189 *189 *
190 * NETIF_F_SCTP_CRC - This feature indicates that a device is capable of190 * NETIF_F_SCTP_CRC - This feature indicates that a device is capable of
191 * offloading the SCTP CRC in a packet. To perform this offload the stack191 * 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 to192 * will set csum_start and csum_offset accordingly, set ip_summed to
193 * CHECKSUM_PARTIAL and set csum_not_inet to 1, to provide an indication in193 * CHECKSUM_PARTIAL and set csum_not_inet to 1, to provide an indication in
194 * the skbuff that the CHECKSUM_PARTIAL refers to CRC32c.194 * the skbuff that the CHECKSUM_PARTIAL refers to CRC32c.
195 * A driver that supports both IP checksum offload and SCTP CRC32c offload195 * A driver that supports both IP checksum offload and SCTP CRC32c offload
@@ -200,10 +200,10 @@ · 4 unmodified lines
200 * NETIF_F_FCOE_CRC - This feature indicates that a device is capable of200 * NETIF_F_FCOE_CRC - This feature indicates that a device is capable of
201 * offloading the FCOE CRC in a packet. To perform this offload the stack201 * offloading the FCOE CRC in a packet. To perform this offload the stack
202 * will set ip_summed to CHECKSUM_PARTIAL and set csum_start and csum_offset202 * 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 the203 * accordingly. Note that there is no indication in the skbuff that the
204 * CHECKSUM_PARTIAL refers to an FCOE checksum, a driver that supports204 * CHECKSUM_PARTIAL refers to an FCOE checksum, so a driver that supports
205 * both IP checksum offload and FCOE CRC offload must verify which offload205 * 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.
207 *207 *
208 * E. Checksumming on output with GSO.208 * E. Checksumming on output with GSO.
209 *209 *
@@ -211,9 +211,9 @@ · 1 unmodified line
211 * is implied by the SKB_GSO_* flags in gso_type. Most obviously, if the211 * is implied by the SKB_GSO_* flags in gso_type. Most obviously, if the
212 * gso_type is SKB_GSO_TCPV4 or SKB_GSO_TCPV6, TCP checksum offload as212 * gso_type is SKB_GSO_TCPV4 or SKB_GSO_TCPV6, TCP checksum offload as
213 * part of the GSO operation is implied. If a checksum is being offloaded213 * 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_offset214 * with GSO then ip_summed is CHECKSUM_PARTIAL, and both csum_start and
215 * are set to refer to the outermost checksum being offload (two offloaded215 * csum_offset are set to refer to the outermost checksum being offloaded
216 * checksums are possible with UDP encapsulation).216 * (two offloaded checksums are possible with UDP encapsulation).
217 */217 */
218 218
219/* Don't change this without changing skb_csum_unnecessary! */219/* Don't change this without changing skb_csum_unnecessary! */