forked from lf-edge/eve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement configurable device port MTU.
User is now able to set the MTU inside the Network object assigned to device network port (aka SystemAdapter). By default (if not set), EVE will set the default MTU size, which depends on the network adapter type. Ethernet and WiFi adapters default to 1500 bytes, while cellular modems typically receive their MTU value from the network provider, which EVE will use unless the user overrides the MTU value. For Ethernet and WiFi ports, MTU is applied by NIM microservice. For cellular modems, MTU is managed by the wwan microservice. As part of this commit, few changes in the area of config items of DPC Reconciler were done. For example, PhysIf and IOHandle were refactored into: - NetIO: represents existence of a NIC (previously the purpose of PhysIf) - PhysIf: replacing IOHandle and additionally managing the network interface created for the NIC by the kernel (currently only the MTU attribute is managed) Please note that this commit does not include MTU support for network instances and applications. That part of the MTU support was split and will be delivered as a separate commit. Signed-off-by: Milan Lenco <milan@zededa.com>
- Loading branch information
1 parent
141f6d5
commit 1f5fa9c
Showing
15 changed files
with
730 additions
and
365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright (c) 2022 Zededa, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package genericitems | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/lf-edge/eve-libs/depgraph" | ||
) | ||
|
||
// IOUsage : how is network IO being used. | ||
type IOUsage uint8 | ||
|
||
const ( | ||
// IOUsageUnspecified : not specified how the network IO is being used. | ||
IOUsageUnspecified IOUsage = iota | ||
// IOUsageL3Adapter : network IO is used as L3 adapter. | ||
IOUsageL3Adapter | ||
// IOUsageVlanParent : network IO is used as VLAN parent interface. | ||
IOUsageVlanParent | ||
// IOUsageBondAggrIf : network IO is aggregated by Bond interface. | ||
IOUsageBondAggrIf | ||
) | ||
|
||
// NetIO : network IO device. | ||
// External item used to represent a presence of a NIC (or lack of it). | ||
type NetIO struct { | ||
// LogicalLabel : interface name used by the controller. | ||
LogicalLabel string | ||
// IfName : Interface name assigned by the OS. | ||
IfName string | ||
} | ||
|
||
// Name returns the interface name. | ||
func (n NetIO) Name() string { | ||
return n.IfName | ||
} | ||
|
||
// Label returns the logical label. | ||
func (n NetIO) Label() string { | ||
return n.LogicalLabel + " (IO)" | ||
} | ||
|
||
// Type of the item. | ||
func (n NetIO) Type() string { | ||
return NetIOTypename | ||
} | ||
|
||
// Equal is a comparison method for two equally-named NetIO instances. | ||
// It is NOOP, no attributes to compare. | ||
func (n NetIO) Equal(depgraph.Item) bool { | ||
return true | ||
} | ||
|
||
// External returns true because we learn about a presence of a network IO device | ||
// through the NetworkMonitor. | ||
func (n NetIO) External() bool { | ||
return true | ||
} | ||
|
||
// String describes the network IO device. | ||
func (n NetIO) String() string { | ||
return fmt.Sprintf("Network IO device: %#+v", n) | ||
} | ||
|
||
// Dependencies returns nothing (external item). | ||
func (n NetIO) Dependencies() (deps []depgraph.Dependency) { | ||
return nil | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.