11ffee690SAmr Mokhtar.. SPDX-License-Identifier: BSD-3-Clause 21ffee690SAmr Mokhtar Copyright(c) 2017 Intel Corporation 31ffee690SAmr Mokhtar 41ffee690SAmr Mokhtar.. bbdev_app: 51ffee690SAmr Mokhtar 61ffee690SAmr MokhtarLoop-back Sample Application using Baseband Device (bbdev) 71ffee690SAmr Mokhtar========================================================== 81ffee690SAmr Mokhtar 91ffee690SAmr MokhtarThe baseband sample application is a simple example of packet processing using 101ffee690SAmr Mokhtarthe Data Plane Development Kit (DPDK) for baseband workloads using Wireless 111ffee690SAmr MokhtarDevice abstraction library. 121ffee690SAmr Mokhtar 131ffee690SAmr MokhtarOverview 141ffee690SAmr Mokhtar-------- 151ffee690SAmr Mokhtar 161ffee690SAmr MokhtarThe Baseband device sample application performs a loop-back operation using a 171ffee690SAmr Mokhtarbaseband device capable of transceiving data packets. 181ffee690SAmr MokhtarA packet is received on an ethernet port -> enqueued for downlink baseband 191ffee690SAmr Mokhtaroperation -> dequeued from the downlink baseband device -> enqueued for uplink 201ffee690SAmr Mokhtarbaseband operation -> dequeued from the baseband device -> then the received 211ffee690SAmr Mokhtarpacket is compared with the baseband operations output. Then it's looped back to 221ffee690SAmr Mokhtarthe ethernet port. 231ffee690SAmr Mokhtar 241ffee690SAmr Mokhtar* The MAC header is preserved in the packet 251ffee690SAmr Mokhtar 261ffee690SAmr MokhtarLimitations 271ffee690SAmr Mokhtar----------- 281ffee690SAmr Mokhtar 291ffee690SAmr Mokhtar* Only one baseband device and one ethernet port can be used. 301ffee690SAmr Mokhtar 311ffee690SAmr MokhtarCompiling the Application 321ffee690SAmr Mokhtar------------------------- 331ffee690SAmr Mokhtar 347ce00bf3SKamil Chalupnik#. DPDK needs to be built with ``baseband_turbo_sw`` PMD driver enabled along 357ce00bf3SKamil Chalupnik with ``FLEXRAN SDK`` Libraries. Refer to *SW Turbo Poll Mode Driver* 361ffee690SAmr Mokhtar documentation for more details on this. 371ffee690SAmr Mokhtar 381ffee690SAmr Mokhtar#. Go to the example directory: 391ffee690SAmr Mokhtar 401ffee690SAmr Mokhtar .. code-block:: console 411ffee690SAmr Mokhtar 421ffee690SAmr Mokhtar export RTE_SDK=/path/to/rte_sdk 431ffee690SAmr Mokhtar cd ${RTE_SDK}/examples/bbdev_app 441ffee690SAmr Mokhtar 451ffee690SAmr Mokhtar#. Set the target (a default target is used if not specified). For example: 461ffee690SAmr Mokhtar 471ffee690SAmr Mokhtar .. code-block:: console 481ffee690SAmr Mokhtar 49218c4e68SBruce Richardson export RTE_TARGET=x86_64-native-linux-gcc 501ffee690SAmr Mokhtar 511ffee690SAmr Mokhtar See the *DPDK Getting Started Guide* for possible RTE_TARGET values. 521ffee690SAmr Mokhtar 531ffee690SAmr Mokhtar#. Build the application: 541ffee690SAmr Mokhtar 551ffee690SAmr Mokhtar .. code-block:: console 561ffee690SAmr Mokhtar 571ffee690SAmr Mokhtar make 581ffee690SAmr Mokhtar 591ffee690SAmr MokhtarRunning the Application 601ffee690SAmr Mokhtar----------------------- 611ffee690SAmr Mokhtar 621ffee690SAmr MokhtarThe application accepts a number of command line options: 631ffee690SAmr Mokhtar 641ffee690SAmr Mokhtar.. code-block:: console 651ffee690SAmr Mokhtar 661ffee690SAmr Mokhtar $ ./build/bbdev [EAL options] -- [-e ENCODING_CORES] [-d DECODING_CORES] / 671ffee690SAmr Mokhtar [-p ETH_PORT_ID] [-b BBDEV_ID] 681ffee690SAmr Mokhtar 691ffee690SAmr Mokhtarwhere: 701ffee690SAmr Mokhtar 71*d629b7b5SJohn McNamara* ``e ENCODING_CORES``: hexmask for encoding lcores (default = 0x2) 721ffee690SAmr Mokhtar* ``d DECODING_CORES``: hexmask for decoding lcores (default = 0x4) 731ffee690SAmr Mokhtar* ``p ETH_PORT_ID``: ethernet port ID (default = 0) 741ffee690SAmr Mokhtar* ``b BBDEV_ID``: BBDev ID (default = 0) 751ffee690SAmr Mokhtar 761ffee690SAmr MokhtarThe application requires that baseband devices is capable of performing 771ffee690SAmr Mokhtarthe specified baseband operation are available on application initialization. 781ffee690SAmr MokhtarThis means that HW baseband device/s must be bound to a DPDK driver or 791ffee690SAmr Mokhtara SW baseband device/s (virtual BBdev) must be created (using --vdev). 801ffee690SAmr Mokhtar 81218c4e68SBruce RichardsonTo run the application in linux environment with the turbo_sw baseband device 821ffee690SAmr Mokhtarusing the whitelisted port running on 1 encoding lcore and 1 decoding lcore 831ffee690SAmr Mokhtarissue the command: 841ffee690SAmr Mokhtar 851ffee690SAmr Mokhtar.. code-block:: console 861ffee690SAmr Mokhtar 877ce00bf3SKamil Chalupnik $ ./build/bbdev --vdev='baseband_turbo_sw' -w <NIC0PCIADDR> -c 0x38 --socket-mem=2,2 \ 881ffee690SAmr Mokhtar --file-prefix=bbdev -- -e 0x10 -d 0x20 891ffee690SAmr Mokhtar 90*d629b7b5SJohn McNamarawhere, NIC0PCIADDR is the PCI address of the Rx port 911ffee690SAmr Mokhtar 927ce00bf3SKamil ChalupnikThis command creates one virtual bbdev devices ``baseband_turbo_sw`` where the 937ce00bf3SKamil Chalupnikdevice gets linked to a corresponding ethernet port as whitelisted by 947ce00bf3SKamil Chalupnikthe parameter -w. 951ffee690SAmr Mokhtar3 cores are allocated to the application, and assigned as: 961ffee690SAmr Mokhtar 971ffee690SAmr Mokhtar - core 3 is the master and used to print the stats live on screen, 981ffee690SAmr Mokhtar 991ffee690SAmr Mokhtar - core 4 is the encoding lcore performing Rx and Turbo Encode operations 1001ffee690SAmr Mokhtar 1011ffee690SAmr Mokhtar - core 5 is the downlink lcore performing Turbo Decode, validation and Tx 1021ffee690SAmr Mokhtar operations 1031ffee690SAmr Mokhtar 1041ffee690SAmr Mokhtar 1051ffee690SAmr MokhtarRefer to the *DPDK Getting Started Guide* for general information on running 1061ffee690SAmr Mokhtarapplications and the Environment Abstraction Layer (EAL) options. 1071ffee690SAmr Mokhtar 1081ffee690SAmr MokhtarUsing Packet Generator with baseband device sample application 1091ffee690SAmr Mokhtar-------------------------------------------------------------- 1101ffee690SAmr Mokhtar 1111ffee690SAmr MokhtarTo allow the bbdev sample app to do the loopback, an influx of traffic is required. 1121ffee690SAmr MokhtarThis can be done by using DPDK Pktgen to burst traffic on two ethernet ports, and 1131ffee690SAmr Mokhtarit will print the transmitted along with the looped-back traffic on Rx ports. 1141ffee690SAmr MokhtarExecuting the command below will generate traffic on the two whitelisted ethernet 1151ffee690SAmr Mokhtarports. 1161ffee690SAmr Mokhtar 1171ffee690SAmr Mokhtar.. code-block:: console 1181ffee690SAmr Mokhtar 119218c4e68SBruce Richardson $ ./pktgen-3.4.0/app/x86_64-native-linux-gcc/pktgen -c 0x3 \ 1201ffee690SAmr Mokhtar --socket-mem=1,1 --file-prefix=pg -w <NIC1PCIADDR> -- -m 1.0 -P 1211ffee690SAmr Mokhtar 1221ffee690SAmr Mokhtarwhere: 1231ffee690SAmr Mokhtar 1241ffee690SAmr Mokhtar* ``-c COREMASK``: A hexadecimal bitmask of cores to run on 1251ffee690SAmr Mokhtar* ``--socket-mem``: Memory to allocate on specific sockets (use comma separated values) 1261ffee690SAmr Mokhtar* ``--file-prefix``: Prefix for hugepage filenames 1271ffee690SAmr Mokhtar* ``-w <NIC1PCIADDR>``: Add a PCI device in white list. The argument format is <[domain:]bus:devid.func>. 1281ffee690SAmr Mokhtar* ``-m <string>``: Matrix for mapping ports to logical cores. 1291ffee690SAmr Mokhtar* ``-P``: PROMISCUOUS mode 1301ffee690SAmr Mokhtar 1311ffee690SAmr Mokhtar 1321ffee690SAmr MokhtarRefer to *The Pktgen Application* documents for general information on running 1331ffee690SAmr MokhtarPktgen with DPDK applications. 134