Skip to content

Commit 2fc896d

Browse files
authored
Edit es2k-linux-networking-ipv6 document (#299)
- Reflow overly long text lines. - Continue long command lines. - Simplify/repair indentation. - Correct internal link. Signed-off-by: Derek G Foster <[email protected]>
1 parent 24fda4e commit 2fc896d

File tree

1 file changed

+114
-57
lines changed

1 file changed

+114
-57
lines changed

docs/apps/lnw/es2k/es2k-linux-networking-ipv6.md

Lines changed: 114 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,37 @@ This document explains how to run the Linux networking scenario on ES2K.
2828

2929
Notes about topology:
3030

31-
- Four Kernel netdevs are created by default by loading IDPF driver during ACC bring-up. You can also create more than Four netdevs. For that, we need to modify `acc_apf` parameter under `num_default_vport` in `/etc/dpcp/cfg/cp_init.cfg` on IMC before starting `run_default_init_app`.
32-
- In `/etc/dpcp/cfg/cp_init.cfg` file also modify default `sem_num_pages` value to the value mentioned in `/opt/p4/p4sde/share/mev_reference_p4_files/linux_networking/README_P4_CP_NWS`.
33-
- vlan1, vlan2, .... vlanN created using Linux commands and are on top of an IDPF Netdev. These VLAN ports should be equal to number of VM's that are spawned.
34-
- br-int, VxLAN ports are created using ovs-vsctl command provided by the networking recipe and all the vlan ports are attached to br-int using ovs-vsctl command.
31+
- Four Kernel netdevs are created by default by loading IDPF driver during
32+
ACC bring-up. You can also create more than Four netdevs. For that, we
33+
need to modify `acc_apf` parameter under `num_default_vport` in
34+
`/etc/dpcp/cfg/cp_init.cfg` on IMC before starting `run_default_init_app`.
3535

36-
System under test will have above topology running the networking recipe. Link Partner can have the networking recipe or legacy OvS or kernel VxLAN. Note the [Limitations](#limitations) section before setting up the topology.
36+
- In `/etc/dpcp/cfg/cp_init.cfg` file also modify default `sem_num_pages`
37+
value to the value mentioned in
38+
`/opt/p4/p4sde/share/mev_reference_p4_files/linux_networking/README_P4_CP_NWS`.
39+
40+
- vlan1, vlan2, .... vlanN created using Linux commands and are on top of
41+
an IDPF Netdev. These VLAN ports should be equal to number of VM's that
42+
are spawned.
43+
44+
- br-int, VxLAN ports are created using ovs-vsctl command provided by the
45+
networking recipe and all the vlan ports are attached to br-int using
46+
ovs-vsctl command.
47+
48+
System under test will have above topology running the networking recipe.
49+
Link Partner can have the networking recipe or legacy OvS or kernel VxLAN.
50+
Note the [Limitations](#limitations) section before setting up the
51+
topology.
3752

3853
## Create P4 artifacts and start Infrap4d process
3954

40-
- Use Linux networking p4 program present in the directory `/opt/p4/p4sde/share/mev_reference_p4_files/linux_networking` for this scenario.
41-
- Refer to [Running Infrap4d on Intel IPU E2100](https://github.com/ipdk-io/networking-recipe/blob/main/docs/guides/es2k/running-infrap4d.md) for compiling `P4 artifacts`, `bringing up ACC` and running `infrap4d` on ACC.
55+
- Use Linux networking p4 program present in the directory
56+
`/opt/p4/p4sde/share/mev_reference_p4_files/linux_networking` for this
57+
scenario.
58+
59+
- See [Running Infrap4d on Intel IPU E2100](/guides/es2k/running-infrap4d)
60+
for compiling `P4 artifacts`, `bringing up ACC` and running `infrap4d` on
61+
ACC.
4262

4363
## Creating the topology
4464

@@ -50,27 +70,35 @@ Once the application is started, set the forwarding pipeline config using
5070
P4Runtime Client `p4rt-ctl` set-pipe command
5171

5272
```bash
53-
$P4CP_INSTALL/bin/p4rt-ctl set-pipe br0 $OUTPUT_DIR/linux_networking.pb.bin $OUTPUT_DIR/linux_networking.p4info.txt
73+
$P4CP_INSTALL/bin/p4rt-ctl set-pipe br0 $OUTPUT_DIR/linux_networking.pb.bin \
74+
$OUTPUT_DIR/linux_networking.p4info.txt
5475
```
5576

56-
Note: Assuming `linux_networking.pb.bin` and `linux_networking.p4info.txt` along with other P4 artifacts are created as per the steps mentioned in previous section.
77+
Note: Assuming `linux_networking.pb.bin` and `linux_networking.p4info.txt`
78+
along with other P4 artifacts are created as per the steps mentioned in
79+
previous section.
5780

5881
### Configure VSI Group and add a netdev
5982

60-
Use one of the IPDF netdevs on ACC to receive all control packets from overlay VM's by assigning to a VSI group. VSI group 3 is dedicated for this configuration, execute below devmem commands on IMC.
83+
Use one of the IPDF netdevs on ACC to receive all control packets from
84+
overlay VM's by assigning to a VSI group. VSI group 3 is dedicated for
85+
this configuration, execute below devmem commands on IMC.
6186

6287
```bash
6388
# SEM_DIRECT_MAP_PGEN_CTRL: LSB 11-bit is for vsi which need to map into vsig
6489
devmem 0x20292002a0 64 0x8000050000000008
6590

66-
# SEM_DIRECT_MAP_PGEN_DATA_VSI_GROUP : This will set vsi (set in SEM_DIRECT_MAP_PGEN_CTRL register LSB) into VSIG-3
91+
# SEM_DIRECT_MAP_PGEN_DATA_VSI_GROUP : This will set vsi
92+
# (set in SEM_DIRECT_MAP_PGEN_CTRL register LSB) into VSIG-3.
6793
devmem 0x2029200388 64 0x3
6894

6995
# SEM_DIRECT_MAP_PGEN_CTRL: LSB 11-bit is for vsi which need to map into vsig
7096
devmem 0x20292002a0 64 0xA000050000000008
7197
```
7298

73-
Note: Here VSI 8 has been used for receiving all control packets and added to VSI group 3. This refers to HOST netdev VSIG 3 as per the topology diagram. Modify this VSI based on your configuration.
99+
Note: Here VSI 8 has been used for receiving all control packets and added
100+
to VSI group 3. This refers to HOST netdev VSIG 3 as per the topology
101+
diagram. Modify this VSI based on your configuration.
74102

75103
### Create Overlay network
76104

@@ -89,8 +117,9 @@ ip -6 addr add 9::2/64 <Netdev connected to VF2>
89117
ifconfig <Netdev connected to VF> up
90118
```
91119

92-
Option 2: If we are unable to spawn VM's on top of the VF's, for this use case we can also leverage kernel network namespaces.
93-
Move each VF to a network namespace and assign IP addresses
120+
Option 2: If we are unable to spawn VM's on top of the VF's, for this use
121+
case we can also leverage kernel network namespaces. Move each VF to a
122+
network namespace and assign IP addresses
94123

95124
```bash
96125
ip netns add VM0
@@ -106,30 +135,32 @@ ip netns exec VM1 ifconfig <VF2 port> up
106135

107136
### Start OvS as a separate process
108137

109-
Legacy OvS is used as a control plane for source MAC learning of overlay VM's. OvS should be started as a seperate process.
138+
Legacy OvS is used as a control plane for source MAC learning of overlay
139+
VM's. OvS should be started as a seperate process.
110140

111141
```bash
112142
export RUN_OVS=/tmp
113143
rm -rf $RUN_OVS/etc/openvswitch
114-
rm -rf $RUN_OVS/var/run/openvswitch
144+
rm -rf $RUN_OVS/var/run/openvswitch
115145
mkdir -p $RUN_OVS/etc/openvswitch/
116146
mkdir -p $RUN_OVS/var/run/openvswitch
117-
118-
ovsdb-tool create $RUN_OVS/etc/openvswitch/conf.db /opt/p4/p4-cp-nws/share/openvswitch/vswitch.ovsschema
147+
148+
ovsdb-tool create $RUN_OVS/etc/openvswitch/conf.db \
149+
/opt/p4/p4-cp-nws/share/openvswitch/vswitch.ovsschema
119150

120151
ovsdb-server $RUN_OVS/etc/openvswitch/conf.db \
121152
--remote=punix:$RUN_OVS/var/run/openvswitch/db.sock \
122153
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
123154
--pidfile=$RUN_OVS/var/run/openvswitch/ovsdb-server.pid \
124155
--unixctl=$RUN_OVS/var/run/openvswitch/ovsdb-server.ctl \
125-
--detach
156+
--detach
126157

127158
ovs-vswitchd --detach \
128159
--pidfile=$RUN_OVS/var/run/openvswitch/ovs-vswitchd.pid \
129160
--no-chdir unix:$RUN_OVS/var/run/openvswitch/db.sock \
130161
--unixctl=$RUN_OVS/var/run/openvswitch/ovs-vswitchd.ctl \
131162
--mlockall \
132-
--log-file=/tmp/ovs-vswitchd.log
163+
--log-file=/tmp/ovs-vswitchd.log
133164

134165
alias ovs-vsctl="ovs-vsctl --db unix:$RUN_OVS/var/run/openvswitch/db.sock"
135166
ovs-vsctl set Open_vSwitch . other_config:n-revalidator-threads=1
@@ -140,7 +171,9 @@ ovs-vsctl show
140171

141172
### Create VLAN representers
142173

143-
For each VM that is spawned for overlay network we need to have a port representer. We create VLAN netdevs on top of the IPDF netdev which is assigned to VSI group 3 in step-2 mentioned above.
174+
For each VM that is spawned for overlay network we need to have a port
175+
representer. We create VLAN netdevs on top of the IPDF netdev which is
176+
assigned to VSI group 3 in step-2 mentioned above.
144177

145178
```bash
146179
ip link add link <VSI 8> name vlan1 type vlan id 1
@@ -149,10 +182,11 @@ ifconfig vlan1 up
149182
ifconfig vlan2 up
150183
```
151184

152-
Note: Here the assumption is, we have created 2 overlay VM's and creating 2 port representers for those VM's.
153-
Port representer should always be in the format: `lowercase string 'vlan'+'vlanID'`
185+
Note: Here the assumption is, we have created 2 overlay VM's and creating
186+
2 port representers for those VM's. Port representer should always be in
187+
the format: `lowercase string 'vlan'+'vlanID'`
154188

155-
### Create intergation bridge and add ports to the bridge
189+
### Create integration bridge and add ports to the bridge
156190

157191
Create OvS bridge, VxLAN tunnel and assign ports to the bridge.
158192

@@ -165,52 +199,72 @@ ovs-vsctl add-port br-int vlan2
165199
ifconfig vlan1 up
166200
ifconfig vlan2 up
167201

168-
ovs-vsctl add-port br-int vxlan0 -- set interface vxlan0 type=vxlan options:local_ip=1000:1::1 options:remote_ip=1000:1::2 options:dst_port=4789
202+
ovs-vsctl add-port br-int vxlan0 -- set interface vxlan0 type=vxlan \
203+
options:local_ip=1000:1::1 options:remote_ip=1000:1::2 options:dst_port=4789
169204
```
170205

171-
Note: Here we are creating VxLAN tunnel with VNI 0, you can create any VNI for tunneling.
206+
Note: Here we are creating VxLAN tunnel with VNI 0, you can create any VNI
207+
for tunneling.
172208

173209
### Configure rules for overlay control packets
174210

175-
Configure rules to send overlay control packets from a VM to its respective port representers.
211+
Configure rules to send overlay control packets from a VM to its
212+
respective port representers.
176213

177214
Below configuration assumes
178215

179216
- Overlay VF1 has a VSI value 14
180217
- Overlay VF2 has a VSI value 15
181218

182-
These VSI values can be checked with `/usr/bin/cli_client -q -c` command on IMC. This command provides VSI ID, Vport ID, and corresponding MAC addresses for all
219+
These VSI values can be checked with `/usr/bin/cli_client -q -c` command
220+
on IMC. This command provides VSI ID, Vport ID, and corresponding MAC
221+
addresses for all:
183222

184223
- IDPF netdevs on ACC
185224
- VF's on HOST
186225
- IDPF netdevs on HOST (if IDPF driver loaded by you on HOST)
187226
- Netdevs on IMC
188227

189228
```bash
190-
191-
# Rules for control packets coming from overlay VF(VSI-14), IPU will add a VLAN tag 1 and send to HOST1(VSI-8)
192-
193-
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_host_to_ovs_and_ovs_to_wire_table "vmeta.common.vsi=14,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.add_vlan_and_send_to_port(1,24)"
194-
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_host_to_ovs_table "vmeta.common.vsi=14,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(24)"
195-
p4rt-ctl add-entry br0 linux_networking_control.vlan_push_mod_table "vmeta.common.mod_blob_ptr=1,action=linux_networking_control.vlan_push(1,0,1)"
196-
197-
# Rules for control packets coming from overlay VF(VSI-15), IPU will add a VLAN tag 2 and send to HOST1(VSI-8)
198-
199-
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_host_to_ovs_and_ovs_to_wire_table "vmeta.common.vsi=15,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.add_vlan_and_send_to_port(2,24)"
200-
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_host_to_ovs_table "vmeta.common.vsi=15,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(24)"
201-
p4rt-ctl add-entry br0 linux_networking_control.vlan_push_mod_table "vmeta.common.mod_blob_ptr=2,action=linux_networking_control.vlan_push(1,0,2)"
202-
203-
# Rules for control packets coming from HOST1(VSI-8), IPU will remove the VLAN tag 1 and send to overlay VF(VSI-14)
204-
205-
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_ovs_to_host_table "vmeta.common.vsi=8,hdrs.dot1q_tag[vmeta.common.depth].hdr.vid=1,action=linux_networking_control.remove_vlan_and_send_to_port(1,30)"
206-
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_ovs_to_host_table "vmeta.misc_internal.vm_to_vm_or_port_to_port[27:17]=14,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(30)"
207-
p4rt-ctl add-entry br0 linux_networking_control.vlan_pop_mod_table "vmeta.common.mod_blob_ptr=1,action=linux_networking_control.vlan_pop"
208-
209-
# Rules for control packets coming from HOST1(VSI-8), IPU will remove the VLAN tag 2 and send to overlay VF(VSI-15)
210-
211-
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_ovs_to_host_table "vmeta.common.vsi=8,hdrs.dot1q_tag[vmeta.common.depth].hdr.vid=2,action=linux_networking_control.remove_vlan_and_send_to_port(2,31)"
212-
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_ovs_to_host_table "vmeta.misc_internal.vm_to_vm_or_port_to_port[27:17]=15,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(31)"
213-
p4rt-ctl add-entry br0 linux_networking_control.vlan_pop_mod_table "vmeta.common.mod_blob_ptr=2,action=linux_networking_control.vlan_pop"
229+
# Rules for control packets coming from overlay VF (VSI-14).
230+
# IPU will add a VLAN tag 1 and send to HOST1 (VSI-8).
231+
232+
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_host_to_ovs_and_ovs_to_wire_table \
233+
"vmeta.common.vsi=14,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.add_vlan_and_send_to_port(1,24)"
234+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_host_to_ovs_table \
235+
"vmeta.common.vsi=14,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(24)"
236+
p4rt-ctl add-entry br0 linux_networking_control.vlan_push_mod_table \
237+
"vmeta.common.mod_blob_ptr=1,action=linux_networking_control.vlan_push(1,0,1)"
238+
239+
# Rules for control packets coming from overlay VF (VSI-15).
240+
# IPU will add a VLAN tag 2 and send to HOST1 (VSI-8).
241+
242+
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_host_to_ovs_and_ovs_to_wire_table \
243+
"vmeta.common.vsi=15,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.add_vlan_and_send_to_port(2,24)"
244+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_host_to_ovs_table \
245+
"vmeta.common.vsi=15,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(24)"
246+
p4rt-ctl add-entry br0 linux_networking_control.vlan_push_mod_table \
247+
"vmeta.common.mod_blob_ptr=2,action=linux_networking_control.vlan_push(1,0,2)"
248+
249+
# Rules for control packets coming from HOST1 (VSI-8).
250+
# IPU will remove the VLAN tag 1 and send to overlay VF (VSI-14).
251+
252+
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_ovs_to_host_table \
253+
"vmeta.common.vsi=8,hdrs.dot1q_tag[vmeta.common.depth].hdr.vid=1,action=linux_networking_control.remove_vlan_and_send_to_port(1,30)"
254+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_ovs_to_host_table \
255+
"vmeta.misc_internal.vm_to_vm_or_port_to_port[27:17]=14,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(30)"
256+
p4rt-ctl add-entry br0 linux_networking_control.vlan_pop_mod_table \
257+
"vmeta.common.mod_blob_ptr=1,action=linux_networking_control.vlan_pop"
258+
259+
# Rules for control packets coming from HOST1 (VSI-8).
260+
# IPU will remove the VLAN tag 2 and send to overlay VF (VSI-15).
261+
262+
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_ovs_to_host_table \
263+
"vmeta.common.vsi=8,hdrs.dot1q_tag[vmeta.common.depth].hdr.vid=2,action=linux_networking_control.remove_vlan_and_send_to_port(2,31)"
264+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_ovs_to_host_table \
265+
"vmeta.misc_internal.vm_to_vm_or_port_to_port[27:17]=15,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(31)"
266+
p4rt-ctl add-entry br0 linux_networking_control.vlan_pop_mod_table \
267+
"vmeta.common.mod_blob_ptr=2,action=linux_networking_control.vlan_pop"
214268
```
215269

216270
### Configure rules for underlay control packets
@@ -223,11 +277,13 @@ Below configuration assumes
223277
- First physical port will have a port ID of 0
224278

225279
```bash
226-
# Configuration for control packets between physical port 0 to underlay IDPF netdev VSI-10
227-
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_from_wire_to_ovs_table "vmeta.common.port_id=0,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(26)"
280+
# Configuration for control packets between physical port 0 and underlay IDPF netdev VSI-10
281+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_from_wire_to_ovs_table \
282+
"vmeta.common.port_id=0,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(26)"
228283

229-
# Configuration for control packets between underlay IDPF netdev VSI-10 to physical port 0
230-
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_host_to_ovs_and_ovs_to_wire_table "vmeta.common.vsi=10,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(0)"
284+
# Configuration for control packets between underlay IDPF netdev VSI-10 and physical port 0
285+
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_host_to_ovs_and_ovs_to_wire_table \
286+
"vmeta.common.vsi=10,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(0)"
231287
```
232288

233289
### Underlay configuration
@@ -239,7 +295,8 @@ Below configuration assumes
239295
- Underlay IDPF netdev has a VSI value 10
240296

241297
```bash
242-
p4rt-ctl add-entry br0 linux_networking_control.ipv6_lpm_root_lut "user_meta.cmeta.bit32_zeros=0/255.255.255.255,priority=1,action=linux_networking_control.ipv6_lpm_root_lut_action(0)"
298+
p4rt-ctl add-entry br0 linux_networking_control.ipv6_lpm_root_lut \
299+
"user_meta.cmeta.bit32_zeros=0/255.255.255.255,priority=1,action=linux_networking_control.ipv6_lpm_root_lut_action(0)"
243300

244301
nmcli device set <IDPF netdev for VSI 10> managed no
245302
ip -6 addr add 1000:1::1/64 dev <IDPF netdev for VSI 10>

0 commit comments

Comments
 (0)