1.. SPDX-License-Identifier: BSD-3-Clause 2 Copyright(c) 2022 Intel Corporation. 3 4.. include:: <isonum.txt> 5 6CPFL Poll Mode Driver 7===================== 8 9The cpfl PMD (**librte_net_cpfl**) provides poll mode driver support for 10Intel\ |reg| Infrastructure Processing Unit (Intel\ |reg| IPU) E2100. 11Please refer to 12https://www.intel.com/content/www/us/en/products/network-io/infrastructure-processing-units/asic/e2000-asic.html 13for more information. 14 15Linux Prerequisites 16------------------- 17 18Follow the DPDK :doc:`../linux_gsg/index` to setup the basic DPDK environment. 19 20To get better performance on Intel platforms, 21please follow the :doc:`../linux_gsg/nic_perf_intel_platform`. 22 23 24Recommended Matching List 25------------------------- 26 27It is highly recommended to upgrade the MEV-ts release 28to avoid compatibility issues with the cpfl PMD. 29Here is the suggested matching list which has been tested and verified. 30 31 +------------+------------------+ 32 | DPDK | MEV-ts release | 33 +============+==================+ 34 | 23.07 | 0.9.1 | 35 +------------+------------------+ 36 | 23.11 | 1.0 | 37 +------------+------------------+ 38 | 24.07 | 1.4 | 39 +------------+------------------+ 40 | 24.11 | 1.6 | 41 +------------+------------------+ 42 43 44Configuration 45------------- 46 47Runtime Configuration 48~~~~~~~~~~~~~~~~~~~~~ 49 50- ``vport`` (default ``0``) 51 52 The PMD supports creation of multiple vports for one PCI device, 53 each vport corresponds to a single ethdev. 54 The user can specify the vports with specific ID to be created, and ID should 55 be 0 ~ 7 currently, for example: 56 57 -a ca:00.0,vport=[0,2,3] 58 59 Then the PMD will create 3 vports (ethdevs) for device ``ca:00.0``. 60 61 If the parameter is not provided, the vport 0 will be created by default. 62 63- ``rx_single`` (default ``0``) 64 65 There are two queue modes supported by Intel\ |reg| IPU Ethernet E2100 Series, 66 single queue mode and split queue mode for Rx queue. 67 68 For the single queue model, the descriptor queue is used by SW to post buffer 69 descriptors to HW, and it's also used by HW to post completed descriptors to SW. 70 71 For the split queue model, "RX buffer queues" are used to pass descriptor buffers 72 from SW to HW, while RX queues are used only to pass the descriptor completions 73 from HW to SW. 74 75 User can choose Rx queue mode, example: 76 77 -a ca:00.0,rx_single=1 78 79 Then the PMD will configure Rx queue with single queue mode. 80 Otherwise, split queue mode is chosen by default. 81 82- ``tx_single`` (default ``0``) 83 84 There are two queue modes supported by Intel\ |reg| IPU Ethernet E2100 Series, 85 single queue mode and split queue mode for Tx queue. 86 87 For the single queue model, the descriptor queue is used by SW to post buffer 88 descriptors to HW, and it's also used by HW to post completed descriptors to SW. 89 90 For the split queue model, "TX completion queues" are used to pass descriptor buffers 91 from SW to HW, while TX queues are used only to pass the descriptor completions from 92 HW to SW. 93 94 User can choose Tx queue mode, example:: 95 96 -a ca:00.0,tx_single=1 97 98 Then the PMD will configure Tx queue with single queue mode. 99 Otherwise, split queue mode is chosen by default. 100 101- ``representor`` (default ``not enabled``) 102 103 The cpfl PMD supports the creation of APF/CPF/VF port representors. 104 Each port representor corresponds to a single function of that device. 105 Using the ``devargs`` option ``representor`` the user can specify 106 which functions to create port representors. 107 108 Format is:: 109 110 [[c<controller_id>]pf<pf_id>]vf<vf_id> 111 112 Controller_id 0 is host (default), while 1 is accelerator core. 113 Pf_id 0 is APF (default), while 1 is CPF. 114 Default value can be omitted. 115 116 Create 4 representors for 4 vfs on host APF:: 117 118 -a BDF,representor=c0pf0vf[0-3] 119 120 Or:: 121 122 -a BDF,representor=pf0vf[0-3] 123 124 Or:: 125 126 -a BDF,representor=vf[0-3] 127 128 Create a representor for CPF on accelerator core:: 129 130 -a BDF,representor=c1pf1 131 132 Multiple representor devargs are supported. Create 4 representors for 4 133 vfs on host APF and one representor for CPF on accelerator core:: 134 135 -a BDF,representor=vf[0-3],representor=c1pf1 136 137- ``flow_parser`` (default ``not enabled``) 138 139 The cpfl PMD supports utilizing a JSON config file to translate rte_flow tokens into 140 low-level hardware resources. 141 142 The JSON configuration file is provided by the hardware vendor and is intended to work 143 exclusively with a specific P4 pipeline configuration, which must be compiled and programmed 144 into the hardware. 145 146 The format of the JSON file strictly follows the internal specifications of the hardware 147 vendor and is not meant to be modified directly by users. 148 149 Using the ``devargs`` option ``flow_parser`` the user can specify the path 150 of a json file, for example:: 151 152 -a ca:00.0,flow_parser="refpkg.json" 153 154 Then the PMD will load json file for device ``ca:00.0``. 155 The parameter is optional. 156 157 As CPFL PMD can run on both XEON host and IPU's compute complex, 158 the driver dynamically detects which system type it is running on by querying the hostname. 159 160Driver compilation and testing 161------------------------------ 162 163Refer to the document :doc:`build_and_test` for details. 164 165The jansson library must be installed to use rte_flow. 166 167Features 168-------- 169 170Vector PMD 171~~~~~~~~~~ 172 173Vector path for Rx and Tx path are selected automatically. 174The paths are chosen based on 2 conditions: 175 176- ``CPU`` 177 178 On the x86 platform, the driver checks if the CPU supports AVX512. 179 If the CPU supports AVX512 and EAL argument ``--force-max-simd-bitwidth`` 180 is set to 512, AVX512 paths will be chosen. 181 182- ``Offload features`` 183 184 The supported HW offload features are described in the document cpfl.ini, 185 A value "P" means the offload feature is not supported by vector path. 186 If any not supported features are used, cpfl vector PMD is disabled 187 and the scalar paths are chosen. 188 189 190Hairpin queue 191~~~~~~~~~~~~~ 192 193E2100 Series can loopback packets from RX port to TX port. 194This feature is called port-to-port or hairpin. 195Currently, the PMD only supports single port hairpin. 196 197Flow offload 198~~~~~~~~~~~~ 199 200PMD uses a json file to direct CPF PMD to parse rte_flow tokens into 201low level hardware resources. 202 203- Required Libraries 204 205 * jansson 206 207 * For Ubuntu, it can be installed using `apt install libjansson-dev` 208 209- run testpmd with the json file, create two vports 210 211 .. code-block:: console 212 213 dpdk-testpmd -c 0x3 -n 4 -a 0000:af:00.6,vport=[0-1],flow_parser="refpkg.json" -- -i 214 215#. Create one flow to forward ETH-IPV4-TCP from I/O port to a local(CPF's) vport. Flow should be created on 216 vport X. Group M should match fxp module. Action port_representor Y means forward packet to local vport Y:: 217 218 .. code-block:: console 219 220 flow create X ingress group M pattern eth dst is 00:01:00:00:03:14 / ipv4 src is 192.168.0.1 \ 221 dst is 192.168.0.2 / tcp / end actions port_representor port_id Y / end 222 223#. Send a matched packet, and it should be displayed on PMD:: 224 225 .. code-block:: console 226 227 sendp(Ether(dst='00:01:00:00:03:14')/IP(src='192.168.0.1',dst='192.168.0.2')/TCP(),iface="ens25f0") 228