Skip to content

Commit

Permalink
Merge branch 'main' into fix-4547
Browse files Browse the repository at this point in the history
  • Loading branch information
tommady authored Nov 15, 2024
2 parents 6b97c07 + 83aec7b commit 10343e4
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 64 deletions.
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ and this project adheres to

### Changed

- [#4913](https://github.com/firecracker-microvm/firecracker/pull/4913): Removed
unnecessary fields (`max_connections` and `max_pending_resets`) from the
snapshot format, bumping the snapshot version to 5.0.0. Users need to
regenerate snapshots.

### Deprecated

### Removed
Expand All @@ -22,8 +27,8 @@ and this project adheres to

### Changed

- [#4907](https://github.com/firecracker-microvm/firecracker/pull/4907): Bump
snapshot version to 4.0.0.
- [#4907](https://github.com/firecracker-microvm/firecracker/pull/4907): Bumped
the snapshot version to 4.0.0, so users need to regenerate snapshots.

## \[1.10.0\]

Expand Down
2 changes: 1 addition & 1 deletion docs/RELEASE_POLICY.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ v3.1 will be patched since were the last two Firecracker releases and less than

| Release | Release Date | Latest Patch | Min. end of support | Official end of Support |
| ------: | -----------: | -----------: | ------------------: | :------------------------------ |
| v1.10 | 2024-11-07 | v1.10.0 | 2025-05-07 | Supported |
| v1.10 | 2024-11-07 | v1.10.1 | 2025-05-07 | Supported |
| v1.9 | 2024-09-02 | v1.9.1 | 2025-03-02 | Supported |
| v1.8 | 2024-07-10 | v1.8.0 | 2025-01-10 | Supported |
| v1.7 | 2024-03-18 | v1.7.0 | 2024-09-18 | 2024-09-18 (end of 6mo support) |
Expand Down
45 changes: 9 additions & 36 deletions src/vmm/src/mmds/ns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,6 @@ impl MmdsNetworkStack {
mac_addr: MacAddr,
ipv4_addr: Ipv4Addr,
tcp_port: u16,
max_connections: NonZeroUsize,
max_pending_resets: NonZeroUsize,
mmds: Arc<Mutex<Mmds>>,
) -> Self {
MmdsNetworkStack {
Expand All @@ -93,8 +91,8 @@ impl MmdsNetworkStack {
tcp_handler: TcpIPv4Handler::new(
ipv4_addr,
tcp_port,
max_connections,
max_pending_resets,
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
),
mmds,
}
Expand All @@ -105,14 +103,7 @@ impl MmdsNetworkStack {
let ipv4_addr = mmds_ipv4_addr.unwrap_or_else(|| Ipv4Addr::from(DEFAULT_IPV4_ADDR));

// The unwrap()s are safe because the given literals are greater than 0.
Self::new(
mac_addr,
ipv4_addr,
DEFAULT_TCP_PORT,
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
mmds,
)
Self::new(mac_addr, ipv4_addr, DEFAULT_TCP_PORT, mmds)
}

pub fn set_ipv4_addr(&mut self, ipv4_addr: Ipv4Addr) {
Expand Down Expand Up @@ -562,14 +553,8 @@ mod tests {
let ip = Ipv4Addr::from(DEFAULT_IPV4_ADDR);
let other_ip = Ipv4Addr::new(5, 6, 7, 8);
let mac = MacAddr::from_bytes_unchecked(&[0; 6]);
let mut ns = MmdsNetworkStack::new(
mac,
ip,
DEFAULT_TCP_PORT,
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
Arc::new(Mutex::new(Mmds::default())),
);
let mut ns =
MmdsNetworkStack::new_with_defaults(Some(ip), Arc::new(Mutex::new(Mmds::default())));

let mut eth =
EthernetFrame::write_incomplete(buf.as_mut(), mac, mac, ETHERTYPE_ARP).unwrap();
Expand All @@ -589,14 +574,8 @@ mod tests {
let ip = Ipv4Addr::from(DEFAULT_IPV4_ADDR);
let other_ip = Ipv4Addr::new(5, 6, 7, 8);
let mac = MacAddr::from_bytes_unchecked(&[0; 6]);
let ns = MmdsNetworkStack::new(
mac,
ip,
DEFAULT_TCP_PORT,
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
Arc::new(Mutex::new(Mmds::default())),
);
let ns =
MmdsNetworkStack::new_with_defaults(Some(ip), Arc::new(Mutex::new(Mmds::default())));

let mut eth =
EthernetFrame::write_incomplete(buf.as_mut(), mac, mac, ETHERTYPE_IPV4).unwrap();
Expand All @@ -615,14 +594,8 @@ mod tests {
let ip = Ipv4Addr::from(DEFAULT_IPV4_ADDR);
let other_ip = Ipv4Addr::new(5, 6, 7, 8);
let mac = MacAddr::from_bytes_unchecked(&[0; 6]);
let mut ns = MmdsNetworkStack::new(
mac,
ip,
DEFAULT_TCP_PORT,
NonZeroUsize::new(DEFAULT_MAX_CONNECTIONS).unwrap(),
NonZeroUsize::new(DEFAULT_MAX_PENDING_RESETS).unwrap(),
Arc::new(Mutex::new(Mmds::default())),
);
let mut ns =
MmdsNetworkStack::new_with_defaults(Some(ip), Arc::new(Mutex::new(Mmds::default())));

// try IPv4 with detour_arp
let mut eth =
Expand Down
15 changes: 0 additions & 15 deletions src/vmm/src/mmds/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
//! Defines the structures needed for saving/restoring MmdsNetworkStack.

use std::net::Ipv4Addr;
use std::num::NonZeroUsize;
use std::sync::{Arc, Mutex};

use serde::{Deserialize, Serialize};
Expand All @@ -20,8 +19,6 @@ pub struct MmdsNetworkStackState {
mac_addr: [u8; MAC_ADDR_LEN as usize],
ipv4_addr: u32,
tcp_port: u16,
max_connections: NonZeroUsize,
max_pending_resets: NonZeroUsize,
}

impl Persist<'_> for MmdsNetworkStack {
Expand All @@ -37,8 +34,6 @@ impl Persist<'_> for MmdsNetworkStack {
mac_addr,
ipv4_addr: self.ipv4_addr.into(),
tcp_port: self.tcp_handler.local_port(),
max_connections: self.tcp_handler.max_connections(),
max_pending_resets: self.tcp_handler.max_pending_resets(),
}
}

Expand All @@ -50,8 +45,6 @@ impl Persist<'_> for MmdsNetworkStack {
MacAddr::from_bytes_unchecked(&state.mac_addr),
Ipv4Addr::from(state.ipv4_addr),
state.tcp_port,
state.max_connections,
state.max_pending_resets,
mmds,
))
}
Expand Down Expand Up @@ -83,13 +76,5 @@ mod tests {
restored_ns.tcp_handler.local_port(),
ns.tcp_handler.local_port()
);
assert_eq!(
restored_ns.tcp_handler.max_connections(),
ns.tcp_handler.max_connections()
);
assert_eq!(
restored_ns.tcp_handler.max_pending_resets(),
ns.tcp_handler.max_pending_resets()
);
}
}
2 changes: 1 addition & 1 deletion src/vmm/src/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ pub enum CreateSnapshotError {
}

/// Snapshot version
pub const SNAPSHOT_VERSION: Version = Version::new(4, 0, 0);
pub const SNAPSHOT_VERSION: Version = Version::new(5, 0, 0);

/// Creates a Microvm snapshot.
pub fn create_snapshot(
Expand Down
14 changes: 5 additions & 9 deletions tests/framework/utils_cpu_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,12 @@ def get_supported_cpu_templates():

SUPPORTED_CPU_TEMPLATES = get_supported_cpu_templates()

# Custom CPU templates for Aarch64 for testing
AARCH64_CUSTOM_CPU_TEMPLATES_G2 = ["v1n1"]
AARCH64_CUSTOM_CPU_TEMPLATES_G3 = [
"aarch64_with_sve_and_pac",
"v1n1",
]


def get_supported_custom_cpu_templates():
"""
Return the list of custom CPU templates supported by the platform.
"""
# pylint:disable=too-many-return-statements
host_linux = global_props.host_linux_version_tpl

match get_cpu_vendor(), global_props.cpu_codename:
Expand All @@ -65,9 +59,11 @@ def get_supported_custom_cpu_templates():
case CpuVendor.AMD, _:
return AMD_TEMPLATES
case CpuVendor.ARM, CpuModel.ARM_NEOVERSE_N1 if host_linux >= (6, 1):
return AARCH64_CUSTOM_CPU_TEMPLATES_G2
return ["v1n1"]
case CpuVendor.ARM, CpuModel.ARM_NEOVERSE_V1 if host_linux >= (6, 1):
return AARCH64_CUSTOM_CPU_TEMPLATES_G3
return ["v1n1", "aarch64_with_sve_and_pac"]
case CpuVendor.ARM, CpuModel.ARM_NEOVERSE_V1:
return ["aarch64_with_sve_and_pac"]
case _:
return []

Expand Down

0 comments on commit 10343e4

Please sign in to comment.