Skip to content

Commit f404999

Browse files
committed
Edit es2k-linux-networking-frr document
- Continue long command lines. - Simplify/repair indentation. Signed-off-by: Derek G Foster <[email protected]>
1 parent 2fc896d commit f404999

File tree

1 file changed

+69
-44
lines changed

1 file changed

+69
-44
lines changed

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

Lines changed: 69 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ System under test will have above topology running the networking recipe. Link P
3838
## Create P4 artifacts and start Infrap4d process
3939

4040
- 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](/guides/es2k/running-infrap4d.md) for compiling `P4 artifacts`, `bringing up ACC` and running `infrap4d` on ACC.
41+
- See [Running Infrap4d on Intel IPU E2100](/guides/es2k/running-infrap4d.md) for compiling `P4 artifacts`, `bringing up ACC` and running `infrap4d` on ACC.
4242

4343
## Creating the topology
4444

@@ -50,7 +50,8 @@ Once the application is started, set the forwarding pipeline config using
5050
P4Runtime Client `p4rt-ctl` set-pipe command
5151

5252
```bash
53-
$P4CP_INSTALL/bin/p4rt-ctl set-pipe br0 $OUTPUT_DIR/linux_networking.pb.bin $OUTPUT_DIR/linux_networking.p4info.txt
53+
$P4CP_INSTALL/bin/p4rt-ctl set-pipe br0 $OUTPUT_DIR/linux_networking.pb.bin \
54+
$OUTPUT_DIR/linux_networking.p4info.txt
5455
```
5556

5657
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.
@@ -63,7 +64,8 @@ Use one of the IPDF netdevs on ACC to receive all control packets from overlay V
6364
# SEM_DIRECT_MAP_PGEN_CTRL: LSB 11-bit is for vsi which need to map into vsig
6465
devmem 0x20292002a0 64 0x8000050000000008
6566

66-
# SEM_DIRECT_MAP_PGEN_DATA_VSI_GROUP : This will set vsi (set in SEM_DIRECT_MAP_PGEN_CTRL register LSB) into VSIG-3
67+
# SEM_DIRECT_MAP_PGEN_DATA_VSI_GROUP : This will set vsi
68+
# (set in SEM_DIRECT_MAP_PGEN_CTRL register LSB) into VSIG-3
6769
devmem 0x2029200388 64 0x3
6870

6971
# SEM_DIRECT_MAP_PGEN_CTRL: LSB 11-bit is for vsi which need to map into vsig
@@ -89,8 +91,8 @@ ip addr add 99.0.0.2/24 dev <Netdev connected to VF2>
8991
ifconfig <Netdev connected to VF> up
9092
```
9193

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
94+
Option 2: If we are unable to spawn VM's on top of the VF's, we can leverage kernel network namespaces.
95+
Move each VF to a network namespace and assign IP addresses:
9496

9597
```bash
9698
ip netns add VM0
@@ -111,25 +113,26 @@ Legacy OvS is used as a control plane for source MAC learning of overlay VM's. O
111113
```bash
112114
export RUN_OVS=/tmp
113115
rm -rf $RUN_OVS/etc/openvswitch
114-
rm -rf $RUN_OVS/var/run/openvswitch
116+
rm -rf $RUN_OVS/var/run/openvswitch
115117
mkdir -p $RUN_OVS/etc/openvswitch/
116118
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
119+
120+
ovsdb-tool create $RUN_OVS/etc/openvswitch/conf.db \
121+
/opt/p4/p4-cp-nws/share/openvswitch/vswitch.ovsschema
119122

120123
ovsdb-server $RUN_OVS/etc/openvswitch/conf.db \
121124
--remote=punix:$RUN_OVS/var/run/openvswitch/db.sock \
122125
--remote=db:Open_vSwitch,Open_vSwitch,manager_options \
123126
--pidfile=$RUN_OVS/var/run/openvswitch/ovsdb-server.pid \
124127
--unixctl=$RUN_OVS/var/run/openvswitch/ovsdb-server.ctl \
125-
--detach
128+
--detach
126129

127130
ovs-vswitchd --detach \
128131
--pidfile=$RUN_OVS/var/run/openvswitch/ovs-vswitchd.pid \
129132
--no-chdir unix:$RUN_OVS/var/run/openvswitch/db.sock \
130133
--unixctl=$RUN_OVS/var/run/openvswitch/ovs-vswitchd.ctl \
131134
--mlockall \
132-
--log-file=/tmp/ovs-vswitchd.log
135+
--log-file=/tmp/ovs-vswitchd.log
133136

134137
alias ovs-vsctl="ovs-vsctl --db unix:$RUN_OVS/var/run/openvswitch/db.sock"
135138
ovs-vsctl set Open_vSwitch . other_config:n-revalidator-threads=1
@@ -149,10 +152,11 @@ ifconfig vlan1 up
149152
ifconfig vlan2 up
150153
```
151154

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'`
155+
Note: Here the assumption is, we have created 2 overlay VM's and creating
156+
2 port representers for those VM's. Port representer should always be in
157+
the format: `lowercase string 'vlan'+'vlanID'`
154158

155-
### Create intergation bridge and add ports to the bridge
159+
### Create integration bridge and add ports to the bridge
156160

157161
Create OvS bridge, VxLAN tunnel and assign ports to the bridge.
158162

@@ -165,7 +169,8 @@ ovs-vsctl add-port br-int vlan2
165169
ifconfig vlan1 up
166170
ifconfig vlan2 up
167171

