Skip to content

Commit

Permalink
network,passt: consider overhead when binding all ports
Browse files Browse the repository at this point in the history
When VMI uses Passt interface and doesn't specify ports, all the
ports are forwarded by Passt process.
Opening all the sockets for forwarding causes kernel to consume
considerable amount of memory.

At the moment, Passt binding can only be used on primary
interface, but since we need to loop over the VMI interfaces
anyway, there's no reason not to be generic and account for
each Passt binding with no specified Ports.

Signed-off-by: Radim Hrazdil <[email protected]>
  • Loading branch information
Radim Hrazdil committed Nov 3, 2022
1 parent 14e743a commit 6fd6e46
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/virt-controller/services/renderresources.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,14 @@ func GetMemoryOverhead(vmi *v1.VirtualMachineInstance, cpuArch string) *resource
overhead.Add(resource.MustParse("53Mi"))
}

// Additional overhead for each interface with Passt binding, that forwards all ports.
// More information can be found here: https://bugs.passt.top/show_bug.cgi?id=20
for _, net := range vmi.Spec.Domain.Devices.Interfaces {
if net.Passt != nil && len(net.Ports) == 0 {
overhead.Add(resource.MustParse("800Mi"))
}
}

return overhead
}

Expand Down

0 comments on commit 6fd6e46

Please sign in to comment.