1.. SPDX-License-Identifier: BSD-3-Clause 2 Copyright(c) 2019 Marvell International Ltd. 3 4Marvell OCTEON TX2 End Point Rawdev Driver 5========================================== 6 7OCTEON TX2 has an internal SDP unit which provides End Point mode of operation 8by exposing its IOQs to Host, IOQs are used for packet I/O between Host and 9OCTEON TX2. Each OCTEON TX2 SDP PF supports a max of 128 VFs and Each VF is 10associated with a set of IOQ pairs. 11 12Features 13-------- 14 15This OCTEON TX2 End Point mode PMD supports 16 17#. Packet Input - Host to OCTEON TX2 with direct data instruction mode. 18 19#. Packet Output - OCTEON TX2 to Host with info pointer mode. 20 21 22Initialization 23-------------- 24 25The number of SDP VFs enabled, can be controlled by setting sysfs 26entry `sriov_numvfs` for the corresponding PF driver. 27 28.. code-block:: console 29 30 echo <num_vfs> > /sys/bus/pci/drivers/octeontx2-ep/0000\:04\:00.0/sriov_numvfs 31 32Once the required VFs are enabled, to be accessible from DPDK, VFs need to be 33bound to vfio-pci driver. 34 35Device Setup 36------------ 37 38The OCTEON TX2 SDP End Point VF devices will need to be bound to a 39user-space IO driver for use. The script ``dpdk-devbind.py`` script 40included with DPDK can be used to view the state of the devices and to bind 41them to a suitable DPDK-supported kernel driver. When querying the status 42of the devices, they will appear under the category of "Misc (rawdev) 43devices", i.e. the command ``dpdk-devbind.py --status-dev misc`` can be 44used to see the state of those devices alone. 45 46Device Configuration 47-------------------- 48 49Configuring SDP EP rawdev device is done using the ``rte_rawdev_configure()`` 50API, which takes the mempool as parameter. PMD uses this pool to send/receive 51packets to/from the HW. 52 53The following code shows how the device is configured 54 55.. code-block:: c 56 57 struct sdp_rawdev_info config = {0}; 58 struct rte_rawdev_info rdev_info = {.dev_private = &config}; 59 config.enqdeq_mpool = (void *)rte_mempool_create(...); 60 61 rte_rawdev_configure(dev_id, (rte_rawdev_obj_t)&rdev_info, 62 sizeof(config)); 63 64Performing Data Transfer 65------------------------ 66 67To perform data transfer using SDP VF EP rawdev devices use standard 68``rte_rawdev_enqueue_buffers()`` and ``rte_rawdev_dequeue_buffers()`` APIs. 69 70Self test 71--------- 72 73On EAL initialization, SDP VF devices will be probed and populated into the 74raw devices. The rawdev ID of the device can be obtained using 75 76* Invoke ``rte_rawdev_get_dev_id("SDPEP:x")`` from the test application 77 where x is the VF device's bus id specified in "bus:device.func"(BDF) 78 format. Use this index for further rawdev function calls. 79 80* The driver's selftest rawdev API can be used to verify the SDP EP mode 81 functional tests which can send/receive the raw data packets to/from the 82 EP device. 83