1d30ea906Sjfb8856606.. SPDX-License-Identifier: BSD-3-Clause 2d30ea906Sjfb8856606 Copyright(c) 2017 Intel Corporation 3d30ea906Sjfb8856606 4d30ea906Sjfb8856606.. bbdev_app: 5d30ea906Sjfb8856606 6d30ea906Sjfb8856606Loop-back Sample Application using Baseband Device (bbdev) 7d30ea906Sjfb8856606========================================================== 8d30ea906Sjfb8856606 9d30ea906Sjfb8856606The baseband sample application is a simple example of packet processing using 10d30ea906Sjfb8856606the Data Plane Development Kit (DPDK) for baseband workloads using Wireless 11d30ea906Sjfb8856606Device abstraction library. 12d30ea906Sjfb8856606 13d30ea906Sjfb8856606Overview 14d30ea906Sjfb8856606-------- 15d30ea906Sjfb8856606 16d30ea906Sjfb8856606The Baseband device sample application performs a loop-back operation using a 17d30ea906Sjfb8856606baseband device capable of transceiving data packets. 18d30ea906Sjfb8856606A packet is received on an ethernet port -> enqueued for downlink baseband 19d30ea906Sjfb8856606operation -> dequeued from the downlink baseband device -> enqueued for uplink 20d30ea906Sjfb8856606baseband operation -> dequeued from the baseband device -> then the received 21d30ea906Sjfb8856606packet is compared with the baseband operations output. Then it's looped back to 22d30ea906Sjfb8856606the ethernet port. 23d30ea906Sjfb8856606 24d30ea906Sjfb8856606* The MAC header is preserved in the packet 25d30ea906Sjfb8856606 26d30ea906Sjfb8856606Limitations 27d30ea906Sjfb8856606----------- 28d30ea906Sjfb8856606 29d30ea906Sjfb8856606* Only one baseband device and one ethernet port can be used. 30d30ea906Sjfb8856606 31d30ea906Sjfb8856606Compiling the Application 32d30ea906Sjfb8856606------------------------- 33d30ea906Sjfb8856606 34*2d9fd380Sjfb8856606DPDK needs to be built with ``baseband_turbo_sw`` PMD driver enabled along 35d30ea906Sjfb8856606with ``FLEXRAN SDK`` Libraries. Refer to *SW Turbo Poll Mode Driver* 36d30ea906Sjfb8856606documentation for more details on this. 37d30ea906Sjfb8856606 38*2d9fd380Sjfb8856606To compile the sample application see :doc:`compiling`. 39d30ea906Sjfb8856606 40d30ea906Sjfb8856606 41d30ea906Sjfb8856606Running the Application 42d30ea906Sjfb8856606----------------------- 43d30ea906Sjfb8856606 44d30ea906Sjfb8856606The application accepts a number of command line options: 45d30ea906Sjfb8856606 46d30ea906Sjfb8856606.. code-block:: console 47d30ea906Sjfb8856606 48*2d9fd380Sjfb8856606 $ ./<build_dir>/examples/dpdk-bbdev [EAL options] -- [-e ENCODING_CORES] / 49*2d9fd380Sjfb8856606 [-d DECODING_CORES] [-p ETH_PORT_ID] [-b BBDEV_ID] 50d30ea906Sjfb8856606 51d30ea906Sjfb8856606where: 52d30ea906Sjfb8856606 531646932aSjfb8856606* ``e ENCODING_CORES``: hexmask for encoding lcores (default = 0x2) 54d30ea906Sjfb8856606* ``d DECODING_CORES``: hexmask for decoding lcores (default = 0x4) 55d30ea906Sjfb8856606* ``p ETH_PORT_ID``: ethernet port ID (default = 0) 56d30ea906Sjfb8856606* ``b BBDEV_ID``: BBDev ID (default = 0) 57d30ea906Sjfb8856606 58d30ea906Sjfb8856606The application requires that baseband devices is capable of performing 59d30ea906Sjfb8856606the specified baseband operation are available on application initialization. 60d30ea906Sjfb8856606This means that HW baseband device/s must be bound to a DPDK driver or 61d30ea906Sjfb8856606a SW baseband device/s (virtual BBdev) must be created (using --vdev). 62d30ea906Sjfb8856606 634418919fSjohnjiangTo run the application in linux environment with the turbo_sw baseband device 64*2d9fd380Sjfb8856606using the allow option for pci device running on 1 encoding lcore and 1 decoding lcore 65d30ea906Sjfb8856606issue the command: 66d30ea906Sjfb8856606 67d30ea906Sjfb8856606.. code-block:: console 68d30ea906Sjfb8856606 69*2d9fd380Sjfb8856606 $ ./<build_dir>/examples/dpdk-bbdev --vdev='baseband_turbo_sw' -a <NIC0PCIADDR> \ 70*2d9fd380Sjfb8856606 -c 0x38 --socket-mem=2,2 --file-prefix=bbdev -- -e 0x10 -d 0x20 71d30ea906Sjfb8856606 721646932aSjfb8856606where, NIC0PCIADDR is the PCI address of the Rx port 73d30ea906Sjfb8856606 74d30ea906Sjfb8856606This command creates one virtual bbdev devices ``baseband_turbo_sw`` where the 75*2d9fd380Sjfb8856606device gets linked to a corresponding ethernet port as allowed by 76*2d9fd380Sjfb8856606the parameter -a. 77d30ea906Sjfb88566063 cores are allocated to the application, and assigned as: 78d30ea906Sjfb8856606 79*2d9fd380Sjfb8856606 - core 3 is the main and used to print the stats live on screen, 80d30ea906Sjfb8856606 81d30ea906Sjfb8856606 - core 4 is the encoding lcore performing Rx and Turbo Encode operations 82d30ea906Sjfb8856606 83d30ea906Sjfb8856606 - core 5 is the downlink lcore performing Turbo Decode, validation and Tx 84d30ea906Sjfb8856606 operations 85d30ea906Sjfb8856606 86d30ea906Sjfb8856606 87d30ea906Sjfb8856606Refer to the *DPDK Getting Started Guide* for general information on running 88d30ea906Sjfb8856606applications and the Environment Abstraction Layer (EAL) options. 89d30ea906Sjfb8856606 90d30ea906Sjfb8856606Using Packet Generator with baseband device sample application 91d30ea906Sjfb8856606-------------------------------------------------------------- 92d30ea906Sjfb8856606 93d30ea906Sjfb8856606To allow the bbdev sample app to do the loopback, an influx of traffic is required. 94d30ea906Sjfb8856606This can be done by using DPDK Pktgen to burst traffic on two ethernet ports, and 95d30ea906Sjfb8856606it will print the transmitted along with the looped-back traffic on Rx ports. 96*2d9fd380Sjfb8856606Executing the command below will generate traffic on the two allowed ethernet 97d30ea906Sjfb8856606ports. 98d30ea906Sjfb8856606 99d30ea906Sjfb8856606.. code-block:: console 100d30ea906Sjfb8856606 1014418919fSjohnjiang $ ./pktgen-3.4.0/app/x86_64-native-linux-gcc/pktgen -c 0x3 \ 102*2d9fd380Sjfb8856606 --socket-mem=1,1 --file-prefix=pg -a <NIC1PCIADDR> -- -m 1.0 -P 103d30ea906Sjfb8856606 104d30ea906Sjfb8856606where: 105d30ea906Sjfb8856606 106d30ea906Sjfb8856606* ``-c COREMASK``: A hexadecimal bitmask of cores to run on 107d30ea906Sjfb8856606* ``--socket-mem``: Memory to allocate on specific sockets (use comma separated values) 108d30ea906Sjfb8856606* ``--file-prefix``: Prefix for hugepage filenames 109*2d9fd380Sjfb8856606* ``-a <NIC1PCIADDR>``: Add a PCI device in allow list. The argument format is <[domain:]bus:devid.func>. 110d30ea906Sjfb8856606* ``-m <string>``: Matrix for mapping ports to logical cores. 111d30ea906Sjfb8856606* ``-P``: PROMISCUOUS mode 112d30ea906Sjfb8856606 113d30ea906Sjfb8856606 114d30ea906Sjfb8856606Refer to *The Pktgen Application* documents for general information on running 115d30ea906Sjfb8856606Pktgen with DPDK applications. 116