sphinx.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]hPortuguese (Brazilian)}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget%/translations/pt_BR/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&]uh1hhjhhhhhK 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.}(hj#hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhjhhubh)}(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)}(hj8h]h sk_buff.head}(hj:hhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhj6ubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhj2ubhQ points to the main “head” buffer. The head buffer is divided into two parts:}(hj2hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjUhMhjhhubh 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();}(hjqhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhjmubah}(h]h ]h"]h$]h&]uh1jkhjhubjl)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:12: ./include/linux/skbuff.hhMhjubah}(h]h ]h"]h$]h&]uh1jkhjhubeh}(h]h ]h"]h$]h&]bullet-uh1jfhjhMhjbubah}(h]h ]h"]h$]h&]uh1j`hjhMhjhhubh)}(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&]refdocj refdomainhreftypetype refexplicitrefwarnjskb_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&]uh1hhjhMhjhhubh)}(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.hhMhjhhubh 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.hhMhjhhubeh}(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}(hj hhhNhNubah}(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)}(hjh]h sk_buff.users}(hj hhhNhNubah}(h]h ](hhc-membereh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypemember refexplicitrefwarnj 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).}(hjWhhhNhNubah}(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}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhjmhhhhhKubh)}(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 }(hj~hhhNhNubh)}(h3:c:type:`skb_shared_info.dataref `h]h)}(hjh]hskb_shared_info.dataref}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypetype refexplicitrefwarnjskb_shared_infouh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:30: ./include/linux/skbuff.hhMxhj~ubh 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.}(hj~hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhjhMxhjmhhubh)}(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&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_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&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_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&]uh1hhjhMhjmhhubj)}(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.hhMhjmhhubh)}(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.hhMhjmhhubeh}(h]dataref-and-headerless-skbsah ]h"]dataref and headerless skbsah$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hChecksum informationh]hChecksum information}(hj.hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj+hhhhhK"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,hj+hhubh)}(hhh](h)}(hIP checksum related featuresh]hIP checksum related features}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjKhNhNubh)}(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.}(hj\hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK2hjKubhtable)}(hhh](h)}(h Checksum related device featuresh]h Checksum related device features}(hjphhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK7hjmubhtgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhjubhtbody)}(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).}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKBhj ubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``NETIF_F_IPV6_CSUM``h]h)}(hj/h]hNETIF_F_IPV6_CSUM}(hj1hhhNhNubah}(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.hhKKhj*ubah}(h]h ]h"]h$]h&]uh1jhj'ubj)}(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).}(hjNhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKLhjKubah}(h]h ]h"]h$]h&]uh1jhj'ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h``NETIF_F_RXCSUM``h]h)}(hjqh]hNETIF_F_RXCSUM}(hjshhhNhNubah}(h]h ]h"]h$]h&]uh1hhjoubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKVhjlubah}(h]h ]h"]h$]h&]uh1jhjiubj)}(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.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKWhjubah}(h]h ]h"]h$]h&]uh1jhjiubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjmubeh}(h]id1ah ]h"]h$]h&]uh1jkhjKubeh}(h]ip-checksum-related-featuresah ]h"]ip checksum related featuresah$]h&]uh1hhj+hhhNhNubh)}(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&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_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`hjubjg)}(hhh](jl)}(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.hhKchj ubh)}(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.}(hj)hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKehj ubeh}(h]h ]h"]h$]h&]uh1jkhj ubjl)}(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)}(hjDh]hCHECKSUM_UNNECESSARY}(hjFhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjBubah}(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 }(hjZhhhNhNubh)}(h``CHECKSUM_COMPLETE``h]hCHECKSUM_COMPLETE}(hjbhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZubhg), but it does parse headers and verify checksums for specific protocols. For such packets it will set }(hjZhhhNhNubh)}(h``CHECKSUM_UNNECESSARY``h]hCHECKSUM_UNNECESSARY}(hjthhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZubh if their checksums are okay. }(hjZhhhNhNubh)}(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&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKkhjZubh 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.}(hjZhhhNhNubeh}(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>ubja)}(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]jg)}(hhh](jl)}(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&]uh1jkhjubjl)}(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&]uh1jkhjubjl)}(h3GRE: only if the checksum is present in the header.h]h)}(hjh]h3GRE: only if the checksum is present in the header.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKxhjubah}(h]h ]h"]h$]h&]uh1jkhjubjl)}(h:SCTP: indicates the CRC in SCTP header has been validated.h]h)}(hjh]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.hhKyhjubah}(h]h ]h"]h$]h&]uh1jkhjubjl)}(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.}(hj9hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKzhj5ubah}(h]h ]h"]h$]h&]uh1jkhjubeh}(h]h ]h"]h$]h&]jjuh1jfhjhKthjubah}(h]h ]h"]h$]h&]uh1j`hjhKthj>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)}(hj`h]hsk_buff.csum_level}(hjbhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhj^ubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhK|hjZubhh indicates the number of consecutive checksums found in the packet minus one that have been verified as }(hjZhhhNhNubh)}(h``CHECKSUM_UNNECESSARY``h]hCHECKSUM_UNNECESSARY}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjZubh. 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, }(hjZhhhNhNubh)}(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&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_buffuh1hhj}hK|hjZubh 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).}(hjZhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj}hK|hj>ubeh}(h]h ]h"]h$]h&]uh1jkhj ubjl)}(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&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_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.hhKhjubjg)}(hhh](jl)}(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.}(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&]uh1jkhj ubjl)}(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&]uh1jkhj ubeh}(h]h ]h"]h$]h&]jjuh1jfhj5hKhjubeh}(h]h ]h"]h$]h&]uh1jkhj ubjl)}(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)}(hjgh]hCHECKSUM_PARTIAL}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhjeubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjaubh)}(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.}(hj}hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjaubeh}(h]h ]h"]h$]h&]uh1jkhj ubeh}(h]h ]h"]h$]h&]jjuh1jfhj(hKchjubeh}(h]*checksumming-of-received-packets-by-deviceah ]h"]*checksumming of received packets by deviceah$]h&]uh1hhj+hhhNhNubh)}(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&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_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&]uh1hhjhKhjubjg)}(hhh](jl)}(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)}(hj h]hsk_buff.csum_start}(hjhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_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)}(hj0h]hsk_buff.csum_start}(hj2hhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhj.ubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_buffuh1hhj)hKhjubh + }(hjhhhNhNubh)}(h':c:type:`sk_buff.csum_offset `h]h)}(hjSh]hsk_buff.csum_offset}(hjUhhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhjQubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_buffuh1hhj)hKhjubhXE. 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&]uh1hhj)hKhjubh)}(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).}(hjzhhhNhNubah}(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}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh and }(hjhhhNhNubh)}(h``NETIF_F_IPV6_CSUM``h]hNETIF_F_IPV6_CSUM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh" are being deprecated in favor of }(hjhhhNhNubh)}(h``NETIF_F_HW_CSUM``h]hNETIF_F_HW_CSUM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh. New devices should use }(hjhhhNhNubh)}(h``NETIF_F_HW_CSUM``h]hNETIF_F_HW_CSUM}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh] to indicate checksum offload capability. skb_csum_hwoffload_help() can be called to resolve }(hjhhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhjubh 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 }(hjhhhNhNubh)}(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&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjubh, see }(hjhhhNhNubh)}(h :ref:`crc`h]hinline)}(hj h]hcrc}(hj hhhNhNubah}(h]h ](hstdstd-refeh"]h$]h&]uh1j hj ubah}(h]h ]h"]h$]h&]refdocj refdomainj reftyperef refexplicitrefwarnjcrcuh1hhj hKhjubh$) is called to resolve the checksum.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj hKhjubeh}(h]h ]h"]h$]h&]uh1jkhjubjl)}(hc``CHECKSUM_NONE`` The skb was already checksummed by the protocol, or a checksum is not required. h](h)}(h``CHECKSUM_NONE``h]h)}(hjC h]h CHECKSUM_NONE}(hjE hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjA 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.}(hjY 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&]uh1jkhjubjl)}(he``CHECKSUM_UNNECESSARY`` This has the same meaning as CHECKSUM_NONE for checksum offload on output. h](h)}(h``CHECKSUM_UNNECESSARY``h]h)}(hjt h]hCHECKSUM_UNNECESSARY}(hjv hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjr ubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjn 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.}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjn ubeh}(h]h ]h"]h$]h&]uh1jkhjubjl)}(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&]uh1jkhjubeh}(h]h ]h"]h$]h&]jjuh1jfhjhKhjubhtarget)}(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&]uh1hhj+hhhNhNubh)}(hhh](h)}(hNon-IP checksum (CRC) offloadsh]hNon-IP checksum (CRC) offloads}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj hNhNubjl)}(hhh]j)}(hhh](j)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhj ubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK uh1jhj ubj)}(hhh](j)}(hhh](j)}(hhh]h)}(h``NETIF_F_SCTP_CRC``h]h)}(hj4 h]hNETIF_F_SCTP_CRC}(hj6 hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj2 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 }(hjS hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hj[ hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjS ubhM and set csum_not_inet to 1, to provide an indication in the skbuff that the }(hjS hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hjm hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjS 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 }(hjS hhhNhNubh)}(h):c:type:`sk_buff.csum_not_inet `h]h)}(hj h]hsk_buff.csum_not_inet}(hj hhhNhNubah}(h]h ](hhc-typeeh"]h$]h&]uh1hhj ubah}(h]h ]h"]h$]h&]refdocj refdomainhreftypetype refexplicitrefwarnjsk_buffuh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjS ubh0; skb_crc32c_csum_help() is provided to resolve }(hjS hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjS ubh) on skbs where csum_not_inet is set to 1.}(hjS hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhj hKhjP 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&]colsKuh1jhj ubah}(h]h ]h"]h$]h&]uh1jkhj ubeh}(h](non-ip-checksum-crc-offloadsj eh ]h"](non-ip checksum (crc) offloadscrceh$]h&]uh1hhj+hhhNhNexpect_referenced_by_name}jF j sexpect_referenced_by_id}j j subh)}(hhh](h)}(hChecksumming on output with GSOh]hChecksumming on output with GSO}(hjP hhhNhNubah}(h]h ]h"]h$]h&]uh1hhjM 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 }(hj^ hhhNhNubh)}(h``SKB_GSO_TCPV4``h]h SKB_GSO_TCPV4}(hjf hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^ ubh or }(hj^ hhhNhNubh)}(h``SKB_GSO_TCPV6``h]h SKB_GSO_TCPV6}(hjx hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^ ubh|, TCP checksum offload as part of the GSO operation is implied. If a checksum is being offloaded with GSO then ip_summed is }(hj^ hhhNhNubh)}(h``CHECKSUM_PARTIAL``h]hCHECKSUM_PARTIAL}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1hhj^ 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).}(hj^ hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhX/var/lib/git/docbuild/linux/Documentation/networking/skbuff:36: ./include/linux/skbuff.hhKhjM ubeh}(h]checksumming-on-output-with-gsoah ]h"]checksumming on output with gsoah$]h&]uh1hhj+hhhNhNubeh}(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_sourcehnj _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 jjjjjgj(j%j j jjjjj j jF j jE jB j j u nametypes}(j jjjj(j jjj jF jE j uh}(j hjjjgjj%jmj j+jjKjjj jj j jB j j jM jjmu 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.}hjG sbah}(h]h ]h"]h$]h&]uh1hhjD ubah}(h]h ]h"]h$]h&]levelKtypeINFOlineKsourcehuh1jB uba transformerN include_log] decorationNhhub.