5108267037f8cdfd055cbdd95fc6b11b13e75d33
[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 enp216s0f0
78     
79     driver: i40e
80     
81     version: 2.9.21
82     
83     firmware-version: 6.80 0x80003d05 1.2007.0
84     
85     expansion-rom-version:
86     
87     bus-info: 0000:d8:00.0
88     
89     supports-statistics: yes
90     
91     supports-test: yes
92     
93     supports-eeprom-access: yes
94     
95     supports-register-dump: yes
96     
97     supports-priv-flags: yes
98     
99    [root@5gnr-sc12-xran testmac]# ethtool -T enp216s0f0::
100    
101    
102    Time stamping parameters for enp216s0f0:
103    
104    Capabilities:
105    
106    hardware-transmit (SOF_TIMESTAMPING_TX_HARDWARE)
107    
108    software-transmit (SOF_TIMESTAMPING_TX_SOFTWARE)
109    
110    hardware-receive (SOF_TIMESTAMPING_RX_HARDWARE)
111    
112    software-receive (SOF_TIMESTAMPING_RX_SOFTWARE)
113    
114    software-system-clock (SOF_TIMESTAMPING_SOFTWARE)
115    
116    hardware-raw-clock (SOF_TIMESTAMPING_RAW_HARDWARE)
117    
118    PTP Hardware Clock: 2
119    
120    Hardware Transmit Timestamp Modes:
121    
122    off (HWTSTAMP_TX_OFF)
123    
124    on (HWTSTAMP_TX_ON)
125    
126    Hardware Receive Filter Modes:
127    
128    none (HWTSTAMP_FILTER_NONE)
129    
130    ptpv1-l4-sync (HWTSTAMP_FILTER_PTP_V1_L4_SYNC)
131    
132    ptpv1-l4-delay-req (HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ)
133    
134    ptpv2-l4-event (HWTSTAMP_FILTER_PTP_V2_L4_EVENT)
135    
136    ptpv2-l4-sync (HWTSTAMP_FILTER_PTP_V2_L4_SYNC)
137    
138    ptpv2-l4-delay-req (HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ)
139    
140    ptpv2-l2-event (HWTSTAMP_FILTER_PTP_V2_L2_EVENT)
141    
142    ptpv2-l2-sync (HWTSTAMP_FILTER_PTP_V2_L2_SYNC)
143    
144    ptpv2-l2-delay-req (HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ)
145    
146    ptpv2-event (HWTSTAMP_FILTER_PTP_V2_EVENT)
147    
148    ptpv2-sync (HWTSTAMP_FILTER_PTP_V2_SYNC)
149    
150    ptpv2-delay-req (HWTSTAMP_FILTER_PTP_V2_DELAY_REQ)
151
152 PTP Grand Master is required to be available in the network to provide
153 synchronization of both O-DU and RU to GPS time.
154
155 The software package includes Linux\* CentOS\* operating system and RT
156 patch according to *Cloud-Native*-platform *Setup* document (refer to
157 Table 2). Only real-time HOST is required.
158
159 1.Installing Intel® C++ Compiler v19.0.3 is preferred. or you could get
160 Intel® C++ Compiler through below link with community license,
161 however the version you could get is always latest version, the
162 verification for that version might not be performed yet, please
163 feedback through O-DU Low project WIKI page if you meet an issue. |br|
164 `https://software.intel.com/en-us/system-studio/choose-download <https://software.intel.com/en-us/system-studio/choose-download%20>`__
165
166 2.Download DPDK 18.08.
167
168 3.With FlexRAN BBDev patch as per release 20.02. (Note currently this may require a license from Intel)
169
170 4.Change DPDK files according to below diff information which relevant to O-RAN FH::
171
172     diff --git a/drivers/net/i40e/i40e_ethdev.c
173     b/drivers/net/i40e/i40e_ethdev.c
174     
175     index 85a6a86..236fbe0 100644
176     
177     --- a/drivers/net/i40e/i40e_ethdev.c
178     
179     +++ b/drivers/net/i40e/i40e_ethdev.c
180     
181     @@ -2207,7 +2207,7 @@ void i40e_flex_payload_reg_set_default(struct
182     i40e_hw \*hw)
183     
184     /\* Map queues with MSIX interrupt \*/
185     
186     main_vsi->nb_used_qps = dev->data->nb_rx_queues -
187     
188     pf->nb_cfg_vmdq_vsi \* RTE_LIBRTE_I40E_QUEUE_NUM_PER_VM;
189     
190     - i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_DEFAULT);
191     
192     + i40e_vsi_queues_bind_intr(main_vsi, I40E_ITR_INDEX_NONE);
193     
194     i40e_vsi_enable_queues_intr(main_vsi);
195     
196     /\* Map VMDQ VSI queues with MSIX interrupt \*/
197     
198     @@ -2218,6 +2218,10 @@ void i40e_flex_payload_reg_set_default(struct
199     i40e_hw \*hw)
200     
201     i40e_vsi_enable_queues_intr(pf->vmdq[i].vsi);
202     
203     }
204     
205     + i40e_aq_debug_write_global_register(hw,
206     
207     + 0x0012A504,
208     
209     + 0, NULL);
210     
211     +
212     
213     /\* enable FDIR MSIX interrupt \*/
214     
215     if (pf->fdir.fdir_vsi) {
216     
217     i40e_vsi_queues_bind_intr(pf->fdir.fdir_vsi,
218     
219     diff --git a/drivers/net/i40e/i40e_ethdev_vf.c
220     b/drivers/net/i40e/i40e_ethdev_vf.c
221     
222     index 001c301..6f9ffdb 100644
223     
224     --- a/drivers/net/i40e/i40e_ethdev_vf.c
225     
226     +++ b/drivers/net/i40e/i40e_ethdev_vf.c
227     
228     @@ -640,7 +640,7 @@ struct rte_i40evf_xstats_name_off {
229     
230     map_info = (struct virtchnl_irq_map_info \*)cmd_buffer;
231     
232     map_info->num_vectors = 1;
233     
234     - map_info->vecmap[0].rxitr_idx = I40E_ITR_INDEX_DEFAULT;
235     
236     + map_info->vecmap[0].rxitr_idx = I40E_ITR_INDEX_NONE;
237     
238     map_info->vecmap[0].vsi_id = vf->vsi_res->vsi_id;
239     
240     /\* Alway use default dynamic MSIX interrupt \*/
241     
242     map_info->vecmap[0].vector_id = vector_id;
243     
244     diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c
245     b/drivers/net/ixgbe/ixgbe_ethdev.c
246     
247     index 26b1927..018eb8f 100644
248     
249     --- a/drivers/net/ixgbe/ixgbe_ethdev.c
250     
251     +++ b/drivers/net/ixgbe/ixgbe_ethdev.c
252     
253     @@ -3705,7 +3705,7 @@ static int
254     ixgbevf_dev_xstats_get_names(__rte_unused struct rte_eth_dev \*dev,
255     
256     \* except for 82598EB, which remains constant.
257     
258     \*/
259     
260     if (dev_conf->txmode.mq_mode == ETH_MQ_TX_NONE &&
261     
262     - hw->mac.type != ixgbe_mac_82598EB)
263     
264     + hw->mac.type != ixgbe_mac_82598EB && hw->mac.type !=
265     ixgbe_mac_82599EB)
266     
267     dev_info->max_tx_queues = IXGBE_NONE_MODE_TX_NB_QUEUES;
268     
269     }
270     
271     dev_info->min_rx_bufsize = 1024; /\* cf BSIZEPACKET in SRRCTL register
272     \*/
273     
274     diff --git a/lib/librte_eal/common/include/rte_dev.h
275     b/lib/librte_eal/common/include/rte_dev.h
276     
277     old mode 100644
278     
279     new mode 100755
280
281 5.Build and install DPDK::
282
283    [root@xran dpdk]# ./usertools/dpdk-setup.sh
284    
285    select [16] x86_64-native-linuxapp-icc
286    
287    select [19] Insert VFIO module
288    
289    exit [35] Exit Script
290
291 6.Make below file changes in dpdk that assure i40e to get best
292 latency of packet processing::
293
294     --- i40e.h 2018-11-30 11:27:00.000000000 +0000
295     
296     +++ i40e_patched.h 2019-03-06 15:49:06.877522427 +0000
297     
298     @@ -451,7 +451,7 @@
299     
300     #define I40E_QINT_RQCTL_VAL(qp, vector, nextq_type) \\
301     
302     (I40E_QINT_RQCTL_CAUSE_ENA_MASK \| \\
303     
304     - (I40E_RX_ITR << I40E_QINT_RQCTL_ITR_INDX_SHIFT) \| \\
305     
306     + (I40E_ITR_NONE << I40E_QINT_RQCTL_ITR_INDX_SHIFT) \| \\
307     
308     ((vector) << I40E_QINT_RQCTL_MSIX_INDX_SHIFT) \| \\
309     
310     ((qp) << I40E_QINT_RQCTL_NEXTQ_INDX_SHIFT) \| \\
311     
312     (I40E_QUEUE_TYPE_##nextq_type << I40E_QINT_RQCTL_NEXTQ_TYPE_SHIFT))
313     
314     --- i40e_main.c 2018-11-30 11:27:00.000000000 +0000
315     
316     +++ i40e_main_patched.c 2019-03-06 15:46:13.521518062 +0000
317     
318     @@ -15296,6 +15296,9 @@
319     
320     pf->hw_features \|= I40E_HW_HAVE_CRT_RETIMER;
321     
322     /\* print a string summarizing features \*/
323     
324     i40e_print_features(pf);
325     
326     +
327     
328     + /\* write to this register to clear rx descriptor \*/
329     
330     + i40e_aq_debug_write_register(hw, 0x0012A504, 0, NULL);
331     
332     return 0;
333     
334 A.3 Configuration of System
335 ---------------------------
336 1.Boot Linux with the following arguments::
337
338     cat /proc/cmdline
339     
340     BOOT_IMAGE=/vmlinuz-3.10.0-957.10.1.rt56.921.el7.x86_64
341     root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root
342     rd.lvm.lv=centos/swap intel_iommu=on iommu=pt usbcore.autosuspend=-1
343     selinux=0 enforcing=0 nmi_watchdog=0 softlockup_panic=0 audit=0
344     intel_pstate=disable cgroup_memory=1 cgroup_enable=memory mce=off
345     idle=poll hugepagesz=1G hugepages=40 hugepagesz=2M hugepages=0
346     default_hugepagesz=1G isolcpus=1-19,21-39 rcu_nocbs=1-19,21-39
347     kthread_cpus=0,20 irqaffinity=0,20 nohz_full=1-19,21-39
348     
349 2.Download from Intel Website and install updated version of i40e
350 driver if needed. The current recommended version of i40e is x2.9.21.
351
352 3.Identify PCIe Bus address of the Front Haul NIC::
353
354     lspci \|grep Eth
355     
356     19:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit
357     SFI/SFP+ Network Connection (rev 01)
358     
359     19:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit
360     SFI/SFP+ Network Connection (rev 01)
361     
362     41:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722
363     for 10GBASE-T (rev 04)
364     
365     41:00.1 Ethernet controller: Intel Corporation Ethernet Connection X722
366     for 10GBASE-T (rev 04)
367     
368     d8:00.0 Ethernet controller: Intel Corporation Ethernet Controller XL710
369     for 40GbE QSFP+ (rev 02) <<< port used for FH
370     
371     d8:00.1 Ethernet controller: Intel Corporation Ethernet Controller XL710
372     for 40GbE QSFP+ (rev 02)
373     
374 4.Identify the Ethernet device name::
375
376     ethtool -i enp216s0f0
377     
378     driver: i40e
379     
380     version: 2.9.21
381     
382     firmware-version: 6.80 0x80003d05 1.2007.0
383     
384     expansion-rom-version:
385     
386     bus-info: 0000:d8:00.0
387     
388     supports-statistics: yes
389     
390     supports-test: yes
391     
392     supports-eeprom-access: yes
393     
394     supports-register-dump: yes
395     
396     supports-priv-flags: yes
397
398 5.Enable two virtual functions (VF) on the device::
399
400     echo 2 > /sys/class/net/enp216s0f0/device/sriov_numvfs
401
402 More information about VFs supported by Intel NICs can be found at
403 https://doc.dpdk.org/guides/nics/intel_vf.html.
404
405 The resulting configuration can look like the listing below, where two
406 new VFs were added::
407
408     lspci|grep Eth
409     
410     19:00.0 Ethernet controller: Intel Corporation 82599ES 10-Gigabit
411     SFI/SFP+ Network Connection (rev 01)
412     
413     19:00.1 Ethernet controller: Intel Corporation 82599ES 10-Gigabit
414     SFI/SFP+ Network Connection (rev 01)
415     
416     41:00.0 Ethernet controller: Intel Corporation Ethernet Connection X722
417     for 10GBASE-T (rev 04)
418     
419     41:00.1 Ethernet controller: Intel Corporation Ethernet Connection X722
420     for 10GBASE-T (rev 04)
421     
422     d8:00.0 Ethernet controller: Intel Corporation Ethernet Controller XL710
423     for 40GbE QSFP+ (rev 02)
424     
425     d8:00.1 Ethernet controller: Intel Corporation Ethernet Controller XL710
426     for 40GbE QSFP+ (rev 02)
427     
428     d8:02.0 Ethernet controller: Intel Corporation XL710/X710 Virtual
429     Function (rev 02)
430     
431     d8:02.1 Ethernet controller: Intel Corporation XL710/X710 Virtual
432     Function (rev 02)
433
434 6.Configure MAC address and VLAN settings for VFs for XRAN, based on
435 requirements for xRAN scenario and assignment of VLAN ID using IP
436 tool perform configuration of VF as shown below::
437
438     [root@xran app]# ip link set enp216s0f0 vf 0 mac 00:11:22:33:44:66 vlan
439     2
440     
441     [root@xran app]# ip link set enp216s0f0 vf 1 mac 00:11:22:33:44:66 vlan
442     1
443     
444     [root@xran app]# ip link show
445     
446     1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode
447     DEFAULT qlen 1
448     
449     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
450     
451     2: enp65s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state
452     UP mode DEFAULT qlen 1000
453     
454     link/ether a4:bf:01:3e:6b:79 brd ff:ff:ff:ff:ff:ff
455     
456     3: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP
457     mode DEFAULT qlen 1000
458     
459     link/ether a4:bf:01:3e:6b:7a brd ff:ff:ff:ff:ff:ff
460     
461     4: enp25s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state
462     UP mode DEFAULT qlen 1000
463     
464     link/ether 90:e2:ba:d3:b2:ec brd ff:ff:ff:ff:ff:ff
465     
466     5: enp129s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq
467     state DOWN mode DEFAULT qlen 1000
468     
469     link/ether 3c:fd:fe:a8:e0:70 brd ff:ff:ff:ff:ff:ff
470     
471     6: enp129s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq
472     state DOWN mode DEFAULT qlen 1000
473     
474     link/ether 3c:fd:fe:a8:e0:71 brd ff:ff:ff:ff:ff:ff
475     
476     7: enp216s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state
477     UP mode DEFAULT qlen 1000
478     
479     link/ether 3c:fd:fe:9e:93:68 brd ff:ff:ff:ff:ff:ff
480     
481     vf 0 MAC 00:11:22:33:44:66, vlan 2, spoof checking on, link-state auto,
482     trust off
483     
484     vf 1 MAC 00:11:22:33:44:66, vlan 1, spoof checking on, link-state auto,
485     trust off
486     
487     8: enp25s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq
488     state DOWN mode DEFAULT qlen 1000
489     
490     link/ether 90:e2:ba:d3:b2:ed brd ff:ff:ff:ff:ff:ff
491     
492     9: enp216s0f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state
493     UP mode DEFAULT qlen 1000
494     
495     link/ether 3c:fd:fe:9e:93:69 brd ff:ff:ff:ff:ff:ff
496     
497     12: enp216s2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state
498     UP mode DEFAULT qlen 1000
499     
500     link/ether 96:fa:4d:04:4d:87 brd ff:ff:ff:ff:ff:ff
501     
502     13: enp216s2f1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq
503     state UP mode DEFAULT qlen 1000
504     
505     link/ether a6:67:49:bb:bd:5e brd ff:ff:ff:ff:ff:ff
506
507 After this step FH NIC is configured.
508
509 VF for C-plane is VF1 on PH enp216s0f0, it has ETH mac address
510 00:11:22:33:44:66 and VLAN tag 1. PCIe Bus address is VF1 is d8:02.1
511
512 VF for U-plane is VF0 on PH enp216s0f0, it has ETH mac address
513 00:11:22:33:44:66 and VLAN tag 2. PCIe Bus address is VF1 is d8:02.0
514
515 A.4 Install and Configure Sample Application
516 --------------------------------------------
517 To install and configure the sample application:
518
519 1. Set up the environment:
520
521    export GTEST_ROOT=`pwd`/gtest-1.7.0
522    
523    export RTE_SDK=`pwd`/dpdk-18.08
524    
525    export RTE_TARGET=x86_64-native-linuxapp-icc
526    
527    export MLOG_DIR=`pwd`/flexran_l1_sw/libs/mlog
528    
529    export XRAN_DIR=`pwd`/flexran_xran
530
531 2. Compile xRAN library and test the application:
532
533    [turner@xran home]$ cd $XRAN_DIR
534    
535    [turner@xran xran]$ ./build.sh
536    
537 3. Configure the sample app.
538
539 IQ samples can be generated using Octave\* and script
540 libs/xran/app/gen_test.m. (CentOS\* has octave-3.8.2-20.el7.x86_64
541 compatible with get_test.m)
542
543 Other IQ sample test vectors can be used as well. The format of IQ
544 samples is binary int16_t I and Q for N slots of the OTA RF signal. For
545 example, for mmWave, it corresponds to 792RE*2*14symbol*8slots*10 ms =
546 3548160 bytes per antenna. Refer to comments in gen_test.m to correctly
547 specify the configuration for IQ test vector generation.
548
549 Update config_file_o_du.dat (or config_file_o_ru.dat) with a suitable
550 configuration for your scenario.
551
552 Update run_o_du.sh (run_o_ru.sh) with PCIe bus address of VF0 and VF1
553 used for U-plane and C-plane correspondingly::
554
555     ./build/sample-app ./usecase/mu0_10mhz/config_file_o_du.dat 0000:d8:02.0
556     0000:d8:02.1
557
558 4. Run application using run_o_du.sh (run_o_ru.sh).
559
560
561