Update to odulow per maintenance bronze
[o-du/phy.git] / docs / Setup-Configuration_fh.rst
1 ..    Copyright (c) 2019 Intel
2 ..
3 ..  Licensed under the Apache License, Version 2.0 (the "License");
4 ..  you may not use this file except in compliance with the License.
5 ..  You may obtain a copy of the License at
6 ..
7 ..      http://www.apache.org/licenses/LICENSE-2.0
8 ..
9 ..  Unless required by applicable law or agreed to in writing, software
10 ..  distributed under the License is distributed on an "AS IS" BASIS,
11 ..  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 ..  See the License for the specific language governing permissions and
13 ..  limitations under the License.
14
15 .. |br| raw:: html
16
17    <br />
18
19 Setup Configuration
20 ===================
21
22 A.1 Setup Configuration
23 -----------------------
24 The configuration shown in Figure 26 shows how to set up a test
25 environment to execute xRAN scenarios where O-DU and 0-RU are simulated
26 using the sample application. This setup allows development and
27 prototyping as well as testing of xRAN specific functionality. The O-DU
28 side can be instantiated with a full 5G NR L1 reference as well. The
29 configuration differences of the 5G NR l1app configuration are provided
30 below. Steps for running the sample application on the O-DU side and
31 0-RU side are the same, except configuration file options may be
32 different.
33
34 .. image:: images/Setup-for-xRAN-Testing.jpg
35   :width: 400
36   :alt: Figure 26. Setup for xRAN Testing
37
38 Figure 26. Setup for xRAN Testing
39
40 .. image:: images/Setup-for-xRAN-Testing-with-PHY-and-Configuration-C3.jpg
41   :width: 400
42   :alt: Figure 27. Setup for xRAN Testing with PHY and Configuration C3
43
44 Figure 27. Setup for xRAN Testing with PHY and Configuration C3
45
46 A.2 Prerequisites
47 -----------------
48 Each server in Figure 26 requires the following:
49
50 -  Wolfpass server according to recommended BOM for FlexRAN such as
51    Intel® Xeon® Skylake Gold 6148 FC-LGA3647 2.4 GHz 27.5 MB 150W 20
52    cores (two sockets)
53
54 -  BIOS settings:
55
56 -  Intel(R) Virtualization Technology Enabled
57
58 -  Intel(R) VT for Directed I/O - Enabled
59
60 -  ACS Control - Enabled
61
62 -  Coherency Support - Disabled
63
64 -  Front Haul networking cards:
65
66 -  Intel® Ethernet Converged Network Adapter XL710-QDA2
67
68 -  Intel® Ethernet Converged Network Adapter XXV710-DA2
69
70 -  Intel® FPGA Programmable Acceleration Card (Intel® FPGA PAC) N3000
71
72 **The Front Haul NIC requires support for PTP HW timestamping.**
73
74 The recommended configuration for NICs is::
75
76
77     ethtool -i enp33s0f0
78     driver: i40e
79     version: 2.10.19.82
80     firmware-version: 7.20 0x80007949 1.2585.0
81     expansion-rom-version:
82     bus-info: 0000:21:00.0
83     supports-statistics: yes
84     supports-test: yes
85     supports-eeprom-access: yes
86     supports-register-dump: yes
87     supports-priv-flags: yes
88     ethtool -T enp33s0f0
89     Time stamping parameters for enp33s0f0:
90     Capabilities:
91         hardware-transmit     (SOF_TIMESTAMPING_TX_HARDWARE)
92         software-transmit     (SOF_TIMESTAMPING_TX_SOFTWARE)
93         hardware-receive      (SOF_TIMESTAMPING_RX_HARDWARE)
94         software-receive      (SOF_TIMESTAMPING_RX_SOFTWARE)
95         software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
96         hardware-raw-clock    (SOF_TIMESTAMPING_RAW_HARDWARE)
97     PTP Hardware Clock: 4
98     Hardware Transmit Timestamp Modes:
99         off                   (HWTSTAMP_TX_OFF)
100         on                    (HWTSTAMP_TX_ON)
101     Hardware Receive Filter Modes:
102         none                  (HWTSTAMP_FILTER_NONE)
103         ptpv1-l4-sync         (HWTSTAMP_FILTER_PTP_V1_L4_SYNC)
104         ptpv1-l4-delay-req    (HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ)
105         ptpv2-l4-event        (HWTSTAMP_FILTER_PTP_V2_L4_EVENT)
106         ptpv2-l4-sync         (HWTSTAMP_FILTER_PTP_V2_L4_SYNC)
107         ptpv2-l4-delay-req    (HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ)
108         ptpv2-l2-event        (HWTSTAMP_FILTER_PTP_V2_L2_EVENT)
109         ptpv2-l2-sync         (HWTSTAMP_FILTER_PTP_V2_L2_SYNC)
110         ptpv2-l2-delay-req    (HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ)
111         ptpv2-event           (HWTSTAMP_FILTER_PTP_V2_EVENT)
112         ptpv2-sync            (HWTSTAMP_FILTER_PTP_V2_SYNC)
113         ptpv2-delay-req       (HWTSTAMP_FILTER_PTP_V2_DELAY_REQ)
114
115
116 A PTP Main Reference Clock is required to be available in the network to provide
117 synchronization of both O-DU and RU to GPS time.
118
119 1.Installing Intel® C++ Compiler v19.0.3 is preferred. or you could get
120 Intel® C++ Compiler through below link with community license,
121 however the version you could get is always latest version, the
122 verification for that version might not be performed yet, please
123 feedback through O-DU Low project WIKI page if you meet an issue. |br|
124 `https://software.intel.com/en-us/system-studio/choose-download <https://software.intel.com/en-us/system-studio/choose-download%20>`__
125
126 2.Download DPDK 19.11.
127
128 3.Change DPDK files according to below diff information which relevant to O-RAN FH::
129
130     diff --git a/drivers/net/i40e/i40e_ethdev.c
131     b/drivers/net/i40e/i40e_ethdev.c
132     
133     index 85a6a86..236fbe0 100644
134     
135     --- a/drivers/net/i40e/i40e_ethdev.c
136     
137     +++ b/drivers/net/i40e/i40e_ethdev.c
138     
139     @@ -2207,7 +2207,7 @@ void i40e_flex_payload_reg_set_default(struct
140     i40e_hw \*hw)
141     
142     /\* Map queues with MSIX interrupt \*/
143     
144     main_vsi->nb_used_qps = dev->data->nb_rx_queues -
145     
146     pf->nb_cfg_vmdq_vsi \* RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM;
147     
148     - i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
149     
150     + i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_NONE);
151     
152     i40e_vsi_enable_queues_intr(main_vsi);
153     
154     /\* Map VMDQ VSI queues with MSIX interrupt \*/
155     
156     @@ -2218,6 +2218,10 @@ void i40e_flex_payload_reg_set_default(struct
157     i40e_hw \*hw)
158     
159     i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
160     
161     }
162     
163     + i40e_aq_debug_write_global_register(hw,
164     
165     + 0x0012A504,
166     
167     + 0, NULL);
168     
169     +
170     
171     /\* enable FDIR MSIX interrupt \*/
172     
173     if (pf->fdir.fdir_vsi) {
174     
175     i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
176     
177     diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
178     b/drivers/net/i40e/i40e_ethdev_vf.c
179     
180     index 001c301..6f9ffdb 100644
181     
182     --- a/drivers/net/i40e/i40e_ethdev_vf.c
183     
184     +++ b/drivers/net/i40e/i40e_ethdev_vf.c
185     
186     @@ -640,7 +640,7 @@ struct rte_i40evf_xstats_name_off {
187     
188     map_info = (struct virtchnl_irq_map_info \*)cmd_buffer;
189     
190     map_info->num_vectors = 1;
191     
192     - map_info->vecmap[0].rxitr_idx = I40E_ITR_INDEX_DEFAULT;
193     
194     + map_info->vecmap[0].rxitr_idx = I40E_ITR_INDEX_NONE;
195     
196     map_info->vecmap[0].vsi_id = vf->vsi_res->vsi_id;
197     
198     /\* Alway use default dynamic MSIX interrupt \*/
199     
200     map_info->vecmap[0].vector_id = vector_id;
201     
202     diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
203     b/drivers/net/ixgbe/ixgbe_ethdev.c
204     
205     index 26b1927..018eb8f 100644
206     
207     --- a/drivers/net/ixgbe/ixgbe_ethdev.c
208     
209     +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
210     
211     @@ -3705,7 +3705,7 @@ static int
212     ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev \*dev,
213     
214     \* except for 82598EB, which remains constant.
215     
216     \*/
217     
218     if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE &&
219     
220     - hw->mac.type != ixgbe_mac_82598EB)
221     
222     + hw->mac.type != ixgbe_mac_82598EB && hw->mac.type !=
223     ixgbe_mac_82599EB)
224     
225     dev_info->max_tx_queues = IXGBE_NONE_MODE_TX_NB_QUEUES;
226     
227     }
228     
229     dev_info->min_rx_bufsize = 1024; /\* cf BSIZEPACKET in SRRCTL register
230     \*/
231     
232     diff --git a/lib/librte_eal/common/include/rte_dev.h
233     b/lib/librte_eal/common/include/rte_dev.h
234     
235     old mode 100644
236     
237     new mode 100755
238
239 5.Build and install DPDK::
240
241    [root@xran dpdk]# ./usertools/dpdk-setup.sh
242    
243    select [39] x86_64-native-linuxapp-icc
244    
245    select [46] Insert VFIO module
246    
247    exit [62] Exit Script
248
249 6.Make below file changes in dpdk that assure i40e to get best
250 latency of packet processing::
251
252     --- i40e.h 2018-11-30 11:27:00.000000000 +0000
253     
254     +++ i40e_patched.h 2019-03-06 15:49:06.877522427 +0000
255     
256     @@ -451,7 +451,7 @@
257     
258     #define I40E_QINT_RQCTL_VAL(qp, vector, nextq_type) \\
259     
260     (I40E_QINT_RQCTL_CAUSE_ENA_MASK \| \\
261     
262     - (I40E_RX_ITR << I40E_QINT_RQCTL_ITR_INDX_SHIFT) \| \\
263     
264     + (I40E_ITR_NONE << I40E_QINT_RQCTL_ITR_INDX_SHIFT) \| \\
265     
266     ((vector) << I40E_QINT_RQCTL_MSIX_INDX_SHIFT) \| \\
267     
268     ((qp) << I40E_QINT_RQCTL_NEXTQ_INDX_SHIFT) \| \\
269     
270     (I40E_QUEUE_TYPE_##nextq_type << I40E_QINT_RQCTL_NEXTQ_TYPE_SHIFT))
271     
272     --- i40e_main.c 2018-11-30 11:27:00.000000000 +0000
273     
274     +++ i40e_main_patched.c 2019-03-06 15:46:13.521518062 +0000
275     
276     @@ -15296,6 +15296,9 @@
277     
278     pf->hw_features \|= I40E_HW_HAVE_CRT_RETIMER;
279     
280     /\* print a string summarizing features \*/
281     
282     i40e_print_features(pf);
283     
284     +
285     
286     + /\* write to this register to clear rx descriptor \*/
287     
288     + i40e_aq_debug_write_register(hw, 0x0012A504, 0, NULL);
289     
290     return 0;
291     
292 A.3 Configuration of System
293 ---------------------------
294 1.Boot Linux with the following arguments::
295
296     cat /proc/cmdline
297     
298     BOOT_IMAGE=/vmlinuz-3.10.0-1062.12.1.rt56.1042.el7.x86_64 root=/dev/mapper/centos-root ro
299     crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap intel_iommu=on iommu=pt
300     usbcore.autosuspend=-1 selinux=0 enforcing=0 nmi_watchdog=0 softlockup_panic=0 audit=0
301     intel_pstate=disable cgroup_memory=1 cgroup_enable=memory mce=off idle=poll
302     hugepagesz=1G hugepages=16 hugepagesz=2M hugepages=0 default_hugepagesz=1G
303     isolcpus=1-19,21-39 rcu_nocbs=1-19,21-39 kthread_cpus=0,20 irqaffinity=0,20
304     nohz_full=1-19,21-39
305     
306 2.Download from Intel Website and install updated version of i40e
307 driver if needed. The current recommended version of i40e is 2.10.19.82. 
308 However, any latest version of i40e after  x2.9.21 expected to be functional for ORAN FH.
309
310 3.Identify PCIe Bus address of the Front Haul NIC::
311
312     lspci |grep Eth
313     19:00.0 Ethernet controller: Intel Corporation Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking (rev 02)
314     19:00.1 Ethernet controller: Intel Corporation Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking (rev 02)
315     1d:00.0 Ethernet controller: Intel Corporation Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking (rev 02)
316     1d:00.1 Ethernet controller: Intel Corporation Ethernet Controller XXV710 Intel(R) FPGA Programmable Acceleration Card N3000 for Networking (rev 02)
317     21:00.0 Ethernet controller: Intel Corporation Ethernet Controller XXV710 for 25GbE SFP28 (rev 02)
318     21:00.1 Ethernet controller: Intel Corporation Ethernet Controller XXV710 for 25GbE SFP28 (rev 02)
319     67:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722 for 10GBASE-T (rev 09)
320
321     
322 4.Identify the Ethernet device name::
323
324     ethtool -i enp33s0f0
325     driver: i40e
326     version: 2.10.19.82
327     firmware-version: 7.20 0x80007949 1.2585.0
328     expansion-rom-version:
329     bus-info: 0000:21:00.0
330     supports-statistics: yes
331     supports-test: yes
332     supports-eeprom-access: yes
333     supports-register-dump: yes
334     supports-priv-flags: yes
335     Enable
336
337
338 5.Enable two virtual functions (VF) on the device::
339
340     echo 2 > /sys/class/net/enp33s0f0/device/sriov_numvfs
341
342 More information about VFs supported by Intel NICs can be found at
343 https://doc.dpdk.org/guides/nics/intel_vf.html.
344
345 The resulting configuration can look like the listing below, where two
346 new VFs were added::
347
348     lspci|grep Eth
349     
350     21:00.0 Ethernet controller: Intel Corporation Ethernet Controller XXV710 for 25GbE SFP28 (rev 02)
351     21:00.1 Ethernet controller: Intel Corporation Ethernet Controller XXV710 for 25GbE SFP28 (rev 02)
352     21:02.0 Ethernet controller: Intel Corporation Ethernet Virtual Function 700 Series (rev 02)
353     21:02.1 Ethernet controller: Intel Corporation Ethernet Virtual Function 700 Series (rev 02)
354
355
356 6.Configure MAC address and VLAN settings for VFs for XRAN, based on
357 requirements for xRAN scenario and assignment of VLAN ID using IP
358 tool perform configuration of VF.
359     
360     Example where O-DU and O-RU simulation run on the same sytem::
361
362     #!/bin/bash
363     
364     echo 2 > /sys/bus/pci/devices/0000\:21\:00.0/sriov_numvfs
365     ip link set enp33s0f0 vf 1 mac 00:11:22:33:44:66 vlan 1
366     ip link set enp33s0f0 vf 0 mac 00:11:22:33:44:66 vlan 2
367     echo 2 > /sys/bus/pci/devices/0000\:21\:00.1/sriov_numvfs
368     ip link set enp33s0f1 vf 1 mac 00:11:22:33:44:55 vlan 1
369     ip link set enp33s0f1 vf 0 mac 00:11:22:33:44:55 vlan 2
370     
371     where output is next::
372     
373     [root@xran app]# ip link show
374     
375     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
376     
377     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
378     
379     2: enp25s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
380     
381     link/ether 64:4c:36:10:1f:30 brd ff:ff:ff:ff:ff:ff
382     
383     3: enp25s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
384     
385     link/ether 64:4c:36:10:1f:31 brd ff:ff:ff:ff:ff:ff
386     
387     4: enp29s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
388     
389     link/ether 64:4c:36:10:1f:34 brd ff:ff:ff:ff:ff:ff
390     
391     5: enp29s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
392     
393     link/ether 64:4c:36:10:1f:35 brd ff:ff:ff:ff:ff:ff
394     
395     6: enp33s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
396     
397     link/ether 3c:fd:fe:b9:f8:b4 brd ff:ff:ff:ff:ff:ff
398     
399     vf 0 MAC 00:11:22:33:44:66, vlan 2, spoof checking on, link-state auto, trust off
400     
401     vf 1 MAC 00:11:22:33:44:66, vlan 1, spoof checking on, link-state auto, trust off
402     
403     7: enp33s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
404     
405     link/ether 3c:fd:fe:b9:f8:b5 brd ff:ff:ff:ff:ff:ff
406     
407     vf 0 MAC 00:11:22:33:44:55, vlan 2, spoof checking on, link-state auto, trust off
408     
409     vf 1 MAC 00:11:22:33:44:55, vlan 1, spoof checking on, link-state auto, trust off
410     
411     8: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
412     
413     link/ether a4:bf:01:3e:1f:be brd ff:ff:ff:ff:ff:ff
414     
415     9: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
416     
417     link/ether a4:bf:01:3e:1f:bf brd ff:ff:ff:ff:ff:ff
418     
419     10: npacf0g0l0: <LOWER_UP> mtu 9600 qdisc noop state UNKNOWN mode DEFAULT group default qlen 1000
420     
421     link/generic
422     
423     11: npacf0g0l1: <LOWER_UP> mtu 9600 qdisc noop state UNKNOWN mode DEFAULT group default qlen 1000
424     
425     link/generic
426     
427     12: npacf0g0l2: <LOWER_UP> mtu 9600 qdisc noop state UNKNOWN mode DEFAULT group default qlen 1000
428     
429     link/generic
430     
431     13: npacf0g0l3: <LOWER_UP> mtu 9600 qdisc noop state UNKNOWN mode DEFAULT group default qlen 1000
432     
433     link/generic
434
435 After this step FH NIC is configured.
436
437 O-DU
438  
439 VF for C-plane is VF1 on PFH enp33s0f0enp216s0f0, it has ETH mac address 00:11:22:33:44:66 and VLAN tag 1. PCIe Bus address is VF1 is 21d8:02.1
440
441 VF for U-plane is VF0 on PFH enp33s0f0enp216s0f0, it has ETH mac address 00:11:22:33:44:66 and VLAN tag 2. PCIe Bus address is VF1 is 21d8:02.0
442
443 O-RU
444
445 VF for C-plane is VF1 on PF enp33s0f1, it has ETH mac address 00:11:22:33:44:55 and VLAN tag 1. PCIe Bus address is VF1 is 21:0a.1
446
447 VF for U-plane is VF0 on PF enp33s0f1, it has ETH mac address 00:11:22:33:44:55 and VLAN tag 2. PCIe Bus address is VF1 is 21:0a.0
448
449
450 A.4 Install and Configure Sample Application
451 --------------------------------------------
452 To install and configure the sample application:
453
454 1. Set up the environment:
455
456    export GTEST_ROOT=`pwd`/gtest-1.7.0
457    
458    export RTE_SDK=`pwd`/dpdk-19.11
459    
460    export RTE_TARGET=x86_64-native-linuxapp-icc
461    
462    export MLOG_DIR=`pwd`/flexran_l1_sw/libs/mlog
463    
464    export XRAN_DIR=`pwd`/flexran_xran
465
466 2. Compile xRAN library and test the application:
467
468    [turner@xran home]$ cd $XRAN_DIR
469    
470    [turner@xran xran]$ ./build.sh
471    
472 3. Configure the sample app.
473
474 IQ samples can be generated using Octave\* and script
475 libs/xran/app/gen_test.m. (CentOS\* has octave-3.8.2-20.el7.x86_64
476 compatible with get_test.m)
477
478 Other IQ sample test vectors can be used as well. The format of IQ
479 samples is binary int16_t I and Q for N slots of the OTA RF signal. For
480 example, for mmWave, it corresponds to 792RE*2*14symbol*8slots*10 ms =
481 3548160 bytes per antenna. Refer to comments in gen_test.m to correctly
482 specify the configuration for IQ test vector generation.
483
484 Update config_file_o_du.dat (or config_file_o_ru.dat) with a suitable
485 configuration for your scenario.
486
487 Update run_o_du.sh (run_o_ru.sh) with PCIe bus address of VF0 and VF1
488 used for U-plane and C-plane correspondingly::
489
490     ./build/sample-app -c ./usecase/mu0_10mhz/config_file_o_du.dat -p 2 0000:21d8:02.0 0000:21d8:02.1
491
492 4. Run application using run_o_du.sh (run_o_ru.sh).
493
494
495