diff options
author | David S. Miller <davem@davemloft.net> | 2018-02-14 14:52:39 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-14 14:52:39 -0500 |
commit | 8ace02073ee6e8c0e559f712d7784fcbd555c839 (patch) | |
tree | 9fc4eb073da9f15fe7eeb12b0462a1c4707762e1 | |
parent | 080fe7aa18a29781c4db1d77ca5cb1dd4f68fb44 (diff) | |
parent | a677088922831d94d292ca3891b148a8ba0b5fa1 (diff) |
Merge branch 'net-segmentation-offload-doc-fixes'
Daniel Axtens says:
====================
Updates to segmentation-offloads.txt
I've been trying to wrap my head around GSO for a while now. This is a
set of small changes to the docs that would probably have been helpful
when I was starting out.
I realise that GSO_DODGY is still a notable omission - I'm hesitant to
write too much on it just yet as I don't understand it well and I
think it's in the process of changing.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | Documentation/networking/segmentation-offloads.txt | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/Documentation/networking/segmentation-offloads.txt b/Documentation/networking/segmentation-offloads.txt index 2f09455a993a..d47480b61ac6 100644 --- a/Documentation/networking/segmentation-offloads.txt +++ b/Documentation/networking/segmentation-offloads.txt | |||
@@ -13,6 +13,7 @@ The following technologies are described: | |||
13 | * Generic Segmentation Offload - GSO | 13 | * Generic Segmentation Offload - GSO |
14 | * Generic Receive Offload - GRO | 14 | * Generic Receive Offload - GRO |
15 | * Partial Generic Segmentation Offload - GSO_PARTIAL | 15 | * Partial Generic Segmentation Offload - GSO_PARTIAL |
16 | * SCTP accelleration with GSO - GSO_BY_FRAGS | ||
16 | 17 | ||
17 | TCP Segmentation Offload | 18 | TCP Segmentation Offload |
18 | ======================== | 19 | ======================== |
@@ -49,6 +50,10 @@ datagram into multiple IPv4 fragments. Many of the requirements for UDP | |||
49 | fragmentation offload are the same as TSO. However the IPv4 ID for | 50 | fragmentation offload are the same as TSO. However the IPv4 ID for |
50 | fragments should not increment as a single IPv4 datagram is fragmented. | 51 | fragments should not increment as a single IPv4 datagram is fragmented. |
51 | 52 | ||
53 | UFO is deprecated: modern kernels will no longer generate UFO skbs, but can | ||
54 | still receive them from tuntap and similar devices. Offload of UDP-based | ||
55 | tunnel protocols is still supported. | ||
56 | |||
52 | IPIP, SIT, GRE, UDP Tunnel, and Remote Checksum Offloads | 57 | IPIP, SIT, GRE, UDP Tunnel, and Remote Checksum Offloads |
53 | ======================================================== | 58 | ======================================================== |
54 | 59 | ||
@@ -83,10 +88,10 @@ SKB_GSO_UDP_TUNNEL_CSUM. These two additional tunnel types reflect the | |||
83 | fact that the outer header also requests to have a non-zero checksum | 88 | fact that the outer header also requests to have a non-zero checksum |
84 | included in the outer header. | 89 | included in the outer header. |
85 | 90 | ||
86 | Finally there is SKB_GSO_REMCSUM which indicates that a given tunnel header | 91 | Finally there is SKB_GSO_TUNNEL_REMCSUM which indicates that a given tunnel |
87 | has requested a remote checksum offload. In this case the inner headers | 92 | header has requested a remote checksum offload. In this case the inner |
88 | will be left with a partial checksum and only the outer header checksum | 93 | headers will be left with a partial checksum and only the outer header |
89 | will be computed. | 94 | checksum will be computed. |
90 | 95 | ||
91 | Generic Segmentation Offload | 96 | Generic Segmentation Offload |
92 | ============================ | 97 | ============================ |
@@ -128,3 +133,28 @@ values for if the header was simply duplicated. The one exception to this | |||
128 | is the outer IPv4 ID field. It is up to the device drivers to guarantee | 133 | is the outer IPv4 ID field. It is up to the device drivers to guarantee |
129 | that the IPv4 ID field is incremented in the case that a given header does | 134 | that the IPv4 ID field is incremented in the case that a given header does |
130 | not have the DF bit set. | 135 | not have the DF bit set. |
136 | |||
137 | SCTP accelleration with GSO | ||
138 | =========================== | ||
139 | |||
140 | SCTP - despite the lack of hardware support - can still take advantage of | ||
141 | GSO to pass one large packet through the network stack, rather than | ||
142 | multiple small packets. | ||
143 | |||
144 | This requires a different approach to other offloads, as SCTP packets | ||
145 | cannot be just segmented to (P)MTU. Rather, the chunks must be contained in | ||
146 | IP segments, padding respected. So unlike regular GSO, SCTP can't just | ||
147 | generate a big skb, set gso_size to the fragmentation point and deliver it | ||
148 | to IP layer. | ||
149 | |||
150 | Instead, the SCTP protocol layer builds an skb with the segments correctly | ||
151 | padded and stored as chained skbs, and skb_segment() splits based on those. | ||
152 | To signal this, gso_size is set to the special value GSO_BY_FRAGS. | ||
153 | |||
154 | Therefore, any code in the core networking stack must be aware of the | ||
155 | possibility that gso_size will be GSO_BY_FRAGS and handle that case | ||
156 | appropriately. (For size checks, the skb_gso_validate_*_len family of | ||
157 | helpers do this automatically.) | ||
158 | |||
159 | This also affects drivers with the NETIF_F_FRAGLIST & NETIF_F_GSO_SCTP bits | ||
160 | set. Note also that NETIF_F_GSO_SCTP is included in NETIF_F_GSO_SOFTWARE. | ||