168-
ovs-vsctl add-port br-int vxlan1 -- set interface vxlan1 type=vxlan options:local_ip=30.1.1.1 options:remote_ip=40.1.1.1 options:dst_port=4789
172+
ovs-vsctl add-port br-int vxlan1 -- set interface vxlan1 type=vxlan \
173+
options:local_ip=30.1.1.1 options:remote_ip=40.1.1.1 options:dst_port=4789
169174
```
170175

171176
Note: Here we are creating VxLAN tunnel with VNI 0, you can create any VNI for tunneling.
@@ -179,38 +184,54 @@ Below configuration assumes
179184
- Overlay VF1 has a VSI value 14
180185
- Overlay VF2 has a VSI value 15
181186

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
187+
These VSI values can be checked with `/usr/bin/cli_client -q -c` command on IMC.
188+
This command provides VSI ID, Vport ID, and corresponding MAC addresses for all:
183189

184190
- IDPF netdevs on ACC
185191
- VF's on HOST
186192
- IDPF netdevs on HOST (if IDPF driver loaded by you on HOST)
187193
- Netdevs on IMC
188194

189195
```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"
196+
# Rules for control packets coming from overlay VF (VSI-14).
197+
# IPU will add a VLAN tag 1 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 \
200+
"vmeta.common.vsi=14,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.add_vlan_and_send_to_port(1,24)"
201+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_host_to_ovs_table \
202+
"vmeta.common.vsi=14,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(24)"
203+
p4rt-ctl add-entry br0 linux_networking_control.vlan_push_mod_table \
204+
"vmeta.common.mod_blob_ptr=1,action=linux_networking_control.vlan_push(1,0,1)"
205+
206+
# Rules for control packets coming from overlay VF (VSI-15).
207+
# IPU will add a VLAN tag 2 and send to HOST1 (VSI-8).
208+
209+
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_host_to_ovs_and_ovs_to_wire_table \
210+
"vmeta.common.vsi=15,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.add_vlan_and_send_to_port(2,24)"
211+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_host_to_ovs_table \
212+
"vmeta.common.vsi=15,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(24)"
213+
p4rt-ctl add-entry br0 linux_networking_control.vlan_push_mod_table \
214+
"vmeta.common.mod_blob_ptr=2,action=linux_networking_control.vlan_push(1,0,2)"
215+
216+
# Rules for control packets coming from HOST1 (VSI-8).
217+
# IPU will remove the VLAN tag 1 and send to overlay VF (VSI-14).
218+
219+
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_ovs_to_host_table \
220+
"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)"
221+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_ovs_to_host_table \
222+
"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)"
223+
p4rt-ctl add-entry br0 linux_networking_control.vlan_pop_mod_table \
224+
"vmeta.common.mod_blob_ptr=1,action=linux_networking_control.vlan_pop"
225+
226+
# Rules for control packets coming from HOST1 (VSI-8).
227+
# IPU will remove the VLAN tag 2 and send to overlay VF (VSI-15).
228+
229+
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_ovs_to_host_table \
230+
"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)"
231+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_loopback_from_ovs_to_host_table \
232+
"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)"
233+
p4rt-ctl add-entry br0 linux_networking_control.vlan_pop_mod_table \
234+
"vmeta.common.mod_blob_ptr=2,action=linux_networking_control.vlan_pop"
214235
```
215236

216237
### Configure rules for underlay control packets
@@ -224,22 +245,26 @@ Below configuration assumes
224245

225246
```bash
226247
# 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)"
248+
p4rt-ctl add-entry br0 linux_networking_control.handle_rx_from_wire_to_ovs_table \
249+
"vmeta.common.port_id=0,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(26)"
228250

229251
# 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)"
252+
p4rt-ctl add-entry br0 linux_networking_control.handle_tx_from_host_to_ovs_and_ovs_to_wire_table \
253+
"vmeta.common.vsi=10,user_meta.cmeta.bit32_zeros=0,action=linux_networking_control.set_dest(0)"
231254
```
232255

233256
### Underlay configuration
234257

235-
Create a dummy interface which is used for TEP termination and IDPF netdev for underlay connectivity. Use BGP protocol with FRR, for route redistribution.
258+
Create a dummy interface which is used for TEP termination and IDPF netdev for
259+
underlay connectivity. Use BGP protocol with FRR, for route redistribution.
236260

237261
Below configuration assumes
238262

239263
- Underlay IDPF netdev has a VSI value 10
240264

241265
```bash
242-
p4rt-ctl add-entry br0 linux_networking_control.ecmp_lpm_root_lut "user_meta.cmeta.bit32_zeros=4/255.255.255.255,priority=2,action=linux_networking_control.ecmp_lpm_root_lut_action(0)"
266+
p4rt-ctl add-entry br0 linux_networking_control.ecmp_lpm_root_lut \
267+
"user_meta.cmeta.bit32_zeros=4/255.255.255.255,priority=2,action=linux_networking_control.ecmp_lpm_root_lut_action(0)"
243268

244269
nmcli device set <IDPF netdev for VSI 10> managed no
245270
ip link add dev TEP0 type dummy
@@ -248,7 +273,7 @@ ip link add dev TEP0 type dummy
248273
FRR running configuration
249274

250275
```bash
251-
# <Install FRR on ACC and enable BGP protocol>
276+
# <Install FRR on ACC and enable BGP protocol>
252277
# <FRR VTYSH running configuration>
253278

254279
interface TEP0

0 commit comments

Comments
 (0)