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 34*f8dbaebbSSean MorrisseyDPDK needs to be built with ``baseband_turbo_sw`` PMD enabled along 357ce00bf3SKamil Chalupnikwith ``FLEXRAN SDK`` Libraries. Refer to *SW Turbo Poll Mode Driver* 361ffee690SAmr Mokhtardocumentation for more details on this. 371ffee690SAmr Mokhtar 38e2a94f9aSCiara PowerTo compile the sample application see :doc:`compiling`. 391ffee690SAmr Mokhtar 401ffee690SAmr Mokhtar 411ffee690SAmr MokhtarRunning the Application 421ffee690SAmr Mokhtar----------------------- 431ffee690SAmr Mokhtar 441ffee690SAmr MokhtarThe application accepts a number of command line options: 451ffee690SAmr Mokhtar 461ffee690SAmr Mokhtar.. code-block:: console 471ffee690SAmr Mokhtar 48e2a94f9aSCiara Power $ ./<build_dir>/examples/dpdk-bbdev [EAL options] -- [-e ENCODING_CORES] / 49e2a94f9aSCiara Power [-d DECODING_CORES] [-p ETH_PORT_ID] [-b BBDEV_ID] 501ffee690SAmr Mokhtar 511ffee690SAmr Mokhtarwhere: 521ffee690SAmr Mokhtar 53d629b7b5SJohn McNamara* ``e ENCODING_CORES``: hexmask for encoding lcores (default = 0x2) 541ffee690SAmr Mokhtar* ``d DECODING_CORES``: hexmask for decoding lcores (default = 0x4) 551ffee690SAmr Mokhtar* ``p ETH_PORT_ID``: ethernet port ID (default = 0) 561ffee690SAmr Mokhtar* ``b BBDEV_ID``: BBDev ID (default = 0) 571ffee690SAmr Mokhtar 581ffee690SAmr MokhtarThe application requires that baseband devices is capable of performing 591ffee690SAmr Mokhtarthe specified baseband operation are available on application initialization. 601ffee690SAmr MokhtarThis means that HW baseband device/s must be bound to a DPDK driver or 611ffee690SAmr Mokhtara SW baseband device/s (virtual BBdev) must be created (using --vdev). 621ffee690SAmr Mokhtar 63218c4e68SBruce RichardsonTo run the application in linux environment with the turbo_sw baseband device 64db27370bSStephen Hemmingerusing the allow option for pci device running on 1 encoding lcore and 1 decoding lcore 651ffee690SAmr Mokhtarissue the command: 661ffee690SAmr Mokhtar 671ffee690SAmr Mokhtar.. code-block:: console 681ffee690SAmr Mokhtar 69db27370bSStephen Hemminger $ ./<build_dir>/examples/dpdk-bbdev --vdev='baseband_turbo_sw' -a <NIC0PCIADDR> \ 70e2a94f9aSCiara Power -c 0x38 --socket-mem=2,2 --file-prefix=bbdev -- -e 0x10 -d 0x20 711ffee690SAmr Mokhtar 72d629b7b5SJohn McNamarawhere, NIC0PCIADDR is the PCI address of the Rx port 731ffee690SAmr Mokhtar 747ce00bf3SKamil ChalupnikThis command creates one virtual bbdev devices ``baseband_turbo_sw`` where the 75db27370bSStephen Hemmingerdevice gets linked to a corresponding ethernet port as allowed by 76db27370bSStephen Hemmingerthe parameter -a. 771ffee690SAmr Mokhtar3 cores are allocated to the application, and assigned as: 781ffee690SAmr Mokhtar 79cb056611SStephen Hemminger - core 3 is the main and used to print the stats live on screen, 801ffee690SAmr Mokhtar 811ffee690SAmr Mokhtar - core 4 is the encoding lcore performing Rx and Turbo Encode operations 821ffee690SAmr Mokhtar 831ffee690SAmr Mokhtar - core 5 is the downlink lcore performing Turbo Decode, validation and Tx 841ffee690SAmr Mokhtar operations 851ffee690SAmr Mokhtar 861ffee690SAmr Mokhtar 871ffee690SAmr MokhtarRefer to the *DPDK Getting Started Guide* for general information on running 881ffee690SAmr Mokhtarapplications and the Environment Abstraction Layer (EAL) options. 891ffee690SAmr Mokhtar 901ffee690SAmr MokhtarUsing Packet Generator with baseband device sample application 911ffee690SAmr Mokhtar-------------------------------------------------------------- 921ffee690SAmr Mokhtar 931ffee690SAmr MokhtarTo allow the bbdev sample app to do the loopback, an influx of traffic is required. 941ffee690SAmr MokhtarThis can be done by using DPDK Pktgen to burst traffic on two ethernet ports, and 951ffee690SAmr Mokhtarit will print the transmitted along with the looped-back traffic on Rx ports. 96db27370bSStephen HemmingerExecuting the command below will generate traffic on the two allowed ethernet 971ffee690SAmr Mokhtarports. 981ffee690SAmr Mokhtar 991ffee690SAmr Mokhtar.. code-block:: console 1001ffee690SAmr Mokhtar 101218c4e68SBruce Richardson $ ./pktgen-3.4.0/app/x86_64-native-linux-gcc/pktgen -c 0x3 \ 102db27370bSStephen Hemminger --socket-mem=1,1 --file-prefix=pg -a <NIC1PCIADDR> -- -m 1.0 -P 1031ffee690SAmr Mokhtar 1041ffee690SAmr Mokhtarwhere: 1051ffee690SAmr Mokhtar 1061ffee690SAmr Mokhtar* ``-c COREMASK``: A hexadecimal bitmask of cores to run on 1071ffee690SAmr Mokhtar* ``--socket-mem``: Memory to allocate on specific sockets (use comma separated values) 1081ffee690SAmr Mokhtar* ``--file-prefix``: Prefix for hugepage filenames 109db27370bSStephen Hemminger* ``-a <NIC1PCIADDR>``: Add a PCI device in allow list. The argument format is <[domain:]bus:devid.func>. 1101ffee690SAmr Mokhtar* ``-m <string>``: Matrix for mapping ports to logical cores. 1111ffee690SAmr Mokhtar* ``-P``: PROMISCUOUS mode 1121ffee690SAmr Mokhtar 1131ffee690SAmr Mokhtar 1141ffee690SAmr MokhtarRefer to *The Pktgen Application* documents for general information on running 1151ffee690SAmr MokhtarPktgen with DPDK applications. 116