History

geneve: Allow users to specify source port range

Recently, in case of Cilium, we run into users on Azure who require to use tunneling for east/west traffic due to hitting IPAM API limits for Kubernetes Pods if they would have gone with publicly routable IPs for Pods. In case of tunneling, Cilium supports the option of vxlan or geneve. In order to RSS spread flows among remote CPUs both derive a source port hash via udp_flow_src_port() which takes the inner packet's skb->hash into account. For clusters with many nodes, this can then hit a new limitation [0]: Today, the Azure networking stack supports 1M total flows (500k inbound and 500k outbound) for a VM. [...] Once this limit is hit, other connections are dropped. [...] Each flow is distinguished by a 5-tuple (protocol, local IP address, remote IP address, local port, and remote port) information. [...] For vxlan and geneve, this can create a massive amount of UDP flows which then run into the limits if stale flows are not evicted fast enough. One option to mitigate this for vxlan is to narrow the source port range via IFLA_VXLAN_PORT_RANGE while still being able to benefit from RSS. However, geneve currently does not have this option and it spreads traffic across the full source port range of [1, USHRT_MAX]. To overcome this limitation also for geneve, add an equivalent IFLA_GENEVE_PORT_RANGE setting for users. Note that struct geneve_config before/after still remains at 2 cachelines on x86-64. The low/high members of struct ifla_geneve_port_range (which is uapi exposed) are of type __be16. While they would be perfectly fine to be of __u16 type, the consensus was that it would be good to be consistent with the existing struct ifla_vxlan_port_range from a uapi consumer PoV.

Daniel Borkmann committed 1 year ago

Commit e1f95b11 parent bf08fd32 files · +54 −4Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/if_link.h+6−0
@@ -1438,6 +1438,7 @@ enum { · 1437 unmodified lines
14381438 IFLA_GENEVE_TTL_INHERIT,
14391439 IFLA_GENEVE_DF,
14401440 IFLA_GENEVE_INNER_PROTO_INHERIT,
1441+ IFLA_GENEVE_PORT_RANGE,
14411442 __IFLA_GENEVE_MAX
14421443 };
14431444 #define IFLA_GENEVE_MAX (__IFLA_GENEVE_MAX - 1)
@@ -1450,6 +1451,11 @@ enum ifla_geneve_df { · 6 unmodified lines
14501451 GENEVE_DF_MAX = __GENEVE_DF_END - 1,
14511452 };
14521453
1454+struct ifla_geneve_port_range {
1455+ __be16 low;
1456+ __be16 high;
1457+};
1458+
14531459 /* Bareudp section */
14541460 enum {
14551461 IFLA_BAREUDP_UNSPEC,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t