Skip to content

Commit

Permalink
Add option to force BPF attachment to native device
Browse files Browse the repository at this point in the history
Add a new DaemonConfig option ForceDeviceRequired which enforces the
attachment of the BPF program on native device. It is useful for the
testing and debugging purpose.

Signed-off-by: Yutaro Hayakawa <yutaro.hayakawa@isovalent.com>
  • Loading branch information
YutaroHayakawa authored and julianwiedmann committed Nov 17, 2023
1 parent 38a705b commit 48a1c96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/option/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2436,6 +2436,9 @@ type DaemonConfig struct {
// identity in a numeric identity. Values > 255 will decrease the number of
// allocatable identities.
MaxConnectedClusters uint32

// ForceDeviceRequired enforces the attachment of BPF programs on native device.
ForceDeviceRequired bool
}

var (
Expand Down Expand Up @@ -2596,7 +2599,7 @@ func (c *DaemonConfig) TunnelingEnabled() bool {
// devices to implement some features.
func (c *DaemonConfig) AreDevicesRequired() bool {
return c.EnableNodePort || c.EnableHostFirewall || c.EnableWireguard ||
c.EnableHighScaleIPcache || c.EnableL2Announcements
c.EnableHighScaleIPcache || c.EnableL2Announcements || c.ForceDeviceRequired
}

// MasqueradingEnabled returns true if either IPv4 or IPv6 masquerading is enabled.
Expand Down

0 comments on commit 48a1c96

Please sign in to comment.