|
47 | 47 | * A. IP checksum related features
|
48 | 48 | *
|
49 | 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, |
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 |
52 | 52 | * to its device.
|
53 | 53 | *
|
54 | 54 | * The checksum related features are:
|
|
63 | 63 | * TCP or UDP packets over IPv4. These are specifically
|
64 | 64 | * unencapsulated packets of the form IPv4|TCP or
|
65 | 65 | * 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. |
67 | 67 | * This feature cannot be set in features for a device
|
68 | 68 | * with NETIF_F_HW_CSUM also set. This feature is being
|
69 | 69 | * DEPRECATED (see below).
|
|
79 | 79 | * DEPRECATED (see below).
|
80 | 80 | *
|
81 | 81 | * 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 |
83 | 83 | * feature for a device. The stack will accept receive
|
84 | 84 | * checksum indication in packets received on a device
|
85 | 85 | * regardless of whether NETIF_F_RXCSUM is set.
|
86 | 86 | *
|
87 | 87 | * 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 | 90 | * CHECKSUM_NONE:
|
91 | 91 | *
|
|
115 | 115 | * the packet minus one that have been verified as CHECKSUM_UNNECESSARY.
|
116 | 116 | * For instance if a device receives an IPv6->UDP->GRE->IPv4->TCP packet
|
117 | 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 to |
| 118 | + * GRE (checksum flag is set) and TCP, skb->csum_level would be set to |
119 | 119 | * 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 |
121 | 121 | * checksum is bad, skb->csum_level would be set to zero (TCP checksum is
|
122 | 122 | * not considered in this case).
|
123 | 123 | *
|
124 | 124 | * CHECKSUM_COMPLETE:
|
125 | 125 | *
|
126 | 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, the |
| 127 | + * packet as seen by netif_rx() and fills in skb->csum. This means the |
128 | 128 | * hardware doesn't need to parse L3/L4 headers to implement this.
|
129 | 129 | *
|
130 | 130 | * Notes:
|
|
153 | 153 | * from skb->csum_start up to the end, and to record/write the checksum at
|
154 | 154 | * offset skb->csum_start + skb->csum_offset. A driver may verify that the
|
155 | 155 | * 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 |
158 | 158 | * purview of the stack to validate that csum_start and csum_offset are set
|
159 | 159 | * correctly.
|
160 | 160 | *
|
|
178 | 178 | *
|
179 | 179 | * CHECKSUM_UNNECESSARY:
|
180 | 180 | *
|
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 |
182 | 182 | * output.
|
183 | 183 | *
|
184 | 184 | * CHECKSUM_COMPLETE:
|
185 | 185 | * 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 | 188 | * D. Non-IP checksum (CRC) offloads
|
189 | 189 | *
|
190 | 190 | * NETIF_F_SCTP_CRC - This feature indicates that a device is capable of
|
191 | 191 | * 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 |
193 | 193 | * CHECKSUM_PARTIAL and set csum_not_inet to 1, to provide an indication in
|
194 | 194 | * the skbuff that the CHECKSUM_PARTIAL refers to CRC32c.
|
195 | 195 | * A driver that supports both IP checksum offload and SCTP CRC32c offload
|
|
200 | 200 | * NETIF_F_FCOE_CRC - This feature indicates that a device is capable of
|
201 | 201 | * offloading the FCOE CRC in a packet. To perform this offload the stack
|
202 | 202 | * 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 |
205 | 205 | * 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 | 208 | * E. Checksumming on output with GSO.
|
209 | 209 | *
|
210 | 210 | * In the case of a GSO packet (skb_is_gso(skb) is true), checksum offload
|
211 | 211 | * is implied by the SKB_GSO_* flags in gso_type. Most obviously, if the
|
212 | 212 | * gso_type is SKB_GSO_TCPV4 or SKB_GSO_TCPV6, TCP checksum offload as
|
213 | 213 | * 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). |
217 | 217 | */
|
218 | 218 |
|
219 | 219 | /* Don't change this without changing skb_csum_unnecessary! */
|
|
0 commit comments