Skip to content

Commit

Permalink
Add bond hash policy
Browse files Browse the repository at this point in the history
  • Loading branch information
shibaPuppy committed Apr 25, 2023
1 parent b656f5c commit 1b2a764
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
5 changes: 5 additions & 0 deletions api/v1beta1/metal3datatemplate_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,10 @@ type NetworkDataLinkBond struct {
// balance-rr, active-backup, balance-xor, broadcast, balance-tlb, balance-alb, 802.3ad
BondMode string `json:"bondMode"`

// Selects the transmit hash policy used for port selection in balance-xor and 802.3ad modes
// +optional
BondHashPolicy string `json:"bond_xmit_hash_policy"`

// Id is the ID of the interface (used for naming)
Id string `json:"id"` //nolint:revive,stylecheck

Expand All @@ -238,6 +242,7 @@ type NetworkDataLinkBond struct {
MACAddress *NetworkLinkEthernetMac `json:"macAddress"`

// BondLinks is the list of links that are part of the bond.
// +optional
BondLinks []string `json:"bondLinks"`
}

Expand Down
13 changes: 7 additions & 6 deletions baremetal/metal3data_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -727,12 +727,13 @@ func renderNetworkLinks(networkLinks infrav1.NetworkDataLink, bmh *bmov1alpha1.B
return nil, err
}
data = append(data, map[string]interface{}{
"type": "bond",
"id": link.Id,
"mtu": link.MTU,
"ethernet_mac_address": macAddress,
"bond_mode": link.BondMode,
"bond_links": link.BondLinks,
"type": "bond",
"id": link.Id,
"mtu": link.MTU,
"ethernet_mac_address": macAddress,
"bond_mode": link.BondMode,
"bond_xmit_hash_policy": link.BondHashPolicy,
"bond_links": link.BondLinks,
})
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1146,6 +1146,10 @@ spec:
description: NetworkDataLinkBond represents a bond link
object.
properties:
bond_xmit_hash_policy:
description: Selects the transmit hash policy used for
port selection in balance-xor and 802.3ad modes
type: string
bondLinks:
description: BondLinks is the list of links that are
part of the bond.
Expand Down Expand Up @@ -1189,7 +1193,6 @@ spec:
maximum: 9000
type: integer
required:
- bondLinks
- bondMode
- id
- macAddress
Expand Down

0 comments on commit 1b2a764

Please sign in to comment.