-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate softnpu from ry-working-softer-npu branch
- Loading branch information
1 parent
7394180
commit 55b64b7
Showing
17 changed files
with
448 additions
and
160 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ tools/cockroach* | |
/cockroachdb/ | ||
smf/nexus/root.json | ||
core | ||
*.vdev | ||
debug.out |
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,213 @@ | ||
= Boundary Services A-Z | ||
|
||
This document describes how to run a RAP environment with boundary services. | ||
It's a quick rundown and assumes knowledge of the basic setup described in the | ||
Running Omicron (Non-Simulated) document. | ||
|
||
== 0. Install softnpu ASIC emulator machinery | ||
|
||
---- | ||
./tools/install_softnpu_machinery.sh | ||
---- | ||
|
||
== 1. Setup virtual hardware | ||
|
||
---- | ||
pfexec ./tools/create_virtual_hardware.sh <wan interface> | ||
---- | ||
|
||
The virtual hardware is a bit different than what's currently being used. What | ||
we'll eventually wind up with looks like this. | ||
|
||
image::plumbing.png[] | ||
|
||
== 2. Build and install the control plane. | ||
|
||
---- | ||
./tools/create_self_signed_cert.sh | ||
cargo run --release --bin omicron-package -- package | ||
pfexec cargo run --release --bin omicron-package -- install | ||
---- | ||
|
||
The control plane is now starting, reference the Running Omicron (Non-Simulated) | ||
doc for more details on determining when things are ready to go. | ||
|
||
|
||
== 3. Launch and configure the softnpu zone | ||
|
||
Launch the zone. | ||
|
||
---- | ||
pfexec ./tools/scrimlet/create-softnpu-zone.sh | ||
---- | ||
|
||
Configure the softnpu zone. The following will drop you into a zone shell. | ||
|
||
---- | ||
pfexec zlogin softnpu | ||
---- | ||
|
||
Now run softnpu. | ||
|
||
---- | ||
root@scrimlet:~# cd /stuff/ | ||
root@scrimlet:/stuff# ./softnpu softnpu.toml | ||
Config { | ||
p4_program: "/stuff/libsidecar_lite.so", | ||
ports: [ | ||
Port { | ||
sidecar: "sc0_0", | ||
scrimlet: "sr0_0", | ||
mtu: 1600, | ||
}, | ||
Port { | ||
sidecar: "sc0_1", | ||
scrimlet: "sr0_1", | ||
mtu: 1500, | ||
}, | ||
], | ||
} | ||
---- | ||
|
||
Back in the global zone, softnpu can be configured. | ||
|
||
---- | ||
ry@korgano: cd /opt/softnpu/stuff | ||
ry@korgano: pfexec ./softnpu-init.sh | ||
[00:00:01] ######################################## 14.31 MiB/14.31 MiB done | ||
local v6: | ||
fe80::aae1:deff:fe01:701c | ||
fe80::aae1:deff:fe01:701d | ||
fd00:99::1 | ||
local v4: | ||
router v6: | ||
fd00:1122:3344:101::/64 -> fe80::aae1:deff:fe00:1 (1) | ||
router v4: | ||
0.0.0.0/0 -> 10.100.0.1 (2) | ||
resolver v4: | ||
10.100.0.1 -> 90:ec:77:2e:70:27 | ||
resolver v6: | ||
fe80::aae1:deff:fe00:1 -> a8:e1:de:00:00:01 | ||
nat_v4: | ||
10.100.0.6 1024/65535 -> fd00:1122:3344:101:: 8717766/a8:40:25:f0:51:75 | ||
nat_v6: | ||
port_mac: | ||
1: a8:e1:de:01:70:1c | ||
2: a8:e1:de:01:70:1d | ||
icmp_v6: | ||
icmp_v4: | ||
---- | ||
|
||
== 4. Populating the system | ||
|
||
Follow the | ||
https://github.com/oxidecomputer/meta/blob/master/engineering/remote-access-preview-demo-setup.adoc#setting-up-the-cli[RAP document] | ||
to set up IPs, images, disks, instances etc. Things to pay particular attention | ||
to here are the following. | ||
|
||
- The address range in the IP pool should be on a subnet in your local network that | ||
can NAT out to the Internet. | ||
- Be sure to set up an external IP for the instance you create. | ||
|
||
== 5. Configuring scrimlet/sidecar | ||
|
||
A this point we have an instance up and running. At the time of writing there is | ||
not control plane driven boundary services automation so we're going to | ||
configure the scrimlet it by hand. | ||
|
||
First we need to collect some information. In particular we need to know about | ||
the virtual network our instance is sitting on. We can get that info from | ||
`opteadm`. | ||
|
||
.... | ||
pfexec /opt/oxide/opte/bin/opteadm dump-v2p | ||
Virtual to Physical Mappings | ||
====================================================================== | ||
VPC 15103089 | ||
---------------------------------------------------------------------- | ||
IPv4 mappings | ||
---------------------------------------------------------------------- | ||
VPC IP VPC MAC ADDR UNDERLAY IP | ||
172.30.0.5 A8:40:25:F2:84:3F fd00:1122:3344:101::1 | ||
IPv6 mappings | ||
---------------------------------------------------------------------- | ||
VPC IP VPC MAC ADDR UNDERLAY IP | ||
.... | ||
|
||
The key pieces of information we need here are the following. Please note these | ||
will vary from instance to instance. | ||
|
||
1. The VNI = `15103089` | ||
2. The MAC = `A8:40:25:F2:84:3F` | ||
3. The underlay = `fd00:1122:3344:101::1` | ||
|
||
We also need to know what external IP has been assigned to our instance. The | ||
only way I know how to do this right now is by looking at the web console. Go to | ||
the instances page and navigate to the network tab. You'll see an External IP | ||
field in the table. Let's assume that is `10.100.0.6` for this example. | ||
|
||
Now we need to go tell boundary services about this information. | ||
|
||
Log back into the scrimlet VM | ||
|
||
---- | ||
./out/propolis/propolis-cli --server 127.0.0.1 serial | ||
---- | ||
|
||
Go back to the `/opt/cargo-bay` and open up `softnpu-init.sh` in an editor. | ||
There are a few things we need to edit here. Locate the line with the following | ||
content. | ||
|
||
---- | ||
./softnpuadm add-nat4 10.100.0.6 1024 65535 fd00:1122:3344:0101:: 8717766 a8:40:25:f0:51:75 | ||
---- | ||
|
||
Edit this line to use the information we gathered above. For the specific | ||
information I have for this run, this look like: | ||
|
||
---- | ||
./softnpuadm add-nat4 10.100.0.6 1024 65535 fd00:1122:3344:101::1 15103089 A8:40:25:F2:84:3F | ||
---- | ||
|
||
While editing this file, also note the comments guiding you to change the | ||
upstream gateway IP and MAC addresses. The MAC address is the same one you would | ||
use for the OPTE hack. The IP address honestly does not matter a whole lot for | ||
this setup since it's a default route. Just make sure the address used for the | ||
gateway IP is the same in both places. | ||
|
||
Now run | ||
|
||
---- | ||
./softnpu-init.sh | ||
---- | ||
|
||
This will reconfigure the ASIC (you could also run just | ||
`./softnpuadm remove-<x> ...` and `./softnpuadm add-<x>` if you feel like | ||
being more surgical) with a boundary services config that will give your | ||
instance access to the Internet. | ||
|
||
---- | ||
ry@korgano:~/omicron$ ~/propolis/target/release/propolis-cli --server fd00:1122:3344:101::c serial | ||
debian login: root | ||
Linux debian 5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 | ||
The programs included with the Debian GNU/Linux system are free software; | ||
the exact distribution terms for each program are described in the | ||
individual files in /usr/share/doc/*/copyright. | ||
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent | ||
permitted by applicable law. | ||
root@debian:~# host oxide.computer | ||
oxide.computer has address 76.76.21.61 | ||
oxide.computer has address 76.76.21.22 | ||
oxide.computer mail is handled by 5 alt2.aspmx.l.google.com. | ||
oxide.computer mail is handled by 1 aspmx.l.google.com. | ||
oxide.computer mail is handled by 10 aspmx3.googlemail.com. | ||
oxide.computer mail is handled by 5 alt1.aspmx.l.google.com. | ||
oxide.computer mail is handled by 10 aspmx2.googlemail.com. | ||
---- |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.