Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions crates/pxe/src/routes/cloud_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,13 @@ mod tests {
.unwrap();

// The loop should emit one assignment and invocation per bridge entry.
// Verify unavailable representors do not abort the remaining cloud-init work.
assert!(rendered.contains(
r#"set interface "${host_representor}" type=dpdk mtu_request=9216 external_ids='{}' || true"#
));
assert!(rendered.contains(
r#"ofport_request=$(ovs-vsctl get interface "${host_representor}" ofport) || true"#
));
assert!(rendered.contains("ovs-vsctl get bridge br-sfc external_ids"));
assert!(rendered.contains("ovs-vsctl --may-exist add-port br-sfc"));
assert!(rendered.contains(
Expand Down
5 changes: 3 additions & 2 deletions pxe/templates/user-data
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,12 @@ write_files:
# Adjust the sfc.conf to insert our patch port where the host representor used to be
sed -i "s#{{ forge_hbn_bridge }}~${host_representor}~${host_representor}_if_r~${host_representor}_if~${host_representor}_if_r#{{ forge_hbn_bridge }}~${host_intercept_hbn_port}~${host_representor}_if_r~${host_representor}_if~${host_representor}_if_r#" /etc/mellanox/sfc.conf

# Keep the OVSDB move when its backing host PF/VF is not available yet.
# Now pop the host representor off of br-hbn and attach it to the host intercept bridge
ovs-vsctl --if-exists del-port "${host_representor}" -- \
--may-exist add-port "${host_intercept_bridge_name}" "${host_representor}" -- \
set interface "${host_representor}" type=dpdk mtu_request=9216 external_ids='{}'
ovs-vsctl set interface "${host_representor}" ofport_request=$(ovs-vsctl get interface "${host_representor}" ofport)
set interface "${host_representor}" type=dpdk mtu_request=9216 external_ids='{}' || true
ovs-vsctl set interface "${host_representor}" ofport_request=$(ovs-vsctl get interface "${host_representor}" ofport) || true

# Add the detail about the "uplink" for this bridge to external ids for the bridge
ovs-vsctl br-set-external-id "${host_intercept_bridge_name}" bridge-uplink "${host_intercept_bridge_port}"
Expand Down
Loading