fsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget%/translations/zh_CN/networking/skbuffmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/zh_TW/networking/skbuffmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/it_IT/networking/skbuffmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/ja_JP/networking/skbuffmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/ko_KR/networking/skbuffmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/sp_SP/networking/skbuffmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhh?/var/lib/git/docbuild/linux/Documentation/networking/skbuff.rsthKubhsection)}(hhh](htitle)}(hstruct sk_buffh]hstruct sk_buff}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hI:c:type:`sk_buff` is the main networking structure representing a packet.h](h)}(h:c:type:`sk_buff`h]hliteral)}(hhh]hsk_buff}(hhhhhNhNubah}(h]h ](xrefcc-typeeh"]h$]h&]uh1hhhubah}(h]h ]h"]h$]h&]refdocnetworking/skbuff refdomainhreftypetype refexplicitrefwarn reftargetsk_buffuh1hhhhKhhubh8 is the main networking structure representing a packet.}(hhhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hhh](h)}(hBasic sk_buff geometryh]hBasic sk_buff geometry}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhK ubh)}(h|struct sk_buff itself is a metadata structure and does not hold any packet data. All the data is held in associated buffers.h]h|struct sk_buff itself is a metadata structure and does not hold any packet data. All the data is held in associated buffers.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhhhhubh)}(hm:c:type:`sk_buff.head ` points to the main "head" buffer. The head buffer is divided into two parts:h](h)}(h :c:type:`sk_buff.head `h]h)}(hj$h]h sk_buff.head}(hj&hhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhj"ubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhjubhQ points to the main “head” buffer. The head buffer is divided into two parts:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjAhMhhhhubh block_quote)}(hX- data buffer, containing headers and sometimes payload; this is the part of the skb operated on by the common helpers such as skb_put() or skb_pull(); - shared info (struct skb_shared_info) which holds an array of pointers to read-only data in the (page, offset, length) format. h]h bullet_list)}(hhh](h list_item)}(hdata buffer, containing headers and sometimes payload; this is the part of the skb operated on by the common helpers such as skb_put() or skb_pull();h]h)}(hdata buffer, containing headers and sometimes payload; this is the part of the skb operated on by the common helpers such as skb_put() or skb_pull();h]hdata buffer, containing headers and sometimes payload; this is the part of the skb operated on by the common helpers such as skb_put() or skb_pull();}(hj]hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhjYubah}(h]h ]h"]h$]h&]uh1jWhjTubjX)}(h~shared info (struct skb_shared_info) which holds an array of pointers to read-only data in the (page, offset, length) format. h]h)}(h}shared info (struct skb_shared_info) which holds an array of pointers to read-only data in the (page, offset, length) format.h]h}shared info (struct skb_shared_info) which holds an array of pointers to read-only data in the (page, offset, length) format.}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhjrubah}(h]h ]h"]h$]h&]uh1jWhjTubeh}(h]h ]h"]h$]h&]bullet-uh1jRhjkhMhjNubah}(h]h ]h"]h$]h&]uh1jLhjkhMhhhhubh)}(hZOptionally :c:type:`skb_shared_info.frag_list ` may point to another skb.h](h Optionally }(hjhhhNhNubh)}(h5:c:type:`skb_shared_info.frag_list `h]h)}(hjh]hskb_shared_info.frag_list}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhskb_shared_infouh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhjubh may point to another skb.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhMhhhhubh)}(h"Basic diagram may look like this::h]h!Basic diagram may look like this:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhhhhubh literal_block)}(hXB --------------- | sk_buff | --------------- ,--------------------------- + head / ,----------------- + data / / ,----------- + tail | | | , + end | | | | v v v v ----------------------------------------------- | headroom | data | tailroom | skb_shared_info | ----------------------------------------------- + [page frag] + [page frag] + [page frag] + [page frag] --------- + frag_list --> | sk_buff | ---------h]hXB --------------- | sk_buff | --------------- ,--------------------------- + head / ,----------------- + data / / ,----------- + tail | | | , + end | | | | v v v v ----------------------------------------------- | headroom | data | tailroom | skb_shared_info | ----------------------------------------------- + [page frag] + [page frag] + [page frag] + [page frag] --------- + frag_list --> | sk_buff | ---------}hjsbah}(h]h ]h"]h$]h&]hhuh1jhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhhhhubeh}(h]basic-sk-buff-geometryah ]h"]basic sk_buff geometryah$]h&]uh1hhhhhhhhK ubh)}(hhh](h)}(hShared skbs and skb clonesh]hShared skbs and skb clones}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhKubh)}(h:c:member:`sk_buff.users` is a simple refcount allowing multiple entities to keep a struct sk_buff alive. skbs with a ``sk_buff.users != 1`` are referred to as shared skbs (see skb_shared()).h](h)}(h:c:member:`sk_buff.users`h]h)}(hj h]h sk_buff.users}(hj hhhNhNubah}(h]h ](hhc-membereh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypemember refexplicitrefwarnh sk_buff.usersuh1hhhhKhjubh] is a simple refcount allowing multiple entities to keep a struct sk_buff alive. skbs with a }(hjhhhNhNubh)}(h``sk_buff.users != 1``h]hsk_buff.users != 1}(hj+hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh3 are referred to as shared skbs (see skb_shared()).}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhjhhubh)}(hskb_clone() allows for fast duplication of skbs. None of the data buffers get copied, but caller gets a new metadata struct (struct sk_buff). &skb_shared_info.refcount indicates the number of skbs pointing at the same packet data (i.e. clones).h]hskb_clone() allows for fast duplication of skbs. None of the data buffers get copied, but caller gets a new metadata struct (struct sk_buff). &skb_shared_info.refcount indicates the number of skbs pointing at the same packet data (i.e. clones).}(hjChhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhjhhubeh}(h]shared-skbs-and-skb-clonesah ]h"]shared skbs and skb clonesah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hdataref and headerless skbsh]hdataref and headerless skbs}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjYhhhhhKubh)}(hXTransport layers send out clones of payload skbs they hold for retransmissions. To allow lower layers of the stack to prepend their headers we split :c:type:`skb_shared_info.dataref ` into two halves. The lower 16 bits count the overall number of references. The higher 16 bits indicate how many of the references are payload-only. skb_header_cloned() checks if skb is allowed to add / write the headers.h](hTransport layers send out clones of payload skbs they hold for retransmissions. To allow lower layers of the stack to prepend their headers we split }(hjjhhhNhNubh)}(h3:c:type:`skb_shared_info.dataref `h]h)}(hjth]hskb_shared_info.dataref}(hjvhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjrubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhskb_shared_infouh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:30: ./include/linux/skbuff.hhM|hjjubh into two halves. The lower 16 bits count the overall number of references. The higher 16 bits indicate how many of the references are payload-only. skb_header_cloned() checks if skb is allowed to add / write the headers.}(hjjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhM|hjYhhubh)}(hXoThe creator of the skb (e.g. TCP) marks its skb as :c:type:`sk_buff.nohdr ` (via __skb_header_release()). Any clone created from marked skb will get :c:type:`sk_buff.hdr_len ` populated with the available headroom. If there's the only clone in existence it's able to modify the headroom at will. The sequence of calls inside the transport layer is::h](h3The creator of the skb (e.g. TCP) marks its skb as }(hjhhhNhNubh)}(h!:c:type:`sk_buff.nohdr `h]h)}(hjh]h sk_buff.nohdr}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:30: ./include/linux/skbuff.hhMhjubhJ (via __skb_header_release()). Any clone created from marked skb will get }(hjhhhNhNubh)}(h#:c:type:`sk_buff.hdr_len `h]h)}(hjh]hsk_buff.hdr_len}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhjhMhjubh populated with the available headroom. If there’s the only clone in existence it’s able to modify the headroom at will. The sequence of calls inside the transport layer is:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhMhjYhhubj)}(h] skb_reserve() __skb_header_release() skb_clone() // send the clone down the stackh]h] skb_reserve() __skb_header_release() skb_clone() // send the clone down the stack}hjsbah}(h]h ]h"]h$]h&]hhuh1jhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:30: ./include/linux/skbuff.hhMhjYhhubh)}(hX$This is not a very generic construct and it depends on the transport layers doing the right thing. In practice there's usually only one payload-only skb. Having multiple payload-only skbs with different lengths of hdr_len is not possible. The payload-only skbs should never leave their owner.h]hX&This is not a very generic construct and it depends on the transport layers doing the right thing. In practice there’s usually only one payload-only skb. Having multiple payload-only skbs with different lengths of hdr_len is not possible. The payload-only skbs should never leave their owner.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:30: ./include/linux/skbuff.hhMhjYhhubeh}(h]dataref-and-headerless-skbsah ]h"]dataref and headerless skbsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hChecksum informationh]hChecksum information}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhhhhhK"ubh)}(h\The interface for checksum offload between the stack and networking drivers is as follows...h]h\The interface for checksum offload between the stack and networking drivers is as follows...}(hj(hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK,hjhhubh)}(hhh](h)}(hIP checksum related featuresh]hIP checksum related features}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj7hNhNubh)}(hDrivers advertise checksum offload capabilities in the features of a device. From the stack's point of view these are capabilities offered by the driver. A driver typically only advertises features that it is capable of offloading to its device.h]hDrivers advertise checksum offload capabilities in the features of a device. From the stack’s point of view these are capabilities offered by the driver. A driver typically only advertises features that it is capable of offloading to its device.}(hjHhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK2hj7ubhtable)}(hhh](h)}(h Checksum related device featuresh]h Checksum related device features}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK7hjYubhtgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jphjmubjq)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jphjmubhtbody)}(hhh](hrow)}(hhh](hentry)}(hhh]h)}(h``NETIF_F_HW_CSUM``h]h)}(hjh]hNETIF_F_HW_CSUM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK:hjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hThe driver (or its device) is able to compute one IP (one's complement) checksum for any combination of protocols or protocol layering. The checksum is computed and set in a packet per the CHECKSUM_PARTIAL interface (see below).h]hThe driver (or its device) is able to compute one IP (one’s complement) checksum for any combination of protocols or protocol layering. The checksum is computed and set in a packet per the CHECKSUM_PARTIAL interface (see below).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK;hjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``NETIF_F_IP_CSUM``h]h)}(hjh]hNETIF_F_IP_CSUM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKAhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hXDriver (device) is only able to checksum plain TCP or UDP packets over IPv4. These are specifically unencapsulated packets of the form IPv4|TCP or IPv4|UDP where the Protocol field in the IPv4 header is TCP or UDP. The IPv4 header may contain IP options. This feature cannot be set in features for a device with NETIF_F_HW_CSUM also set. This feature is being DEPRECATED (see below).h]hXDriver (device) is only able to checksum plain TCP or UDP packets over IPv4. These are specifically unencapsulated packets of the form IPv4|TCP or IPv4|UDP where the Protocol field in the IPv4 header is TCP or UDP. The IPv4 header may contain IP options. This feature cannot be set in features for a device with NETIF_F_HW_CSUM also set. This feature is being DEPRECATED (see below).}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKBhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``NETIF_F_IPV6_CSUM``h]h)}(hjh]hNETIF_F_IPV6_CSUM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKKhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hXDriver (device) is only able to checksum plain TCP or UDP packets over IPv6. These are specifically unencapsulated packets of the form IPv6|TCP or IPv6|UDP where the Next Header field in the IPv6 header is either TCP or UDP. IPv6 extension headers are not supported with this feature. This feature cannot be set in features for a device with NETIF_F_HW_CSUM also set. This feature is being DEPRECATED (see below).h]hXDriver (device) is only able to checksum plain TCP or UDP packets over IPv6. These are specifically unencapsulated packets of the form IPv6|TCP or IPv6|UDP where the Next Header field in the IPv6 header is either TCP or UDP. IPv6 extension headers are not supported with this feature. This feature cannot be set in features for a device with NETIF_F_HW_CSUM also set. This feature is being DEPRECATED (see below).}(hj:hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKLhj7ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``NETIF_F_RXCSUM``h]h)}(hj]h]hNETIF_F_RXCSUM}(hj_hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj[ubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKVhjXubah}(h]h ]h"]h$]h&]uh1jhjUubj)}(hhh]h)}(hDriver (device) performs receive checksum offload. This flag is only used to disable the RX checksum feature for a device. The stack will accept receive checksum indication in packets received on a device regardless of whether NETIF_F_RXCSUM is set.h]hDriver (device) performs receive checksum offload. This flag is only used to disable the RX checksum feature for a device. The stack will accept receive checksum indication in packets received on a device regardless of whether NETIF_F_RXCSUM is set.}(hj|hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKWhjyubah}(h]h ]h"]h$]h&]uh1jhjUubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjmubeh}(h]h ]h"]h$]h&]colsKuh1jkhjYubeh}(h]id1ah ]h"]h$]h&]uh1jWhj7ubeh}(h]ip-checksum-related-featuresah ]h"]ip checksum related featuresah$]h&]uh1hhjhhhNhNubh)}(hhh](h)}(h*Checksumming of received packets by deviceh]h*Checksumming of received packets by device}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhNhNubh)}(hiIndication of checksum verification is set in :c:type:`sk_buff.ip_summed `. Possible values are:h](h.Indication of checksum verification is set in }(hjhhhNhNubh)}(h%:c:type:`sk_buff.ip_summed `h]h)}(hjh]hsk_buff.ip_summed}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK`hjubh. Possible values are:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhK`hjubjS)}(hhh](jX)}(h``CHECKSUM_NONE`` Device did not checksum this packet e.g. due to lack of capabilities. The packet contains full (though not verified) checksum in packet but not in skb->csum. Thus, skb->csum is undefined in this case. h](h)}(h``CHECKSUM_NONE``h]h)}(hjh]h CHECKSUM_NONE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKchjubh)}(hDevice did not checksum this packet e.g. due to lack of capabilities. The packet contains full (though not verified) checksum in packet but not in skb->csum. Thus, skb->csum is undefined in this case.h]hDevice did not checksum this packet e.g. due to lack of capabilities. The packet contains full (though not verified) checksum in packet but not in skb->csum. Thus, skb->csum is undefined in this case.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKehjubeh}(h]h ]h"]h$]h&]uh1jWhjubjX)}(hX``CHECKSUM_UNNECESSARY`` The hardware you're dealing with doesn't calculate the full checksum (as in ``CHECKSUM_COMPLETE``), but it does parse headers and verify checksums for specific protocols. For such packets it will set ``CHECKSUM_UNNECESSARY`` if their checksums are okay. :c:type:`sk_buff.csum ` is still undefined in this case though. A driver or device must never modify the checksum field in the packet even if checksum is verified. ``CHECKSUM_UNNECESSARY`` is applicable to following protocols: - TCP: IPv6 and IPv4. - UDP: IPv4 and IPv6. A device may apply CHECKSUM_UNNECESSARY to a zero UDP checksum for either IPv4 or IPv6, the networking stack may perform further validation in this case. - GRE: only if the checksum is present in the header. - SCTP: indicates the CRC in SCTP header has been validated. - FCOE: indicates the CRC in FC frame has been validated. :c:type:`sk_buff.csum_level ` indicates the number of consecutive checksums found in the packet minus one that have been verified as ``CHECKSUM_UNNECESSARY``. For instance if a device receives an IPv6->UDP->GRE->IPv4->TCP packet and a device is able to verify the checksums for UDP (possibly zero), GRE (checksum flag is set) and TCP, :c:type:`sk_buff.csum_level ` would be set to two. If the device were only able to verify the UDP checksum and not GRE, either because it doesn't support GRE checksum or because GRE checksum is bad, skb->csum_level would be set to zero (TCP checksum is not considered in this case). h](h)}(h``CHECKSUM_UNNECESSARY``h]h)}(hj0h]hCHECKSUM_UNNECESSARY}(hj2hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj.ubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKihj*ubh)}(hXThe hardware you're dealing with doesn't calculate the full checksum (as in ``CHECKSUM_COMPLETE``), but it does parse headers and verify checksums for specific protocols. For such packets it will set ``CHECKSUM_UNNECESSARY`` if their checksums are okay. :c:type:`sk_buff.csum ` is still undefined in this case though. A driver or device must never modify the checksum field in the packet even if checksum is verified.h](hPThe hardware you’re dealing with doesn’t calculate the full checksum (as in }(hjFhhhNhNubh)}(h``CHECKSUM_COMPLETE``h]hCHECKSUM_COMPLETE}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFubhg), but it does parse headers and verify checksums for specific protocols. For such packets it will set }(hjFhhhNhNubh)}(h``CHECKSUM_UNNECESSARY``h]hCHECKSUM_UNNECESSARY}(hj`hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFubh if their checksums are okay. }(hjFhhhNhNubh)}(h :c:type:`sk_buff.csum `h]h)}(hjth]h sk_buff.csum}(hjvhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjrubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKkhjFubh is still undefined in this case though. A driver or device must never modify the checksum field in the packet even if checksum is verified.}(hjFhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhKkhj*ubh)}(h>``CHECKSUM_UNNECESSARY`` is applicable to following protocols:h](h)}(h``CHECKSUM_UNNECESSARY``h]hCHECKSUM_UNNECESSARY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh& is applicable to following protocols:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKrhj*ubjM)}(hXw- TCP: IPv6 and IPv4. - UDP: IPv4 and IPv6. A device may apply CHECKSUM_UNNECESSARY to a zero UDP checksum for either IPv4 or IPv6, the networking stack may perform further validation in this case. - GRE: only if the checksum is present in the header. - SCTP: indicates the CRC in SCTP header has been validated. - FCOE: indicates the CRC in FC frame has been validated. h]jS)}(hhh](jX)}(hTCP: IPv6 and IPv4.h]h)}(hjh]hTCP: IPv6 and IPv4.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKthjubah}(h]h ]h"]h$]h&]uh1jWhjubjX)}(hUDP: IPv4 and IPv6. A device may apply CHECKSUM_UNNECESSARY to a zero UDP checksum for either IPv4 or IPv6, the networking stack may perform further validation in this case.h]h)}(hUDP: IPv4 and IPv6. A device may apply CHECKSUM_UNNECESSARY to a zero UDP checksum for either IPv4 or IPv6, the networking stack may perform further validation in this case.h]hUDP: IPv4 and IPv6. A device may apply CHECKSUM_UNNECESSARY to a zero UDP checksum for either IPv4 or IPv6, the networking stack may perform further validation in this case.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKuhjubah}(h]h ]h"]h$]h&]uh1jWhjubjX)}(h3GRE: only if the checksum is present in the header.h]h)}(hjh]h3GRE: only if the checksum is present in the header.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKxhjubah}(h]h ]h"]h$]h&]uh1jWhjubjX)}(h:SCTP: indicates the CRC in SCTP header has been validated.h]h)}(hj h]h:SCTP: indicates the CRC in SCTP header has been validated.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKyhj ubah}(h]h ]h"]h$]h&]uh1jWhjubjX)}(h8FCOE: indicates the CRC in FC frame has been validated. h]h)}(h7FCOE: indicates the CRC in FC frame has been validated.h]h7FCOE: indicates the CRC in FC frame has been validated.}(hj%hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKzhj!ubah}(h]h ]h"]h$]h&]uh1jWhjubeh}(h]h ]h"]h$]h&]jjuh1jRhjhKthjubah}(h]h ]h"]h$]h&]uh1jLhjhKthj*ubh)}(hX{:c:type:`sk_buff.csum_level ` indicates the number of consecutive checksums found in the packet minus one that have been verified as ``CHECKSUM_UNNECESSARY``. For instance if a device receives an IPv6->UDP->GRE->IPv4->TCP packet and a device is able to verify the checksums for UDP (possibly zero), GRE (checksum flag is set) and TCP, :c:type:`sk_buff.csum_level ` would be set to two. If the device were only able to verify the UDP checksum and not GRE, either because it doesn't support GRE checksum or because GRE checksum is bad, skb->csum_level would be set to zero (TCP checksum is not considered in this case).h](h)}(h&:c:type:`sk_buff.csum_level `h]h)}(hjLh]hsk_buff.csum_level}(hjNhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjJubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK|hjFubhh indicates the number of consecutive checksums found in the packet minus one that have been verified as }(hjFhhhNhNubh)}(h``CHECKSUM_UNNECESSARY``h]hCHECKSUM_UNNECESSARY}(hjnhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjFubh. For instance if a device receives an IPv6->UDP->GRE->IPv4->TCP packet and a device is able to verify the checksums for UDP (possibly zero), GRE (checksum flag is set) and TCP, }(hjFhhhNhNubh)}(h&:c:type:`sk_buff.csum_level `h]h)}(hjh]hsk_buff.csum_level}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhjihK|hjFubh would be set to two. If the device were only able to verify the UDP checksum and not GRE, either because it doesn’t support GRE checksum or because GRE checksum is bad, skb->csum_level would be set to zero (TCP checksum is not considered in this case).}(hjFhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjihK|hj*ubeh}(h]h ]h"]h$]h&]uh1jWhjubjX)}(hX``CHECKSUM_COMPLETE`` This is the most generic way. The device supplied checksum of the _whole_ packet as seen by netif_rx() and fills in :c:type:`sk_buff.csum `. This means the hardware doesn't need to parse L3/L4 headers to implement this. Notes: - Even if device supports only some protocols, but is able to produce skb->csum, it MUST use CHECKSUM_COMPLETE, not CHECKSUM_UNNECESSARY. - CHECKSUM_COMPLETE is not applicable to SCTP and FCoE protocols. h](h)}(h``CHECKSUM_COMPLETE``h]h)}(hjh]hCHECKSUM_COMPLETE}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjubh)}(hThis is the most generic way. The device supplied checksum of the _whole_ packet as seen by netif_rx() and fills in :c:type:`sk_buff.csum `. This means the hardware doesn't need to parse L3/L4 headers to implement this.h](htThis is the most generic way. The device supplied checksum of the _whole_ packet as seen by netif_rx() and fills in }(hjhhhNhNubh)}(h :c:type:`sk_buff.csum `h]h)}(hjh]h sk_buff.csum}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjubhR. This means the hardware doesn’t need to parse L3/L4 headers to implement this.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhKhjubh)}(hNotes:h]hNotes:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjubjS)}(hhh](jX)}(hEven if device supports only some protocols, but is able to produce skb->csum, it MUST use CHECKSUM_COMPLETE, not CHECKSUM_UNNECESSARY.h]h)}(hEven if device supports only some protocols, but is able to produce skb->csum, it MUST use CHECKSUM_COMPLETE, not CHECKSUM_UNNECESSARY.h]hEven if device supports only some protocols, but is able to produce skb->csum, it MUST use CHECKSUM_COMPLETE, not CHECKSUM_UNNECESSARY.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjubah}(h]h ]h"]h$]h&]uh1jWhj ubjX)}(h@CHECKSUM_COMPLETE is not applicable to SCTP and FCoE protocols. h]h)}(h?CHECKSUM_COMPLETE is not applicable to SCTP and FCoE protocols.h]h?CHECKSUM_COMPLETE is not applicable to SCTP and FCoE protocols.}(hj,hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj(ubah}(h]h ]h"]h$]h&]uh1jWhj ubeh}(h]h ]h"]h$]h&]jjuh1jRhj!hKhjubeh}(h]h ]h"]h$]h&]uh1jWhjubjX)}(hXY``CHECKSUM_PARTIAL`` A checksum is set up to be offloaded to a device as described in the output description for CHECKSUM_PARTIAL. This may occur on a packet received directly from another Linux OS, e.g., a virtualized Linux kernel on the same host, or it may be set in the input path in GRO or remote checksum offload. For the purposes of checksum verification, the checksum referred to by skb->csum_start + skb->csum_offset and any preceding checksums in the packet are considered verified. Any checksums in the packet that are after the checksum being offloaded are not considered to be verified. h](h)}(h``CHECKSUM_PARTIAL``h]h)}(hjSh]hCHECKSUM_PARTIAL}(hjUhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjQubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjMubh)}(hXBA checksum is set up to be offloaded to a device as described in the output description for CHECKSUM_PARTIAL. This may occur on a packet received directly from another Linux OS, e.g., a virtualized Linux kernel on the same host, or it may be set in the input path in GRO or remote checksum offload. For the purposes of checksum verification, the checksum referred to by skb->csum_start + skb->csum_offset and any preceding checksums in the packet are considered verified. Any checksums in the packet that are after the checksum being offloaded are not considered to be verified.h]hXBA checksum is set up to be offloaded to a device as described in the output description for CHECKSUM_PARTIAL. This may occur on a packet received directly from another Linux OS, e.g., a virtualized Linux kernel on the same host, or it may be set in the input path in GRO or remote checksum offload. For the purposes of checksum verification, the checksum referred to by skb->csum_start + skb->csum_offset and any preceding checksums in the packet are considered verified. Any checksums in the packet that are after the checksum being offloaded are not considered to be verified.}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjMubeh}(h]h ]h"]h$]h&]uh1jWhjubeh}(h]h ]h"]h$]h&]jjuh1jRhjhKchjubeh}(h]*checksumming-of-received-packets-by-deviceah ]h"]*checksumming of received packets by deviceah$]h&]uh1hhjhhhNhNubh)}(hhh](h)}(h$Checksumming on transmit for non-GSOh]h$Checksumming on transmit for non-GSO}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjhNhNubh)}(hjThe stack requests checksum offload in the :c:type:`sk_buff.ip_summed ` for a packet. Values are:h](h+The stack requests checksum offload in the }(hjhhhNhNubh)}(h%:c:type:`sk_buff.ip_summed `h]h)}(hjh]hsk_buff.ip_summed}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjubh for a packet. Values are:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhKhjubjS)}(hhh](jX)}(hXw``CHECKSUM_PARTIAL`` The driver is required to checksum the packet as seen by hard_start_xmit() from :c:type:`sk_buff.csum_start ` up to the end, and to record/write the checksum at offset :c:type:`sk_buff.csum_start ` + :c:type:`sk_buff.csum_offset `. A driver may verify that the csum_start and csum_offset values are valid values given the length and offset of the packet, but it should not attempt to validate that the checksum refers to a legitimate transport layer checksum -- it is the purview of the stack to validate that csum_start and csum_offset are set correctly. When the stack requests checksum offload for a packet, the driver MUST ensure that the checksum is set correctly. A driver can either offload the checksum calculation to the device, or call skb_checksum_help (in the case that the device does not support offload for a particular checksum). ``NETIF_F_IP_CSUM`` and ``NETIF_F_IPV6_CSUM`` are being deprecated in favor of ``NETIF_F_HW_CSUM``. New devices should use ``NETIF_F_HW_CSUM`` to indicate checksum offload capability. skb_csum_hwoffload_help() can be called to resolve ``CHECKSUM_PARTIAL`` based on network device checksumming capabilities: if a packet does not match them, skb_checksum_help() or skb_crc32c_help() (depending on the value of :c:type:`sk_buff.csum_not_inet `, see :ref:`crc`) is called to resolve the checksum. h](h)}(h``CHECKSUM_PARTIAL``h]h)}(hjh]hCHECKSUM_PARTIAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjubh)}(hXFThe driver is required to checksum the packet as seen by hard_start_xmit() from :c:type:`sk_buff.csum_start ` up to the end, and to record/write the checksum at offset :c:type:`sk_buff.csum_start ` + :c:type:`sk_buff.csum_offset `. A driver may verify that the csum_start and csum_offset values are valid values given the length and offset of the packet, but it should not attempt to validate that the checksum refers to a legitimate transport layer checksum -- it is the purview of the stack to validate that csum_start and csum_offset are set correctly.h](hPThe driver is required to checksum the packet as seen by hard_start_xmit() from }(hjhhhNhNubh)}(h&:c:type:`sk_buff.csum_start `h]h)}(hjh]hsk_buff.csum_start}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjubh; up to the end, and to record/write the checksum at offset }(hjhhhNhNubh)}(h&:c:type:`sk_buff.csum_start `h]h)}(hjh]hsk_buff.csum_start}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhjhKhjubh + }(hjhhhNhNubh)}(h':c:type:`sk_buff.csum_offset `h]h)}(hj?h]hsk_buff.csum_offset}(hjAhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhj=ubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhjhKhjubhXE. A driver may verify that the csum_start and csum_offset values are valid values given the length and offset of the packet, but it should not attempt to validate that the checksum refers to a legitimate transport layer checksum -- it is the purview of the stack to validate that csum_start and csum_offset are set correctly.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhKhjubh)}(hX!When the stack requests checksum offload for a packet, the driver MUST ensure that the checksum is set correctly. A driver can either offload the checksum calculation to the device, or call skb_checksum_help (in the case that the device does not support offload for a particular checksum).h]hX!When the stack requests checksum offload for a packet, the driver MUST ensure that the checksum is set correctly. A driver can either offload the checksum calculation to the device, or call skb_checksum_help (in the case that the device does not support offload for a particular checksum).}(hjfhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjubh)}(hX``NETIF_F_IP_CSUM`` and ``NETIF_F_IPV6_CSUM`` are being deprecated in favor of ``NETIF_F_HW_CSUM``. New devices should use ``NETIF_F_HW_CSUM`` to indicate checksum offload capability. skb_csum_hwoffload_help() can be called to resolve ``CHECKSUM_PARTIAL`` based on network device checksumming capabilities: if a packet does not match them, skb_checksum_help() or skb_crc32c_help() (depending on the value of :c:type:`sk_buff.csum_not_inet `, see :ref:`crc`) is called to resolve the checksum.h](h)}(h``NETIF_F_IP_CSUM``h]hNETIF_F_IP_CSUM}(hjyhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuubh and }(hjuhhhNhNubh)}(h``NETIF_F_IPV6_CSUM``h]hNETIF_F_IPV6_CSUM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuubh" are being deprecated in favor of }(hjuhhhNhNubh)}(h``NETIF_F_HW_CSUM``h]hNETIF_F_HW_CSUM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuubh. New devices should use }(hjuhhhNhNubh)}(h``NETIF_F_HW_CSUM``h]hNETIF_F_HW_CSUM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuubh] to indicate checksum offload capability. skb_csum_hwoffload_help() can be called to resolve }(hjuhhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjuubh based on network device checksumming capabilities: if a packet does not match them, skb_checksum_help() or skb_crc32c_help() (depending on the value of }(hjuhhhNhNubh)}(h):c:type:`sk_buff.csum_not_inet `h]h)}(hjh]hsk_buff.csum_not_inet}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjuubh, see }(hjuhhhNhNubh)}(h :ref:`crc`h]hinline)}(hjh]hcrc}(hjhhhNhNubah}(h]h ](hߌstdstd-refeh"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]refdoch refdomainj reftyperef refexplicitrefwarnhcrcuh1hhjhKhjuubh$) is called to resolve the checksum.}(hjuhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhKhjubeh}(h]h ]h"]h$]h&]uh1jWhjubjX)}(hc``CHECKSUM_NONE`` The skb was already checksummed by the protocol, or a checksum is not required. h](h)}(h``CHECKSUM_NONE``h]h)}(hj/ h]h CHECKSUM_NONE}(hj1 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj- ubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj) ubh)}(hOThe skb was already checksummed by the protocol, or a checksum is not required.h]hOThe skb was already checksummed by the protocol, or a checksum is not required.}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj) ubeh}(h]h ]h"]h$]h&]uh1jWhjubjX)}(he``CHECKSUM_UNNECESSARY`` This has the same meaning as CHECKSUM_NONE for checksum offload on output. h](h)}(h``CHECKSUM_UNNECESSARY``h]h)}(hj` h]hCHECKSUM_UNNECESSARY}(hjb hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^ ubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjZ ubh)}(hJThis has the same meaning as CHECKSUM_NONE for checksum offload on output.h]hJThis has the same meaning as CHECKSUM_NONE for checksum offload on output.}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjZ ubeh}(h]h ]h"]h$]h&]uh1jWhjubjX)}(h``CHECKSUM_COMPLETE`` Not used in checksum output. If a driver observes a packet with this value set in skbuff, it should treat the packet as if ``CHECKSUM_NONE`` were set. h](h)}(h``CHECKSUM_COMPLETE``h]h)}(hj h]hCHECKSUM_COMPLETE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj ubh)}(hNot used in checksum output. If a driver observes a packet with this value set in skbuff, it should treat the packet as if ``CHECKSUM_NONE`` were set.h](h{Not used in checksum output. If a driver observes a packet with this value set in skbuff, it should treat the packet as if }(hj hhhNhNubh)}(h``CHECKSUM_NONE``h]h CHECKSUM_NONE}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh were set.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj ubeh}(h]h ]h"]h$]h&]uh1jWhjubeh}(h]h ]h"]h$]h&]jjuh1jRhjhKhjubhtarget)}(h.. _crc:h]h}(h]h ]h"]h$]h&]refidcrcuh1j hKhjubeh}(h]$checksumming-on-transmit-for-non-gsoah ]h"]$checksumming on transmit for non-gsoah$]h&]uh1hhjhhhNhNubh)}(hhh](h)}(hNon-IP checksum (CRC) offloadsh]hNon-IP checksum (CRC) offloads}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hNhNubjX)}(hhh]jl)}(hhh](jq)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jphj ubjq)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jphj ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h``NETIF_F_SCTP_CRC``h]h)}(hj h]hNETIF_F_SCTP_CRC}(hj" hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(hXoThis feature indicates that a device is capable of offloading the SCTP CRC in a packet. To perform this offload the stack will set csum_start and csum_offset accordingly, set ip_summed to ``CHECKSUM_PARTIAL`` and set csum_not_inet to 1, to provide an indication in the skbuff that the ``CHECKSUM_PARTIAL`` refers to CRC32c. A driver that supports both IP checksum offload and SCTP CRC32c offload must verify which offload is configured for a packet by testing the value of :c:type:`sk_buff.csum_not_inet `; skb_crc32c_csum_help() is provided to resolve ``CHECKSUM_PARTIAL`` on skbs where csum_not_inet is set to 1.h](hThis feature indicates that a device is capable of offloading the SCTP CRC in a packet. To perform this offload the stack will set csum_start and csum_offset accordingly, set ip_summed to }(hj? hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hjG hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubhM and set csum_not_inet to 1, to provide an indication in the skbuff that the }(hj? hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hjY hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh refers to CRC32c. A driver that supports both IP checksum offload and SCTP CRC32c offload must verify which offload is configured for a packet by testing the value of }(hj? hhhNhNubh)}(h):c:type:`sk_buff.csum_not_inet `h]h)}(hjm h]hsk_buff.csum_not_inet}(hjo hhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjk ubah}(h]h ]h"]h$]h&]refdoch refdomainhreftypetype refexplicitrefwarnhsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj? ubh0; skb_crc32c_csum_help() is provided to resolve }(hj? hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj? ubh) on skbs where csum_not_inet is set to 1.}(hj? hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj hKhj< ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh](j)}(hhh]h)}(h``NETIF_F_FCOE_CRC``h]h)}(hj h]hNETIF_F_FCOE_CRC}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubj)}(hhh]h)}(hXThis feature indicates that a device is capable of offloading the FCOE CRC in a packet. To perform this offload the stack will set ip_summed to ``CHECKSUM_PARTIAL`` and set csum_start and csum_offset accordingly. Note that there is no indication in the skbuff that the ``CHECKSUM_PARTIAL`` refers to an FCOE checksum, so a driver that supports both IP checksum offload and FCOE CRC offload must verify which offload is configured for a packet, presumably by inspecting packet headers.h](hThis feature indicates that a device is capable of offloading the FCOE CRC in a packet. To perform this offload the stack will set ip_summed to }(hj hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubhi and set csum_start and csum_offset accordingly. Note that there is no indication in the skbuff that the }(hj hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj ubh refers to an FCOE checksum, so a driver that supports both IP checksum offload and FCOE CRC offload must verify which offload is configured for a packet, presumably by inspecting packet headers.}(hj hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj ubah}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]uh1jhj ubeh}(h]h ]h"]h$]h&]colsKuh1jkhj ubah}(h]h ]h"]h$]h&]uh1jWhj ubeh}(h](non-ip-checksum-crc-offloadsj eh ]h"](non-ip checksum (crc) offloadscrceh$]h&]uh1hhjhhhNhNexpect_referenced_by_name}j2 j sexpect_referenced_by_id}j j subh)}(hhh](h)}(hChecksumming on output with GSOh]hChecksumming on output with GSO}(hj< hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj9 hNhNubh)}(hXIn the case of a GSO packet (skb_is_gso() is true), checksum offload is implied by the SKB_GSO_* flags in gso_type. Most obviously, if the gso_type is ``SKB_GSO_TCPV4`` or ``SKB_GSO_TCPV6``, TCP checksum offload as part of the GSO operation is implied. If a checksum is being offloaded with GSO then ip_summed is ``CHECKSUM_PARTIAL``, and both csum_start and csum_offset are set to refer to the outermost checksum being offloaded (two offloaded checksums are possible with UDP encapsulation).h](hIn the case of a GSO packet (skb_is_gso() is true), checksum offload is implied by the SKB_GSO_* flags in gso_type. Most obviously, if the gso_type is }(hjJ hhhNhNubh)}(h``SKB_GSO_TCPV4``h]h SKB_GSO_TCPV4}(hjR hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJ ubh or }(hjJ hhhNhNubh)}(h``SKB_GSO_TCPV6``h]h SKB_GSO_TCPV6}(hjd hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJ ubh|, TCP checksum offload as part of the GSO operation is implied. If a checksum is being offloaded with GSO then ip_summed is }(hjJ hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjJ ubh, and both csum_start and csum_offset are set to refer to the outermost checksum being offloaded (two offloaded checksums are possible with UDP encapsulation).}(hjJ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhj9 ubeh}(h]checksumming-on-output-with-gsoah ]h"]checksumming on output with gsoah$]h&]uh1hhjhhhNhNubeh}(h]checksum-informationah ]h"]checksum informationah$]h&]uh1hhhhhhhhK"ubeh}(h]struct-sk-buffah ]h"]struct sk_buffah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerj error_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}j ]j asnameids}(j j jjjVjSjjj j jjjjj j j2 j j1 j. j j u nametypes}(j jjVjj jjj j2 j1 j uh}(j hjhjSjjjYj jjj7jjj jj j j. j j j9 jjYu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}j KsRparse_messages]transform_messages]hsystem_message)}(hhh]h)}(hhh]h)Hyperlink target "crc" is not referenced.}hj3 sbah}(h]h ]h"]h$]h&]uh1hhj0 ubah}(h]h ]h"]h$]h&]levelKtypeINFOlineKsourcehuh1j. uba transformerN include_log] decorationNhhub.