Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cilium: IPv4 BIG TCP support #26172

Merged
merged 12 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion Documentation/cmdref/cilium-agent.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Documentation/helm-values.rst

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

85 changes: 74 additions & 11 deletions Documentation/operations/performance/tuning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,23 @@ IPv6 BIG TCP
IPv6 BIG TCP allows the network stack to prepare larger GSO (transmit) and GRO
(receive) packets to reduce the number of times the stack is traversed which
improves performance and latency. It reduces the CPU load and helps achieve
higher speeds (i.e. 100Gbit/s and beyond). To pass such packets through the stack
BIG TCP adds a temporary Hop-By-Hop header after the IPv6 one which is stripped
before transmitting the packet over the wire. BIG TCP can operate in a DualStack
setup, IPv4 packets will use the old lower limits (64k) and IPv6 packets will
use the new larger ones (192k). Note that Cilium assumes the default kernel values
for GSO and GRO maximum sizes are 64k and adjusts them only when necessary, i.e. if
BIG TCP is enabled and the current GSO/GRO maximum sizes are less than 192k it
will try to increase them, respectively when BIG TCP is disabled and the current
maximum values are more than 64k it will try to decrease them. BIG TCP doesn't
require network interface MTU changes.
higher speeds (i.e. 100Gbit/s and beyond).

To pass such packets through the stack BIG TCP adds a temporary Hop-By-Hop header
after the IPv6 one which is stripped before transmitting the packet over the wire.

BIG TCP can operate in a DualStack setup, IPv4 packets will use the old lower
limits (64k) if IPv4 BIG TCP is not enabled, and IPv6 packets will use the new
larger ones (192k). Both IPv4 BIG TCP and IPv6 BIG TCP can be enabled so that
both use the larger one (192k).

Note that Cilium assumes the default kernel values for GSO and GRO maximum sizes
are 64k and adjusts them only when necessary, i.e. if BIG TCP is enabled and the
current GSO/GRO maximum sizes are less than 192k it will try to increase them,
respectively when BIG TCP is disabled and the current maximum values are more
than 64k it will try to decrease them.

BIG TCP doesn't require network interface MTU changes.

**Requirements:**

Expand All @@ -80,7 +87,6 @@ To enable IPv6 BIG TCP:
--set routingMode=native \\
--set bpf.masquerade=true \\
--set ipv6.enabled=true \\
--set enableIPv6Masquerade=false \\
--set enableIPv6BIGTCP=true \\
--set kubeProxyReplacement=strict

Expand All @@ -91,6 +97,63 @@ To validate whether your installation is running with IPv6 BIG TCP,
run ``cilium status`` in any of the Cilium pods and look for the line
reporting the status for "IPv6 BIG TCP" which should state "enabled".

IPv4 BIG TCP
============

Similar to IPv6 BIG TCP, IPv4 BIG TCP allows the network stack to prepare larger
GSO (transmit) and GRO (receive) packets to reduce the number of times the stack
is traversed which improves performance and latency. It reduces the CPU load and
helps achieve higher speeds (i.e. 100Gbit/s and beyond).

To pass such packets through the stack BIG TCP sets IPv4 tot_len to 0 and uses
skb->len as the real IPv4 total length. The proper IPv4 tot_len is set before
transmitting the packet over the wire.

BIG TCP can operate in a DualStack setup, IPv6 packets will use the old lower
limits (64k) if IPv6 BIG TCP is not enabled, and IPv4 packets will use the new
larger ones (192k). Both IPv4 BIG TCP and IPv6 BIG TCP can be enabled so that
both use the larger one (192k).

Note that Cilium assumes the default kernel values for GSO and GRO maximum sizes
are 64k and adjusts them only when necessary, i.e. if BIG TCP is enabled and the
current GSO/GRO maximum sizes are less than 192k it will try to increase them,
respectively when BIG TCP is disabled and the current maximum values are more
than 64k it will try to decrease them.

BIG TCP doesn't require network interface MTU changes.

**Requirements:**

* Kernel >= 6.3
* eBPF Host-Routing
* eBPF-based kube-proxy replacement
* eBPF-based masquerading
* Tunneling and encryption disabled
* Supported NICs: mlx4, mlx5

To enable IPv4 BIG TCP:

.. tabs::

.. group-tab:: Helm

.. parsed-literal::

helm install cilium |CHART_RELEASE| \\
--namespace kube-system \\
--set routingMode=native \\
--set bpf.masquerade=true \\
--set ipv4.enabled=true \\
--set enableIPv4BIGTCP=true \\
--set kubeProxyReplacement=strict

Note that after toggling the IPv4 BIG TCP option the Kubernetes Pods
must be restarted for the changes to take effect.

To validate whether your installation is running with IPv4 BIG TCP,
run ``cilium status`` in any of the Cilium pods and look for the line
reporting the status for "IPv4 BIG TCP" which should state "enabled".

Bypass iptables Connection Tracking
===================================

Expand Down
1 change: 1 addition & 0 deletions Documentation/operations/system_requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,7 @@ Socket-level LB bypass in pod netns >= 5.7
L3 devices >= 5.8
BPF-based host routing >= 5.10
IPv6 BIG TCP support >= 5.19
IPv4 BIG TCP support >= 6.3
====================================================== ===============================

.. _req_kvstore:
Expand Down
2 changes: 2 additions & 0 deletions Documentation/spelling_wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ goroutines
grafana
graphviz
grep
gve
hairpinned
hairpinning
hardcode
Expand Down Expand Up @@ -671,6 +672,7 @@ lbExternalClusterIP
lbIPAM
lbMapMax
leia
len
libbpf
libc
libceph
Expand Down
10 changes: 8 additions & 2 deletions api/v1/models/daemon_configuration_status.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

55 changes: 55 additions & 0 deletions api/v1/models/ip_v4_big_tcp.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions api/v1/models/status_response.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions api/v1/models/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 21 additions & 2 deletions api/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,9 @@ definitions:
ipv6-big-tcp:
description: Status of IPv6 BIG TCP
"$ref": "#/definitions/IPV6BigTCP"
ipv4-big-tcp:
description: Status of IPv4 BIG TCP
"$ref": "#/definitions/IPV4BigTCP"
bandwidth-manager:
description: Status of bandwidth manager
"$ref": "#/definitions/BandwidthManager"
Expand Down Expand Up @@ -2445,10 +2448,16 @@ definitions:
additionalProperties:
type: object
GSOMaxSize:
description: Maximum GSO size on workload facing devices
description: Maximum IPv6 GSO size on workload facing devices
borkmann marked this conversation as resolved.
Show resolved Hide resolved
type: integer
GROMaxSize:
description: Maximum GRO size on workload facing devices
description: Maximum IPv6 GRO size on workload facing devices
type: integer
GSOIPv4MaxSize:
description: Maximum IPv4 GSO size on workload facing devices
type: integer
GROIPv4MaxSize:
description: Maximum IPv4 GRO size on workload facing devices
type: integer
DatapathMode:
description: Datapath mode
Expand Down Expand Up @@ -3037,6 +3046,16 @@ definitions:
enabled:
description: Is IPv6 BIG TCP enabled
type: boolean
IPV4BigTCP:
description: |-
Status of IPv4 BIG TCP

+k8s:deepcopy-gen=true
type: object
properties:
enabled:
description: Is IPv4 BIG TCP enabled
type: boolean
BandwidthManager:
description: |-
Status of bandwidth manager
Expand Down