Commit 1e785f48d29a09b6cf96db7b49b6320dada332e1
net: Start with correct mac_len in skb_network_protocol
Sometimes, when the packet arrives at skb_mac_gso_segment() its skb->mac_len already accounts for some of the mac lenght headers in the packet. This seems to happen when forwarding through and OpenSSL tunnel. When we start looking for any vlan headers in skb_network_protocol() we seem to ignore any of the already known mac headers and start with an ETH_HLEN. This results in an incorrect offset, dropped TSO frames and general slowness of the connection. We can start counting from the known skb->mac_len and return at least that much if all mac level headers are known and accounted for. Fixes: 53d6471cef17262d3ad1c7ce8982a234244f68ec (net: Account for all vlan headers in skb_mac_gso_segment) CC: Eric Dumazet <eric.dumazet@gmail.com> CC: Daniel Borkman <dborkman@redhat.com> Tested-by: Martin Filip <nexus+kernel@smoula.net> Signed-off-by: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff
... | ... | @@ -2284,7 +2284,7 @@ |
2284 | 2284 | __be16 skb_network_protocol(struct sk_buff *skb, int *depth) |
2285 | 2285 | { |
2286 | 2286 | __be16 type = skb->protocol; |
2287 | - int vlan_depth = ETH_HLEN; | |
2287 | + int vlan_depth = skb->mac_len; | |
2288 | 2288 | |
2289 | 2289 | /* Tunnel gso handlers can set protocol to ethernet. */ |
2290 | 2290 | if (type == htons(ETH_P_TEB)) { |
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 9038f4
-
mentioned in commit 9038f4
-
mentioned in commit 9038f4
-
mentioned in commit 9038f4
-
mentioned in commit 9038f4
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c
-
mentioned in commit 4b9b1c