Skip to contentSkip to conversation

openvswitch: raise internal port TSO limit

PATCH Superseded Wang Zhan 2 participants 3 messages Sep 10 – Sep 15

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Wang Zhan

author
#0 lore raw

PATCH 1/1 openvswitch: raise internal port TSO limit

Set the internal port TSO limit to GSO_MAX_SIZE (512 KB), as for loopback and veth. This allows the admin/user to set a GSO limit up to this value, to use BIG TCP for traffic routed through the internal port.

Only the capability limit changes: the IPv4 and IPv6 GSO and GRO limits remain at 64 KiB until changed by the administrator.

Validation used a same-host test with a temporary OVS bridge, a veth pair, and a network namespace:

TCP client -> OVS internal -> OVS bridge -> veth -> TCP server

The veth endpoints were BIG TCP capable throughout the test, and only the OVS internal port limits changed between 64 KiB and 524280 bytes. A single iperf3 3.19 TCP flow, run separately over IPv4 and IPv6 with six alternating runs per state (-t 15 -O 5, fixed CPU affinity and port tuple), increased throughput by 18.1% for IPv4 and 34.7% for IPv6:

  protocol  BIG TCP off  BIG TCP on   CV off / on
  TCP/IPv4  65.567 Gbps  77.420 Gbps  1.12% / 0.37%
  TCP/IPv6  55.355 Gbps  74.568 Gbps  1.20% / 0.68%
Assisted-by LLM
---
 net/openvswitch/vport-internal_dev.c | 1 +
 1 file changed, 1 insertion(+)
net/openvswitch/vport-internal_dev.c +1 -0
index 125d310871e93..73f5184afba42 100644
@@ -116,6 +116,7 @@ static void do_setup(struct net_device *netdev)
 	netdev->hw_enc_features = netdev->features;
 	netdev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
 	netdev->hw_features = netdev->features;
+	netif_set_tso_max_size(netdev, GSO_MAX_SIZE);
 
 	eth_hw_addr_random(netdev);
 }

base-commit: 211f2a875f6f447745d80d5762d6d614503ac84a

Signature · 1 line
2.47.3
maintainer
#1 lore raw
Quoted 18 lines · Wang Zhan

Set the internal port TSO limit to GSO_MAX_SIZE (512 KB), as for loopback and veth. This allows the admin/user to set a GSO limit up to this value, to use BIG TCP for traffic routed through the internal port.

Only the capability limit changes: the IPv4 and IPv6 GSO and GRO limits remain at 64 KiB until changed by the administrator.

Validation used a same-host test with a temporary OVS bridge, a veth pair, and a network namespace:

TCP client -> OVS internal -> OVS bridge -> veth -> TCP server

The veth endpoints were BIG TCP capable throughout the test, and only the OVS internal port limits changed between 64 KiB and 524280 bytes. A single iperf3 3.19 TCP flow, run separately over IPv4 and IPv6 with six alternating runs per state (-t 15 -O 5, fixed CPU affinity and port tuple), increased throughput by 18.1% for IPv4 and 34.7% for IPv6:

Quoted 5 lines
  protocol  BIG TCP off  BIG TCP on   CV off / on
  TCP/IPv4  65.567 Gbps  77.420 Gbps  1.12% / 0.37%
  TCP/IPv6  55.355 Gbps  74.568 Gbps  1.20% / 0.68%
Assisted-by LLM

This looks a bit strange.

net/openvswitch/vport-internal_dev.c static void do_setup(struct net_device *netdev) · line 118

Quoted 13 lines
---
 net/openvswitch/vport-internal_dev.c | 1 +
 1 file changed, 1 insertion(+)
net/openvswitch/vport-internal_dev.c +0 -0
index 125d310871e93..73f5184afba42 100644
@@ -116,6 +116,7 @@ static void do_setup(struct net_device *netdev)
 	netdev->hw_enc_features = netdev->features;
 	netdev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_STAG_TX;
 	netdev->hw_features = netdev->features;

Please, add an empty line here, it looks awkward to glue the call to the feature flags block.

net/openvswitch/vport-internal_dev.c static void do_setup(struct net_device *netdev) · line 122

Quoted 4 lines
net/openvswitch/vport-internal_dev.c +1 -0
+	netif_set_tso_max_size(netdev, GSO_MAX_SIZE);
 
 	eth_hw_addr_random(netdev);
 }

Otherwise, looks fine to me. There is no reason to block BIG TCP packets on the internal port when they can enter the datapath from a veth. And I don't see why BIG TCP wouldn't work in OVS at the moment. The packets will be segmented before sending to userspace or ports that do not support BIG TCP and all the functions that check the packet length supposed to use gso_size and not the raw length.

But, please, CC all the maintainers while sending patches.

Best regards, Ilya Maximets.

author
#2 lore raw
Quoted 19 lines · Ilya Maximets
Quoted 18 lines · Wang Zhan

Set the internal port TSO limit to GSO_MAX_SIZE (512 KB), as for loopback and veth. This allows the admin/user to set a GSO limit up to this value, to use BIG TCP for traffic routed through the internal port.

Only the capability limit changes: the IPv4 and IPv6 GSO and GRO limits remain at 64 KiB until changed by the administrator.

Validation used a same-host test with a temporary OVS bridge, a veth pair, and a network namespace:

TCP client -> OVS internal -> OVS bridge -> veth -> TCP server

The veth endpoints were BIG TCP capable throughout the test, and only the OVS internal port limits changed between 64 KiB and 524280 bytes. A single iperf3 3.19 TCP flow, run separately over IPv4 and IPv6 with six alternating runs per state (-t 15 -O 5, fixed CPU affinity and port tuple), increased throughput by 18.1% for IPv4 and 34.7% for IPv6:

Quoted 7 lines
Quoted 5 lines
  protocol  BIG TCP off  BIG TCP on   CV off / on
  TCP/IPv4  65.567 Gbps  77.420 Gbps  1.12% / 0.37%
  TCP/IPv6  55.355 Gbps  74.568 Gbps  1.20% / 0.68%
Assisted-by LLM

This looks a bit strange.

Do you mean the "Assisted-by: LLM" tag? I used AI assistance for building, testing, and patch preparation, so I added the tag following:
https://docs.kernel.org/process/coding-assistants.html#attribution

Quoted 4 lines

Please, add an empty line here, it looks awkward to glue the call to the feature flags block.

net/openvswitch/vport-internal_dev.c static void do_setup(struct net_device *netdev) · line 119

Quoted 1 line
net/openvswitch/vport-internal_dev.c +1 -0
+	netif_set_tso_max_size(netdev, GSO_MAX_SIZE);

Okay, will fix in v2.

Quoted 3 lines

The packets will be segmented before sending to userspace or ports that do not support BIG TCP and all the functions that check the packet length supposed to use gso_size and not the raw length.

Right, and that's mostly fine. There is one catch though: when a BIG TCP packet goes to a port without BIG TCP support, it currently gets segmented to MTU and the GSO flag is dropped, which can regress performance pretty badly. I'm preparing a follow-up patch to segment to the target GSO size instead. Not a blocker for this patch.

Quoted 1 line

But, please, CC all the maintainers while sending patches.

Okay, will do.

Thanks for the review.

Best regards, Wang Zhan.