€•pjŒsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ4/translations/zh_CN/networking/segmentation-offloads”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/zh_TW/networking/segmentation-offloads”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/it_IT/networking/segmentation-offloads”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ja_JP/networking/segmentation-offloads”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/ko_KR/networking/segmentation-offloads”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ4/translations/sp_SP/networking/segmentation-offloads”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…””}”hh£sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1h¡hhhžhhŸŒN/var/lib/git/docbuild/linux/Documentation/networking/segmentation-offloads.rst”h KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒSegmentation Offloads”h]”hŒSegmentation Offloads”…””}”(hh»hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒ Introduction”h]”hŒ Introduction”…””}”(hhÌhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hhÉhžhhŸh³h K ubhŒ paragraph”“”)”}”(hŒ‘This document describes a set of techniques in the Linux networking stack to take advantage of segmentation offload capabilities of various NICs.”h]”hŒ‘This document describes a set of techniques in the Linux networking stack to take advantage of segmentation offload capabilities of various NICs.”…””}”(hhÜhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K hhÉhžhubhŒdefinition_list”“”)”}”(hhh]”hŒdefinition_list_item”“”)”}”(hX>The following technologies are described: * TCP Segmentation Offload - TSO * UDP Fragmentation Offload - UFO * IPIP, SIT, GRE, and UDP Tunnel Offloads * Generic Segmentation Offload - GSO * Generic Receive Offload - GRO * Partial Generic Segmentation Offload - GSO_PARTIAL * SCTP acceleration with GSO - GSO_BY_FRAGS ”h]”(hŒterm”“”)”}”(hŒ)The following technologies are described:”h]”hŒ)The following technologies are described:”…””}”(hh÷hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hõhŸh³h KhhñubhŒ definition”“”)”}”(hhh]”hŒ bullet_list”“”)”}”(hhh]”(hŒ list_item”“”)”}”(hŒTCP Segmentation Offload - TSO”h]”hÛ)”}”(hjh]”hŒTCP Segmentation Offload - TSO”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj)”}”(hŒUDP Fragmentation Offload - UFO”h]”hÛ)”}”(hj*h]”hŒUDP Fragmentation Offload - UFO”…””}”(hj,hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khj(ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj)”}”(hŒ'IPIP, SIT, GRE, and UDP Tunnel Offloads”h]”hÛ)”}”(hjAh]”hŒ'IPIP, SIT, GRE, and UDP Tunnel Offloads”…””}”(hjChžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khj?ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj)”}”(hŒ"Generic Segmentation Offload - GSO”h]”hÛ)”}”(hjXh]”hŒ"Generic Segmentation Offload - GSO”…””}”(hjZhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhjVubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj)”}”(hŒGeneric Receive Offload - GRO”h]”hÛ)”}”(hjoh]”hŒGeneric Receive Offload - GRO”…””}”(hjqhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khjmubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj)”}”(hŒ2Partial Generic Segmentation Offload - GSO_PARTIAL”h]”hÛ)”}”(hj†h]”hŒ2Partial Generic Segmentation Offload - GSO_PARTIAL”…””}”(hjˆhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khj„ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubj)”}”(hŒ+SCTP acceleration with GSO - GSO_BY_FRAGS ”h]”hÛ)”}”(hŒ)SCTP acceleration with GSO - GSO_BY_FRAGS”h]”hŒ)SCTP acceleration with GSO - GSO_BY_FRAGS”…””}”(hjŸhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Khj›ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhj ubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1j hŸh³h Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhñubeh}”(h]”h ]”h"]”h$]”h&]”uh1hïhŸh³h Khhìubah}”(h]”h ]”h"]”h$]”h&]”uh1hêhhÉhžhhŸNh Nubeh}”(h]”Œ introduction”ah ]”h"]”Œ introduction”ah$]”h&]”uh1h´hh¶hžhhŸh³h K ubhµ)”}”(hhh]”(hº)”}”(hŒTCP Segmentation Offload”h]”hŒTCP Segmentation Offload”…””}”(hjØhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjÕhžhhŸh³h KubhÛ)”}”(hXETCP segmentation allows a device to segment a single frame into multiple frames with a data payload size specified in skb_shinfo()->gso_size. When TCP segmentation requested the bit for either SKB_GSO_TCPV4 or SKB_GSO_TCPV6 should be set in skb_shinfo()->gso_type and skb_shinfo()->gso_size should be set to a non-zero value.”h]”hXETCP segmentation allows a device to segment a single frame into multiple frames with a data payload size specified in skb_shinfo()->gso_size. When TCP segmentation requested the bit for either SKB_GSO_TCPV4 or SKB_GSO_TCPV6 should be set in skb_shinfo()->gso_type and skb_shinfo()->gso_size should be set to a non-zero value.”…””}”(hjæhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KhjÕhžhubhÛ)”}”(hŒ¶TCP segmentation is dependent on support for the use of partial checksum offload. For this reason TSO is normally disabled if the Tx checksum offload for a given device is disabled.”h]”hŒ¶TCP segmentation is dependent on support for the use of partial checksum offload. For this reason TSO is normally disabled if the Tx checksum offload for a given device is disabled.”…””}”(hjôhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K!hjÕhžhubhÛ)”}”(hXUIn order to support TCP segmentation offload it is necessary to populate the network and transport header offsets of the skbuff so that the device drivers will be able determine the offsets of the IP or IPv6 header and the TCP header. In addition as CHECKSUM_PARTIAL is required csum_start should also point to the TCP header of the packet.”h]”hXUIn order to support TCP segmentation offload it is necessary to populate the network and transport header offsets of the skbuff so that the device drivers will be able determine the offsets of the IP or IPv6 header and the TCP header. In addition as CHECKSUM_PARTIAL is required csum_start should also point to the TCP header of the packet.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K%hjÕhžhubhÛ)”}”(hX For IPv4 segmentation we support one of two types in terms of the IP ID. The default behavior is to increment the IP ID with every segment. If the GSO type SKB_GSO_TCP_FIXEDID is specified then we will not increment the IP ID and all segments will use the same IP ID.”h]”hX For IPv4 segmentation we support one of two types in terms of the IP ID. The default behavior is to increment the IP ID with every segment. If the GSO type SKB_GSO_TCP_FIXEDID is specified then we will not increment the IP ID and all segments will use the same IP ID.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K+hjÕhžhubhÛ)”}”(hŒÑFor encapsulated packets, SKB_GSO_TCP_FIXEDID refers only to the outer header. SKB_GSO_TCP_FIXEDID_INNER can be used to specify the same for the inner header. Any combination of these two GSO types is allowed.”h]”hŒÑFor encapsulated packets, SKB_GSO_TCP_FIXEDID refers only to the outer header. SKB_GSO_TCP_FIXEDID_INNER can be used to specify the same for the inner header. Any combination of these two GSO types is allowed.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K0hjÕhžhubhÛ)”}”(hXÖIf a device has NETIF_F_TSO_MANGLEID set then the IP ID can be ignored when performing TSO and we will either increment the IP ID for all frames, or leave it at a static value based on driver preference. For encapsulated packets, NETIF_F_TSO_MANGLEID is relevant for both outer and inner headers, unless the DF bit is not set on the outer header, in which case the device driver must guarantee that the IP ID field is incremented in the outer header with every segment.”h]”hXÖIf a device has NETIF_F_TSO_MANGLEID set then the IP ID can be ignored when performing TSO and we will either increment the IP ID for all frames, or leave it at a static value based on driver preference. For encapsulated packets, NETIF_F_TSO_MANGLEID is relevant for both outer and inner headers, unless the DF bit is not set on the outer header, in which case the device driver must guarantee that the IP ID field is incremented in the outer header with every segment.”…””}”(hj,hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K4hjÕhžhubeh}”(h]”Œtcp-segmentation-offload”ah ]”h"]”Œtcp segmentation offload”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kubhµ)”}”(hhh]”(hº)”}”(hŒUDP Fragmentation Offload”h]”hŒUDP Fragmentation Offload”…””}”(hjEhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjBhžhhŸh³h K>ubhÛ)”}”(hXUDP fragmentation offload allows a device to fragment an oversized UDP datagram into multiple IPv4 fragments. Many of the requirements for UDP fragmentation offload are the same as TSO. However the IPv4 ID for fragments should not increment as a single IPv4 datagram is fragmented.”h]”hXUDP fragmentation offload allows a device to fragment an oversized UDP datagram into multiple IPv4 fragments. Many of the requirements for UDP fragmentation offload are the same as TSO. However the IPv4 ID for fragments should not increment as a single IPv4 datagram is fragmented.”…””}”(hjShžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K@hjBhžhubhÛ)”}”(hŒ¹UFO is deprecated: modern kernels will no longer generate UFO skbs, but can still receive them from tuntap and similar devices. Offload of UDP-based tunnel protocols is still supported.”h]”hŒ¹UFO is deprecated: modern kernels will no longer generate UFO skbs, but can still receive them from tuntap and similar devices. Offload of UDP-based tunnel protocols is still supported.”…””}”(hjahžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KEhjBhžhubeh}”(h]”Œudp-fragmentation-offload”ah ]”h"]”Œudp fragmentation offload”ah$]”h&]”uh1h´hh¶hžhhŸh³h K>ubhµ)”}”(hhh]”(hº)”}”(hŒ8IPIP, SIT, GRE, UDP Tunnel, and Remote Checksum Offloads”h]”hŒ8IPIP, SIT, GRE, UDP Tunnel, and Remote Checksum Offloads”…””}”(hjzhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjwhžhhŸh³h KKubhÛ)”}”(hX=In addition to the offloads described above it is possible for a frame to contain additional headers such as an outer tunnel. In order to account for such instances an additional set of segmentation offload types were introduced including SKB_GSO_IPXIP4, SKB_GSO_IPXIP6, SKB_GSO_GRE, and SKB_GSO_UDP_TUNNEL. These extra segmentation types are used to identify cases where there are more than just 1 set of headers. For example in the case of IPIP and SIT we should have the network and transport headers moved from the standard list of headers to "inner" header offsets.”h]”hXAIn addition to the offloads described above it is possible for a frame to contain additional headers such as an outer tunnel. In order to account for such instances an additional set of segmentation offload types were introduced including SKB_GSO_IPXIP4, SKB_GSO_IPXIP6, SKB_GSO_GRE, and SKB_GSO_UDP_TUNNEL. These extra segmentation types are used to identify cases where there are more than just 1 set of headers. For example in the case of IPIP and SIT we should have the network and transport headers moved from the standard list of headers to “inner†header offsets.”…””}”(hjˆhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KMhjwhžhubhÛ)”}”(hŒþCurrently only two levels of headers are supported. The convention is to refer to the tunnel headers as the outer headers, while the encapsulated data is normally referred to as the inner headers. Below is the list of calls to access the given headers:”h]”hŒþCurrently only two levels of headers are supported. The convention is to refer to the tunnel headers as the outer headers, while the encapsulated data is normally referred to as the inner headers. Below is the list of calls to access the given headers:”…””}”(hj–hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KVhjwhžhubhÛ)”}”(hŒIPIP/SIT Tunnel::”h]”hŒIPIP/SIT Tunnel:”…””}”(hj¤hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K[hjwhžhubhŒ literal_block”“”)”}”(hŒœ Outer Inner MAC skb_mac_header Network skb_network_header skb_inner_network_header Transport skb_transport_header”h]”hŒœ Outer Inner MAC skb_mac_header Network skb_network_header skb_inner_network_header Transport skb_transport_header”…””}”hj´sbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j²hŸh³h K]hjwhžhubhÛ)”}”(hŒUDP/GRE Tunnel::”h]”hŒUDP/GRE Tunnel:”…””}”(hjÂhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Kbhjwhžhubj³)”}”(hŒÖ Outer Inner MAC skb_mac_header skb_inner_mac_header Network skb_network_header skb_inner_network_header Transport skb_transport_header skb_inner_transport_header”h]”hŒÖ Outer Inner MAC skb_mac_header skb_inner_mac_header Network skb_network_header skb_inner_network_header Transport skb_transport_header skb_inner_transport_header”…””}”hjÐsbah}”(h]”h ]”h"]”h$]”h&]”h±h²uh1j²hŸh³h KdhjwhžhubhÛ)”}”(hŒôIn addition to the above tunnel types there are also SKB_GSO_GRE_CSUM and SKB_GSO_UDP_TUNNEL_CSUM. These two additional tunnel types reflect the fact that the outer header also requests to have a non-zero checksum included in the outer header.”h]”hŒôIn addition to the above tunnel types there are also SKB_GSO_GRE_CSUM and SKB_GSO_UDP_TUNNEL_CSUM. These two additional tunnel types reflect the fact that the outer header also requests to have a non-zero checksum included in the outer header.”…””}”(hjÞhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KihjwhžhubhÛ)”}”(hŒõFinally there is SKB_GSO_TUNNEL_REMCSUM which indicates that a given tunnel header has requested a remote checksum offload. In this case the inner headers will be left with a partial checksum and only the outer header checksum will be computed.”h]”hŒõFinally there is SKB_GSO_TUNNEL_REMCSUM which indicates that a given tunnel header has requested a remote checksum offload. In this case the inner headers will be left with a partial checksum and only the outer header checksum will be computed.”…””}”(hjìhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Knhjwhžhubeh}”(h]”Œ4ipip-sit-gre-udp-tunnel-and-remote-checksum-offloads”ah ]”h"]”Œ8ipip, sit, gre, udp tunnel, and remote checksum offloads”ah$]”h&]”uh1h´hh¶hžhhŸh³h KKubhµ)”}”(hhh]”(hº)”}”(hŒGeneric Segmentation Offload”h]”hŒGeneric Segmentation Offload”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hjhžhhŸh³h KuubhÛ)”}”(hXFGeneric segmentation offload is a pure software offload that is meant to deal with cases where device drivers cannot perform the offloads described above. What occurs in GSO is that a given skbuff will have its data broken out over multiple skbuffs that have been resized to match the MSS provided via skb_shinfo()->gso_size.”h]”hXFGeneric segmentation offload is a pure software offload that is meant to deal with cases where device drivers cannot perform the offloads described above. What occurs in GSO is that a given skbuff will have its data broken out over multiple skbuffs that have been resized to match the MSS provided via skb_shinfo()->gso_size.”…””}”(hjhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KwhjhžhubhÛ)”}”(hŒÜBefore enabling any hardware segmentation offload a corresponding software offload is required in GSO. Otherwise it becomes possible for a frame to be re-routed between devices and end up being unable to be transmitted.”h]”hŒÜBefore enabling any hardware segmentation offload a corresponding software offload is required in GSO. Otherwise it becomes possible for a frame to be re-routed between devices and end up being unable to be transmitted.”…””}”(hj!hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K}hjhžhubeh}”(h]”Œgeneric-segmentation-offload”ah ]”h"]”Œgeneric segmentation offload”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kuubhµ)”}”(hhh]”(hº)”}”(hŒGeneric Receive Offload”h]”hŒGeneric Receive Offload”…””}”(hj:hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj7hžhhŸh³h KƒubhÛ)”}”(hXGeneric receive offload is the complement to GSO. Ideally any frame assembled by GRO should be segmented to create an identical sequence of frames using GSO, and any sequence of frames segmented by GSO should be able to be reassembled back to the original by GRO.”h]”hXGeneric receive offload is the complement to GSO. Ideally any frame assembled by GRO should be segmented to create an identical sequence of frames using GSO, and any sequence of frames segmented by GSO should be able to be reassembled back to the original by GRO.”…””}”(hjHhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K…hj7hžhubeh}”(h]”Œgeneric-receive-offload”ah ]”h"]”Œgeneric receive offload”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kƒubhµ)”}”(hhh]”(hº)”}”(hŒ$Partial Generic Segmentation Offload”h]”hŒ$Partial Generic Segmentation Offload”…””}”(hjahžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj^hžhhŸh³h KŒubhÛ)”}”(hXÀPartial generic segmentation offload is a hybrid between TSO and GSO. What it effectively does is take advantage of certain traits of TCP and tunnels so that instead of having to rewrite the packet headers for each segment only the inner-most transport header and possibly the outer-most network header need to be updated. This allows devices that do not support tunnel offloads or tunnel offloads with checksum to still make use of segmentation.”h]”hXÀPartial generic segmentation offload is a hybrid between TSO and GSO. What it effectively does is take advantage of certain traits of TCP and tunnels so that instead of having to rewrite the packet headers for each segment only the inner-most transport header and possibly the outer-most network header need to be updated. This allows devices that do not support tunnel offloads or tunnel offloads with checksum to still make use of segmentation.”…””}”(hjohžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h KŽhj^hžhubhÛ)”}”(hX‰With the partial offload what occurs is that all headers excluding the inner transport header are updated such that they will contain the correct values for if the header was simply duplicated. The one exception to this is the outer IPv4 ID field. It is up to the device drivers to guarantee that the IPv4 ID field is incremented in the case that a given header does not have the DF bit set.”h]”hX‰With the partial offload what occurs is that all headers excluding the inner transport header are updated such that they will contain the correct values for if the header was simply duplicated. The one exception to this is the outer IPv4 ID field. It is up to the device drivers to guarantee that the IPv4 ID field is incremented in the case that a given header does not have the DF bit set.”…””}”(hj}hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K•hj^hžhubeh}”(h]”Œ$partial-generic-segmentation-offload”ah ]”h"]”Œ$partial generic segmentation offload”ah$]”h&]”uh1h´hh¶hžhhŸh³h KŒubhµ)”}”(hhh]”(hº)”}”(hŒSCTP acceleration with GSO”h]”hŒSCTP acceleration with GSO”…””}”(hj–hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1h¹hj“hžhhŸh³h KžubhÛ)”}”(hŒ¥SCTP - despite the lack of hardware support - can still take advantage of GSO to pass one large packet through the network stack, rather than multiple small packets.”h]”hŒ¥SCTP - despite the lack of hardware support - can still take advantage of GSO to pass one large packet through the network stack, rather than multiple small packets.”…””}”(hj¤hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K hj“hžhubhÛ)”}”(hX0This requires a different approach to other offloads, as SCTP packets cannot be just segmented to (P)MTU. Rather, the chunks must be contained in IP segments, padding respected. So unlike regular GSO, SCTP can't just generate a big skb, set gso_size to the fragmentation point and deliver it to IP layer.”h]”hX2This requires a different approach to other offloads, as SCTP packets cannot be just segmented to (P)MTU. Rather, the chunks must be contained in IP segments, padding respected. So unlike regular GSO, SCTP can’t just generate a big skb, set gso_size to the fragmentation point and deliver it to IP layer.”…””}”(hj²hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K¤hj“hžhubhÛ)”}”(hŒÙInstead, the SCTP protocol layer builds an skb with the segments correctly padded and stored as chained skbs, and skb_segment() splits based on those. To signal this, gso_size is set to the special value GSO_BY_FRAGS.”h]”hŒÙInstead, the SCTP protocol layer builds an skb with the segments correctly padded and stored as chained skbs, and skb_segment() splits based on those. To signal this, gso_size is set to the special value GSO_BY_FRAGS.”…””}”(hjÀhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Kªhj“hžhubhÛ)”}”(hŒ˜Therefore, any code in the core networking stack must be aware of the possibility that gso_size will be GSO_BY_FRAGS and handle that case appropriately.”h]”hŒ˜Therefore, any code in the core networking stack must be aware of the possibility that gso_size will be GSO_BY_FRAGS and handle that case appropriately.”…””}”(hjÎhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K®hj“hžhubhÛ)”}”(hŒ+There are some helpers to make this easier:”h]”hŒ+There are some helpers to make this easier:”…””}”(hjÜhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K²hj“hžhubj )”}”(hhh]”(j)”}”(hŒ]skb_is_gso(skb) && skb_is_gso_sctp(skb) is the best way to see if an skb is an SCTP GSO skb. ”h]”hÛ)”}”(hŒ\skb_is_gso(skb) && skb_is_gso_sctp(skb) is the best way to see if an skb is an SCTP GSO skb.”h]”hŒ\skb_is_gso(skb) && skb_is_gso_sctp(skb) is the best way to see if an skb is an SCTP GSO skb.”…””}”(hjñhžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K´hjíubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjêhžhhŸh³h Nubj)”}”(hŒ`For size checks, the skb_gso_validate_*_len family of helpers correctly considers GSO_BY_FRAGS. ”h]”hÛ)”}”(hŒ_For size checks, the skb_gso_validate_*_len family of helpers correctly considers GSO_BY_FRAGS.”h]”hŒ_For size checks, the skb_gso_validate_*_len family of helpers correctly considers GSO_BY_FRAGS.”…””}”(hj hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K·hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjêhžhhŸh³h Nubj)”}”(hŒ’For manipulating packets, skb_increase_gso_size and skb_decrease_gso_size will check for GSO_BY_FRAGS and WARN if asked to manipulate these skbs. ”h]”hÛ)”}”(hŒ‘For manipulating packets, skb_increase_gso_size and skb_decrease_gso_size will check for GSO_BY_FRAGS and WARN if asked to manipulate these skbs.”h]”hŒ‘For manipulating packets, skb_increase_gso_size and skb_decrease_gso_size will check for GSO_BY_FRAGS and WARN if asked to manipulate these skbs.”…””}”(hj!hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h Kºhjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjêhžhhŸh³h Nubeh}”(h]”h ]”h"]”h$]”h&]”j¹Œ-”uh1j hŸh³h K´hj“hžhubhÛ)”}”(hŒ•This also affects drivers with the NETIF_F_FRAGLIST & NETIF_F_GSO_SCTP bits set. Note also that NETIF_F_GSO_SCTP is included in NETIF_F_GSO_SOFTWARE.”h]”hŒ•This also affects drivers with the NETIF_F_FRAGLIST & NETIF_F_GSO_SCTP bits set. Note also that NETIF_F_GSO_SCTP is included in NETIF_F_GSO_SOFTWARE.”…””}”(hj<hžhhŸNh Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÚhŸh³h K½hj“hžhubeh}”(h]”Œsctp-acceleration-with-gso”ah ]”h"]”Œsctp acceleration with gso”ah$]”h&]”uh1h´hh¶hžhhŸh³h Kžubeh}”(h]”Œsegmentation-offloads”ah ]”h"]”Œsegmentation offloads”ah$]”h&]”uh1h´hhhžhhŸh³h Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”h³uh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(h¹NŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”j}Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”h³Œ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jWjTjÒjÏj?j<jtjqjÿjüj4j1j[jXjjjOjLuŒ nametypes”}”(jW‰jÒ‰j?‰jt‰jÿ‰j4‰j[‰j‰jO‰uh}”(jTh¶jÏhÉj<jÕjqjBjüjwj1jjXj7jj^jLj“uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nhžhub.